Skip to content
Open app

Quickstart

Create a key and send a first request in a few minutes.

Create a key

Open API keys and select Create key. Name it after what will use it, and copy the key when it appears: it is shown once.

New accounts get up to $2.50 of free credit for open-weight text models, like the one below. For any other model, add credit with USDC or INFERENCE.

Set the key

export DEFERENCE_API_KEY="sk-df-..."

Send a request

curl https://deference.si/v1/chat/completions \
  -H "Authorization: Bearer $DEFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek/deepseek-v3.2",
    "messages": [{ "role": "user", "content": "Say hello in one sentence." }],
    "max_tokens": 100
  }'

Swap model for any id from Models. Requests that do not meet the free-credit rules need credit.

Check it in Activity

Open Activity. The request is the top row, with its model, tokens and cost. Until the charge settles, the cost is marked as an estimate, then shows the final amount.

Deference rejects invalid keys, missing models, insufficient credit, and its own rate limits before opening an Activity row. Provider errors such as 404 and 429 do appear. A provider 429 counts as a failure.

If it fails
You seeCauseFix
401 missing_api_keyThe variable is empty, so no key was sentSet the variable in the shell that runs the code
401 invalid_api_keyThe key is mistypedSet the variable again from your saved key, or create a replacement. Keep the value out of logs
402 insufficient_creditThe account has no available creditAdd credit
402 free_credit_not_eligibleThe account has only free credit, and this model or request does not qualifyCheck the model price and request restrictions. Lower max_tokens if the worst-case estimate exceeds $0.05, or add credit
404 model_not_foundThe model id is not in the catalogCopy an id from the Models page
429 rate_limitedToo many requests in a minuteWait for the retry-after seconds

Set up a tool

Point your coding tool at Deference next. Every guide is in Coding tools.

Writing code instead? See what your key can do.