Skip to content
Open app

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-..."

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

ClientBase URL
OpenAI SDKs and most toolshttps://deference.si/v1
Anthropic SDKs and Claude Codehttps://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

StatusCodeCause
401missing_api_keyNo key in the request
401invalid_api_keyThe key is not recognized
401api_key_disabledThe key is disabled
401api_key_expiredThe 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.