image gen: inject IC_API_KEY via env mapping; add SYSTEM_IMAGE_KEY fallback (system account) so unseeded members never fail
This commit is contained in:
1 parent
17d735d9ad
commit
215400cde7
2 files changed
+14
-5
No files matched your search
+6
-2
@@ -1,7 +1,8 @@
|
||||
version: 1.3.17
|
||||
|
||||
# Inference Co-op gateway — PER-USER keys: each member pastes their own
|
||||
# dashboard key once (apiKey: user_provided). Usage bills to that member's
|
||||
# Inference Co-op gateway — per-member keys. Each member's own dashboard
|
||||
# key auto-loads at login (seeded into LibreChat's user-key store by
|
||||
# /app/data/sync-keys.js from the portal). Usage bills to the member's
|
||||
# own LiteLLM team/budget.
|
||||
endpoints:
|
||||
custom:
|
||||
@@ -183,3 +184,6 @@ mcpServers:
|
||||
title: "Inference Co-op API key"
|
||||
description: "Auto-loaded from your membership — no action needed."
|
||||
sensitive: true
|
||||
env:
|
||||
IC_API_KEY: "{{IC_API_KEY}}"
|
||||
SYSTEM_IMAGE_KEY: "${SYSTEM_IMAGE_KEY}"
|
||||
+8
-3
@@ -38,9 +38,14 @@ def log(msg):
|
||||
|
||||
def tool_generate_image(args):
|
||||
# Seamless: use the member's own key if LibreChat injected one; otherwise
|
||||
# fall back to a keyless request so members who never saved a key can
|
||||
# still generate images (the gateway bills their shared co-op allowance).
|
||||
key = (os.environ.get("IC_API_KEY") or "").strip()
|
||||
# fall back to the co-op's SYSTEM key (so a member who has never been
|
||||
# seeded — e.g. right after first login — still generates an image,
|
||||
# billed to the system account). Only if both are absent send keyless.
|
||||
key = (
|
||||
os.environ.get("IC_API_KEY")
|
||||
or os.environ.get("SYSTEM_IMAGE_KEY")
|
||||
or ""
|
||||
).strip()
|
||||
auth_header = {"Authorization": f"Bearer {key}"} if key else {}
|
||||
|
||||
prompt = str(args.get("prompt") or "").strip()
|
||||
|
||||
Reference in new issue
Block a user