1 USD ≈ 27,000 credits · display only
Reference rate may change over time.
1 USD ≈ 27,000 credits · display only
Reference rate may change over time.
Coming to Gommo platform
BYOK is not on Gommo public API yet. This checklist applies to the preview on self-hosted gateway only.
Use after BYOK reference when moving from dev/staging to a self-hosted or single-instance production gateway.
Beta
BYOK remains beta — this checklist reduces operational risk; it does not remove beta limits (file store, fee ledger, model map edits).
Production must set BYOK_ENCRYPTION_KEY when BYOK_ENABLED=true (default). The gateway refuses to start without it when NODE_ENV=production.
Generate a 32-byte key:
npm run byok:generate-key
# or: openssl rand -base64 32Set on the host (Railway/Fly secrets, Docker env, never commit):
NODE_ENV=production
BYOK_ENCRYPTION_KEY=<paste-base64-key>Also used by: Observability background poll queue (data/observability-background-polls.json) — same key material as BYOK credentials.
Rotating keys
Changing BYOK_ENCRYPTION_KEY invalidates existing encrypted data in byok-store.json and observability poll queue. Plan migration or re-save credentials after rotation.
Mount or back up these paths on the gateway host:
| File | Purpose |
|---|---|
data/byok-store.json | Encrypted provider keys + linked Gommo tokens |
data/byok-usage.jsonl | BYOK usage events (append-only) |
data/byok-fee-ledger.json | Platform fee accrual (if fees enabled) |
config/byok-model-map.json | Chat model routing (or BYOK_MODEL_MAP_FILE) |
Single instance: file store is fine. Multiple replicas: share the same files via NFS/EFS or run one gateway instance for BYOK until a shared store exists.
| Variable | Production notes |
|---|---|
BYOK_ENABLED | true (default) — set false to disable entirely |
BYOK_ENCRYPTION_KEY | Required — see above |
BYOK_STORE_FILE | Absolute path on persistent disk |
BYOK_MODEL_MAP_FILE | Commit map in image or mount config volume |
BYOK_BETA | true (default) — portal shows beta badge |
BYOK_DEFAULT_SHARED_FALLBACK | true = Gommo fallback when provider fails |
BYOK_PLATFORM_FEE_* | Optional — see BYOK reference |
BYOK_PROVIDERS | Default openai,anthropic |
See Deploy for GATEWAY_CORS_ORIGIN, ADMIN_API_KEY, merchant GOMMO_*.
config/byok-model-map.json (or custom BYOK_MODEL_MAP_FILE).gatewayModelId → provider + upstreamModel (+ optional gommoServer).GET /gateway/byok/status → supportedChatModels.Users must pick models from that list in Chat / API — do not guess upstream model ids.
/app/byok/ needs docs built with VITE_GATEWAY_URL pointing to your API — see Deploy § Docs.GATEWAY_CORS_ORIGIN.GATEWAY_PORTAL=true only if you serve /portal from the API host (unusual in prod; prefer static docs site).Logged in on your deployed portal (or staging with NODE_ENV=production):
/app/chat/) → BYOK-mapped model → message succeeds; usage row on BYOK Usage tabAutomated (CI, no live provider call):
npm run test:byokbyok-store.json, byok-usage.jsonl, byok-fee-ledger.json, and model map on a schedule.BYOK_ENCRYPTION_KEY → start.402 INSUFFICIENT_CREDITS on BYOK chat (platform fee pre-check).byok-usage.jsonl or BYOK Usage tab.GET /health — byokEnabled / byokBeta in response data.