Docs menu

Docs / Get started

Quickstart

Create a key, point your client at Cent AI, and send a first request.

Last updated


Your setup

Fills in YOUR_API_KEY in the code on this page. The key stays in this tab: it is never sent and never saved.

1. Create an API key

Sign in and open Keys in the dashboard. Create a key. It looks like cai_<secret> and is shown once: copy it now, because Cent AI stores only a hash and cannot show it again.

New keys have no limits. You can add a daily or monthly limit, an IP allowlist and a model allowlist to each key. See Authentication.

2. Add balance

Requests are paid from a prepaid USD balance. Top up from $1 with QRIS or USDT/USDC on Solana, or buy a one-time budget pack of $1.99, $9.99 or $99. With no balance available for the model, a request returns HTTP 402 insufficient_balance and is not sent to a model. See Balance.

3. Set the base URL

Cent AI speaks three API formats on one host.

FormatBase URLYour client adds
OpenAI Chat Completions, OpenAI Responseshttps://api.cent-ai.dev/v1/chat/completions, /responses
Anthropic Messageshttps://api.cent-ai.dev/v1/messages

4. Send a first request

Replace YOUR_API_KEY with your key.

export CENT_AI_KEY="YOUR_API_KEY"

curl https://api.cent-ai.dev/v1/chat/completions \
  -H "Authorization: Bearer $CENT_AI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.3","messages":[{"role":"user","content":"Hello"}]}'

The response has the standard OpenAI shape. Cent AI adds one field: usage.cost, the amount charged for this request in USD.

{
  "id": "chatcmpl-9f2c1a",
  "object": "chat.completion",
  "model": "glm-5.3",
  "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello!" }, "finish_reason": "stop" }],
  "usage": {
    "prompt_tokens": 10000,
    "prompt_tokens_details": { "cached_tokens": 9000 },
    "completion_tokens": 800,
    "total_tokens": 10800,
    "cost": "0.000363000"
  }
}

5. Check the cost

Every request appears on the Requests page of the dashboard with its tokens per rate, the rates used and the cost. The x-request-id response header is the same ID you see there. See Request cost.

Next steps