Classic vs. Scoped API keys
API key scopes
Every scoped API key carries one or more flatresource:action scopes. Compatible API endpoints (such as /v1/audio/speech, /v1/audio/transcriptions, and /v1/chat/completions) require the scope of their underlying inference product (tts:write for speech/chat, stt:write for transcriptions).
For browser or mobile voice-agent clients, create a session on your backend
with your
sk-fish- key via POST /v1/agent/sessions (which issues its own
short-lived client join token); see Authenticated
Sessions.Admin-only scopes and editing scopes
- Only team owners and admins can create, edit, or delete a scoped key that grants
billing:readoraudit_log:read. - You can edit the scopes of an existing Scoped key at any time from API Keys. Changes take effect immediately for
POST /v1/auth/tokensand ephemeral token redemption, and within 60 seconds on cached inference gateway routes. - A non-admin team member editing another member’s scoped key cannot widen its scope set.
- Classic keys cannot be converted to scoped keys or assigned explicit scopes; create a new scoped key and rotate instead.
Per-key USD spend limits
You can set an optional USD spend cap when creating any Classic or Scoped key to bound costs per service, environment, or customer integration. Editing, removing, or resetting a spend cap on an existing key requires team owner or admin role:- Range:
$0.01to$1,000,000,000.00(rounded to 2 decimal places). - Reset cadence (UTC, defaults to
monthlywhen omitted):daily— resets at00:00 UTCevery dayweekly— resets on Monday at00:00 UTCmonthly— resets on the 1st of each month at00:00 UTCnever— cumulative lifetime cap until raised or manually reset
- Unified attribution: Usage from both direct
sk-fish-requests and anyek-fish-ephemeral tokens minted by that key counts toward the parent key’s spend limit. - Manual reset: Team owners and admins can reset the current window’s spend counter to
$0.00at any time using Reset spend on API Keys.
- New HTTP requests and WebSocket upgrades return
402 Payment Required(api_key_spend_limit_exceeded). - Calling
POST /v1/auth/tokensfails fast with402(code: "api_key_spend_limit_exceeded"). - Active WebSocket inference sessions that cross the limit mid-stream are closed cleanly at a frame boundary with WebSocket close code
4002(reasonapi_key_spend_limit_exceeded).
Streaming inference usage is settled in short batches, so actual spend can
slightly exceed the configured cap by the in-flight request or settlement
window.
Inspecting your key programmatically
Any valid Classic or Scoped key can inspect its own type, effective scopes, expiration, and live spend-limit balance by callingGET /apikey/self. No additional scope is required.
Handling scope and spend errors
Error responses differ depending on whether the check runs at the inference edge gateway or the platform API:Inference edge gateway (/v1/tts, /v1/asr, /v1/asr/realtime, /v1/tts/live, /v1/voice-design)
Gateway errors keep the JSON body fixed to {"status": <int>, "message": <string>} for SDK compatibility and put machine-readable codes in response headers:
Platform API (/v1/auth/tokens, /model/*, /wallet/*, /v1/agent/*, /v1/pronunciation-dictionaries/*)
Platform API scope and spend errors return structured JSON fields (note that GET /v1/audit-logs returns {"status": 403, "message": "This endpoint requires an API key with the audit_log:read scope."} instead):
403 Missing scope
402 Spend limit exceeded (POST /v1/auth/tokens)
Next steps
Ephemeral Tokens
Mint single-use ek-fish- tokens for browsers, mobile, and desktop clients.
Get Current API Key
Monitor scopes and spend-limit remaining budget via GET /apikey/self.

