README: per-member image billing restored (system key safety-net only)

This commit is contained in:
Nathan Schneider committed 2026-10-19 08:50:29 -06:00
1 parent a667a54a7b
commit d91c91f7a3
1 file changed
+11 -12
+11 -12
View File
@@ -232,14 +232,14 @@ needed.
is deliberately NOT in the chat picker (image models are not chat models; is deliberately NOT in the chat picker (image models are not chat models;
chat-calling it was the source of the old 500s). chat-calling it was the source of the old 500s).
- **Image generation — two paths**: - **Image generation — two paths**:
1. **MCP tool (default, no key ever, no gate)**: `inference-image` server 1. **MCP tool (default, no key ever)**: `inference-image` server (tool
(tool `generate_image`) — members select it in the composer's **+** `generate_image`) — members select it in the composer's **+** palette
palette and just ask. Images bill to the co-op SYSTEM key and just ask. Per-member billing via `customUserVars.IC_API_KEY` (seeded
(`SYSTEM_IMAGE_KEY`, LiteLLM alias `system-image-fallback`, $5/30d, from the portal) + `env: IC_API_KEY: "{{IC_API_KEY}}"`; a system-key
`regolo/qwen-image` only). No `customUserVars` gate: it made the credential fallback (`system-image-fallback`, $5/30d) covers the rare empty-value
REQUIRED and blocked the whole server for any not-yet-seeded member case. The `customUserVars` gate blocks a not-yet-seeded member until the
(first-login gap) before the fallback could run, and v0.8.8 has no next sync (≤10 min) — accepted as a short delay over billing everything
optional-flag escape hatch. to the system account.
2. **Agent tool**: LibreChat's built-in "OpenAI Image Tools" (env 2. **Agent tool**: LibreChat's built-in "OpenAI Image Tools" (env
`IMAGE_GEN_OAI_BASEURL`/`IMAGE_GEN_OAI_MODEL` → gateway; no admin key, `IMAGE_GEN_OAI_BASEURL`/`IMAGE_GEN_OAI_MODEL` → gateway; no admin key,
members paste their own). Note LibreChat v0.8.8 renders the generated members paste their own). Note LibreChat v0.8.8 renders the generated
@@ -268,10 +268,9 @@ member's own portal-provisioned key automatically:
- `keys` collection: `{userId, name: "Inference Co-op", value: encrypt(JSON.stringify({apiKey}))}` - `keys` collection: `{userId, name: "Inference Co-op", value: encrypt(JSON.stringify({apiKey}))}`
— consumed by the chat endpoint (`apiKey: "user_provided"` in the yaml). — consumed by the chat endpoint (`apiKey: "user_provided"` in the yaml).
- `pluginauths` collection: `{userId, pluginKey: "mcp_inference-image", - `pluginauths` collection: `{userId, pluginKey: "mcp_inference-image",
authField: "IC_API_KEY", value: encrypt(key)}` — currently INERT: image authField: "IC_API_KEY", value: encrypt(key)}` — consumed by the MCP
generation bills to the system key instead (see Feature notes), so this `customUserVars` config so image generation bills to the member's own
row is only written for forward-compatibility if per-member image billing team.
is re-enabled later.
Encryption uses LibreChat's own scheme (`CREDS_KEY`/`CREDS_IV`, AES-256-CBC Encryption uses LibreChat's own scheme (`CREDS_KEY`/`CREDS_IV`, AES-256-CBC
via `@librechat/data-schemas` `encrypt()`), read from the app process env via `@librechat/data-schemas` `encrypt()`), read from the app process env
(`/proc/1/environ`) because `cloudron exec` sessions don't inherit it. (`/proc/1/environ`) because `cloudron exec` sessions don't inherit it.