Authentication
API keys, what they allow and how they stop working.
The header
Every request carries your key as a bearer token. Keys are sk-so-v1- followed by 64 hex characters.
1Authorization: Bearer sk-so-v1-...A key is shown once, when you create it. We store only its SHA-256, so we cannot show it to you again and neither can anyone who reaches our database — a lost key is replaced, not recovered.
When a key stops working
| Reason | Response |
|---|---|
| You disabled it | 401 key_disabled |
| It passed its expiry date | 401 key_expired |
| Its spend reached the key's credit limit | 402 key_limit_reached |
| The account ran out of credits | 402 insufficient_credits |
| It sent more requests than its per-minute allowance | 429 rate_limit_exceeded |
Disabling a key keeps its history, so its past usage stays visible in Logs. Deleting one removes the key but leaves the usage rows behind.
Key kinds
There are two kinds of key and they are not interchangeable. An inference key calls models. A management key administers the account: it creates and edits inference keys, and reads your balance and usage. Sending one where the other belongs is refused with 403 wrong_key_kind rather than half-accepted.
Both look the same on the wire, so keep them apart deliberately. Inference keys live under API Keys, management keys under Management Keys.
The management API
Administration over HTTP, for provisioning scripts and CI: the same base URL, authenticated with a management key.
| Endpoint | What it does |
|---|---|
GET https://api.sothe.net/v1/me | The account, its balance and its workspace defaults. |
GET https://api.sothe.net/v1/keys | Your inference keys, with each one's lifetime spend. |
POST https://api.sothe.net/v1/keys | Creates one. Takes name and optionally limit_usd, rate_limit_per_min and expires_in_days. The reply carries the key itself, once. An account holds at most 5 keys of both kinds; past that the reply is 409 key_limit_reached. |
GET|PATCH|DELETE https://api.sothe.net/v1/keys/{id} | Reads one, changes its name, limit_usd, rate_limit_per_min or disabled, or deletes it. |
GET https://api.sothe.net/v1/credits | Balance, plus top-ups, refunds and adjustments. |
GET https://api.sothe.net/v1/usage | One row per request, newest first. Takes hours, limit, offset and model. |
1curl https://api.sothe.net/v1/keys \2 -H "Authorization: Bearer $SOTHE_MANAGEMENT_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "name": "CI",6 "limit_usd": 25,7 "rate_limit_per_min": 120,8 "expires_in_days": 309 }'1{2 "object": "api_key",3 "id": "019a7c3e-51d2-7f04-b8a1-6c2f0d9e4b73",4 "name": "CI",5 "key_prefix": "sk-so-v1-9f2...c41",6 "key": "sk-so-v1-9f2b7e...shown once",7 "disabled": false,8 "expired": false,9 "limit_usd": 25,10 "usage_usd": 0,11 "rate_limit_per_min": 120,12 "created_at": "2026-09-21T15:52:44.000Z",13 "last_used_at": null,14 "expires_at": "2026-10-21T15:52:44.000Z"15}A field we do not recognise is an error, not something ignored: limit instead of limit_usd comes back as 400 unknown_field rather than silently creating a key with no cap. A management key is allowed 60 requests per minute and carries no spend cap of its own, since it never buys tokens.
The management API only ever sees inference keys — it lists, creates, edits and deletes those. So a leaked management key can spend money, but it cannot create a second management key, and it cannot disable the one you would use to shut it off. That stays in the dashboard, behind your password.
Calling from a browser
The API sets permissive CORS headers, so a browser can call https://api.sothe.net/v1 directly. That is useful for a prototype and dangerous in production: anything the browser can read, your users can read, including the key.
Put a small endpoint of your own in front of Sothe and keep the key there. Then a leaked browser session costs you one user's requests rather than your whole balance.