Skip to content

Providers & credentials ​

The Providers page is where you manage the platform's AI supply. A provider exists because an adapter ships for it and its API key is in the environment — there is no list to install from. Providers that can list their own models (OpenAI, Google Gemini, xAI, OpenRouter, ElevenLabs, BytePlus, Alibaba DashScope) also keep their model catalogue up to date by themselves.

First-time setup ​

  1. Put the provider's key in the server environment (e.g. OPENAI_API_KEY), then Providers → Sync models. That installs the provider, links the key, and asks the provider what it offers. Discovered models arrive off sale — enable the ones you want on the Models page.
  2. Or add a key by hand: Providers → click a provider → Add credentials.
  3. Enter a label ("Main OpenAI key") and either:
    • the API key itself — stored encrypted, shown masked forever after; or
    • an env-var reference (OPENAI_API_KEY) — key stays on the server, DB stores only the pointer.
  4. Click Verify on the new row — the platform pings the provider's API with the key and shows ok / unreachable.

Multiple accounts on one provider ​

Add as many reseller accounts as you like per provider (e.g. two OpenAI orgs). Traffic distributes across all ACTIVE accounts by weight (Routing dialog). Use cases:

  • Migrating keys — add the new account, Verify it, set the old one to SUSPENDED. Zero downtime.
  • Cost tiers — set costMultiplier: 0.9 on a discounted account and give it higher weight.
  • Blast-radius control — split traffic so one revoked key doesn't take the provider down.

Rotating a credential ​

Row → key icon (Rotate credentials) → paste the new key → Save. The account keeps its label, weight, budgets, and usage history; only the secret changes. Then Verify. The old key stops being used immediately.

Budgets — your spending guardrails ​

Row → Routing → set Daily budget / Monthly budget (in poisha — 5000000 = ৳50,000). When spend hits the cap the account flips to EXHAUSTED and traffic fails over to other accounts (or errors if none remain). Budgets reset automatically at period boundaries; force-reset via row menu → Reactivate + reset budget.

The Budget (daily) column shows a live progress bar of spend vs cap.

Health ​

  • Verify (per row) — one account.
  • Health-check all (page header) — makes a real authenticated call for every credential, not a ping any key would pass, and reports each provider as HEALTHY / DEGRADED / DOWN / AUTH_FAILED / UNCONFIGURED. Several providers also return their own limits: OpenRouter's spend cap and remaining credit, ElevenLabs' character quota, xAI's key state.
  • A scheduled check runs every 10 minutes, and a model sync every 6 hours per provider.
  • Reseller-account statuses: ACTIVE (serving) · RATE_LIMITED (backing off) · EXHAUSTED (budget or provider quota hit) · SUSPENDED (key rejected, or switched off by an admin).

Automatic recovery ​

Blocked accounts come back on their own. Every 10 minutes, before the health check, the platform re-checks each blocked account with a real authenticated call and puts it back to ACTIVE if the call passes:

Account is…Re-checked whenComes back when
SUSPENDED by the platform (the provider rejected the key)every 10 minutesthe key passes the check again
RATE_LIMITEDits backoff has run outthe check passes
EXHAUSTEDits backoff has run out and it is under its budget capsthe check passes
EXHAUSTED over its own budget cap—the hourly budget reset, when the day or month rolls
SUSPENDED by an adminneveran admin sets it back to ACTIVE

Each recovery is written to the audit log as reseller.auto-recover, and the provider's status is recalculated on the same run. Setting an account's status by hand marks it manually-set, so the platform never undoes an admin's choice.

A provider that answers 403 for one model (for example OpenAI's "your organization must be verified to use this model") no longer suspends the account. That request fails with the provider's message, and every other model keeps working.

Provider status & auto-disable ​

A provider (the parent, e.g. Gemini) has its own status, shown as a badge on the Providers page:

StatusMeaningSet by
ACTIVEServing traffic; listed to customersmanual / auto
DEGRADEDServing but flagged (e.g. partial issues)manual
INACTIVENo usable reseller account — hidden from customersautomatic
DISABLEDTurned off by an operatormanual

Auto-disable: when a provider's last ACTIVE reseller account goes away (suspended, rate-limited, exhausted, or deleted), the platform automatically flips the provider to INACTIVE. An INACTIVE provider disappears from the client model lists (/v1/models, /v1/models/me) and its models return PROVIDER_UNAVAILABLE — no more silent 503s at request time. As soon as an account becomes ACTIVE again, the provider auto-recovers to ACTIVE — within 10 minutes at most, because the recovery sweep above re-checks blocked accounts and recalculates every provider's status.

DEGRADED and DISABLED are manual states and are never auto-changed. The manual status toggle offers only ACTIVE / DEGRADED / DISABLED — INACTIVE is auto-only.

kikori.ai — internal documentation