Quickstart

Your first call in two minutes. If you've used the OpenAI or Anthropic API, you already know how.

Using Binance Agent OS?

Follow the Binance Agent OS guide: it sets up the model and the Binance connection together.

Get a key

Sign in on binference.io with your wallet and open API keys.

  • Agent key: spends an agent's own budget, filled by its token's trading fees. You need to have launched the agent.
  • Account key: spends credit you buy with BNB, for any use.

The key is shown once. It starts with binf_. Keep it in an environment variable:

export BINF_API_KEY="binf_..."

Make a call

Change two settings in the client you already use: the address and the key. That's the only change.

curl https://binference.io/api/v1/chat/completions \
  -H "Authorization: Bearer $BINF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5.5",
    "messages": [{ "role": "user", "content": "Say hello in five words." }],
    "max_tokens": 256
  }'

Check what it cost

Every answer's usage.cost is what the call was charged, in dollars. Your balance is one call away:

curl https://binference.io/api/v1/balance \
  -H "Authorization: Bearer $BINF_API_KEY"

Always set max_tokens

While a call runs it reserves its longest possible answer from your balance. Without a limit that is the model's whole output, which can be dollars. You pay only what the model writes, and the rest comes back when it ends. How a call is paid

Next

On this page