Skip to content

Get started

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. Models that are not open-weight need credit.

Check it in Activity

Open Activity. The request is the top row, with its model, tokens and cost. The cost reads "estimating" for a few seconds, then shows the final amount. A request rejected with a 401, 402, 404 or 429 does not appear there.

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 qualifyUse an open-weight text model, or set a lower max_tokens
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.