MiaRouter logo
MIAROUTER DOCS
Open Console ↗

API Keys

ONE KEY PER CLIENT · SCOPE EVERYTHING · ROTATE WITHOUT MERCY

A MiaRouter key is an sk-… string (prefix sk- plus 48 random characters). It authenticates relay traffic: chat completions, Claude messages, embeddings, audio, images — everything under /v1 and /v1beta. Your account can hold up to 50 keys (admin-configurable), so give every client its own.

Where

Console → Keys ↗. The table lists each key masked; the full value is only shown when you reveal it, and only exists server-side in hashed form.

1Creating a key

  1. Press Create on the Keys page.
  2. Name it after the client that will use it — future-you debugs by name.
  3. Configure scope (below): quota, expiry, groups, model limits.
  4. Save. Reveal the key once and store it in your secret manager. If you lose it, you rotate it — nobody can read it back to you, by design.

2Scoping options

SettingWhat it doesAdvice
QuotaHard spend ceiling for the key, in credits. Unlimited delegates to your account balance.Always set a ceiling for any key that leaves your machine.
ExpiryFixed end time or never.Expire keys you hand to temporary tooling.
Model limitsAllow-list of models this key may call.Give cheap keys cheap models; keep the expensive tiers on your main key.
GroupBilling group the key routes through (e.g. default, vip, svip). Group ratios change effective price.Default group unless you were told otherwise.
Auto-groupsOrdered group fallback list: try the first, fall back on failure.For resilience across group tiers.
Cross-group retryRetry a failed request in the next usable group automatically.Leave on unless cost tiers must never mix.

3Using the key

The relay accepts the key wherever the target wire format expects it:

Client styleHeaderWorks on
OpenAI-styleAuthorization: Bearer sk-…everything
Anthropic-stylex-api-key: sk-…/v1/messages, /v1/models
Gemini-stylex-goog-api-key: sk-… or ?key=sk-…/v1beta/models…, /v1/models

The gateway bridges these automatically — an Anthropic client with an x-api-key header is understood on Claude routes without any shimming.

4Key states

StateMeaningFix
EnabledActive.—
DisabledManually off; requests get 401.Re-enable after fixing whatever made you disable it.
ExpiredExpiry time passed.Extend expiry or create a successor.
ExhaustedKey quota hit zero.Raise the quota or go unlimited (carefully).

5Best practices, non-negotiated

Dedicated-pool keys are different

A key created inside a dedicated pool only works on that pool's subdomain (e.g. yourpool.miarouter.online) and is rejected on the main domain — and vice versa. See Platform Reference.