Chat Completions
POST/api/v1/chat/completions
Sends a message to a model and returns its full reply. Non-streaming — the response is a single JSON object once the model finishes.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | A modelId from Models |
messages | array | yes | { role, content } objects, in order |
max_tokens | number | no | Caps the reply length |
temperature | number | no | Sampling temperature |
json
{
"model": "anthropic/claude-haiku-4.5",
"messages": [
{ "role": "user", "content": "Explain wallets in one sentence." }
],
"max_tokens": 200
}Response
json
{
"id": "string",
"model": "string",
"message": { "role": "assistant", "content": "string" },
"usage": { "promptTokens": 0, "completionTokens": 0 },
"cost": 0.0
}Errors
| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
402 | Insufficient wallet balance |
403 | API key is inactive |
400 | model is missing or not in the catalog |
429 | A request from this key's account is already in progress |
502 | The model call itself failed — not billed |