Documentation

Authentication

API keys, what they allow and how they stop working.

When a key stops working

ReasonResponse
You disabled it401 key_disabled
It passed its expiry date401 key_expired
Its spend reached the key's credit limit402 key_limit_reached
The account ran out of credits402 insufficient_credits
It sent more requests than its per-minute allowance429 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.

EndpointWhat it does
GET https://api.sothe.net/v1/meThe account, its balance and its workspace defaults.
GET https://api.sothe.net/v1/keysYour inference keys, with each one's lifetime spend.
POST https://api.sothe.net/v1/keysCreates 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/creditsBalance, plus top-ups, refunds and adjustments.
GET https://api.sothe.net/v1/usageOne row per request, newest first. Takes hours, limit, offset and model.
Shell
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  }'
JSON
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.

A management key cannot mint another

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.

Proxy instead

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.