Authentication
Every /v1 request carries one of your API keys. Reading these docs needs no key.
Send your key
Send the key as a Bearer token:
Authorization: Bearer YOUR_API_KEYx-api-key: YOUR_API_KEYis accepted too, which is what the Anthropic SDK sends.- When both are sent,
Authorization: Bearerwins. AnAuthorizationheader with another scheme is ignored andx-api-keyis used. - On
/v1/messages, the one in the Steerwise key format is used,x-api-keyfirst, so Claude Code works with either.
Key format
A key is sw_live_, 32 random letters and digits, and a 6-character checksum. A mistyped key is refused without a lookup, and secret scanners can tell a key from a lookalike. Keys made on a development deployment start with sw_test_.
Older keys keep working: aip_live_ and aip_test_ keys made before the Steerwise name, and sk-live- keys made before this format.
Scopes
A key has one or both scopes. A key created with no scope chosen gets both.
| Scope | Endpoints |
|---|---|
| inference | Chat completions, Responses, Messages and count_tokens |
| models:read | GET /v1/models and GET /v1/models/{id} |
A key without the scope an endpoint needs gets 403 missing_scope.
Allowed models
A key can be limited to some of your plan’s models. With no limit it can call every model of the plan, including ones added later.
- To use
auto, the list must includeauto. Other models checked next to it narrow whatautopicks from. - A model outside the list is 403
model_not_allowed_for_key; a model outside the plan is 403model_not_allowed.
Keep keys safe
- The key is shown once, when you create or rotate it. Steerwise stores only its hash and a short prefix for display.
- Give each person, bot or service its own key, so each has its own caps and its own line in Usage.
- Rotate or revoke a key in the Console under API keys. A key can also expire on a date you set when you create it.
- Never put a key in client-side code or in a file you commit.
Key errors
| Status | Code | When |
|---|---|---|
| 401 | missing_api_key | No key was sent. |
| 401 | invalid_api_key | The key is malformed, unknown, revoked or expired. |
| 403 | key_paused | The key is paused, usually by the runaway-spend detector after its spend jumped far past its usual rate. |
| 403 | missing_scope | The key lacks the scope this endpoint needs. |
| 403 | model_not_allowed_for_key | The key’s allowed models exclude this model. |