Start here
Quickstart
From no account to a model's answer in your terminal. Each step below depends on the one before it.
Steps
Create an account and add credit
Create an account, then add credit on the Billing page of the console. A request is refused with
402 insufficient_credituntil the account can pay for it, unless the model is on the free tier or covered by an active plan.Create an API key
Open API keys in the console and create a key. Keys start with
sk-oneapi-. Copy it when it is shown and keep it on the server side.Export the key
Every example in these docs reads the key from this variable:
export ONEAPI_API_KEY="sk-oneapi-..."Send a request
This calls the OpenAI Chat Completions path. The Python and Node.js tabs use the official
openaipackage with only the base URL changed.curl https://api.oneapi.id/v1/chat/completions \ -H "Authorization: Bearer $ONEAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-fable-5.1", "messages": [{"role": "user", "content": "Say hello in one sentence."}] }'
What came back
A 200 response in the Chat Completions format: the reply is in choices[0].message.content and the tokens you were charged for are in usage. The response also carries an X-Request-Id header; quote it when you contact support about a specific request.
If the status is not 200, the body is a JSON error with a stable code field. Errors lists every code and what to do about it.
Next
- Using the Anthropic SDK instead? Call /v1/messages.
- Want tokens as they are generated? Read Streaming.
- Sharing a key with a project or a teammate? Give it a spend cap, see key controls.