Authentication
Send your API key as a bearer token or in x-api-key.
These need no key: GET /v1, GET /v1/models, GET /v1/models/{id}, GET /v1/credit and GET /v1/credit/quote. Inference POSTs, GET /v1/key, GET /v1/balance and GET /v1/credit/purchases need a key. POST /v1/faucet, POST /v1/auth/nonce, GET and POST /v1/keys, and DELETE /v1/keys/{id} answer 410 endpoint_retired with no key. /v1/admin/* checks ADMIN_API_TOKEN and answers 404 not_found when it is unset. Keys start with sk-df-.
Send the key
Either header works on every endpoint.
curl https://deference.si/v1/key \
-H "Authorization: Bearer sk-df-..."curl https://deference.si/v1/key \
-H "x-api-key: sk-df-..."OpenAI's SDKs send Authorization. Anthropic's SDKs send x-api-key. Claude Code sends the token as Authorization when you set ANTHROPIC_AUTH_TOKEN.
Base URLs
| Client | Base URL |
|---|---|
| OpenAI SDKs and most tools | https://deference.si/v1 |
| Anthropic SDKs and Claude Code | https://deference.si |
Keys
Create keys in API keys. A key is shown once. Each key can have a credit limit and an expiry. See Keys and security.
Failures
| Status | Code | Cause |
|---|---|---|
| 401 | missing_api_key | No key in the request |
| 401 | invalid_api_key | The key is not recognized |
| 401 | api_key_disabled | The key is disabled |
| 401 | api_key_expired | The key has expired |
A request rejected for its key does not appear in Activity.
Keep keys secret
Call the API from a server. A key in client-side code can be read and spent by anyone.