Docs
Making your first request
One complete chat completion request, with every field explained. This is the shape every Aniron integration builds on.
The request
POST /v1/chat/completions
{
"model": "aniron/llama-3.1-70b",
"messages": [
{ "role": "system", "content": "You are a concise assistant." },
{ "role": "user", "content": "Explain TCP in one sentence." }
],
"fallbacks": ["aniron/llama-3.3-70b", "aniron/claude-sonnet-4"],
"temperature": 0.7,
"stream": false
} -
model— the primary model to route to, prefixed withaniron/. See the model list in the dashboard for available names. -
messages— an array of{ role, content }objects. Roles aresystem,user, andassistant— identical to the OpenAI shape. -
fallbacks— optional. An ordered array of backup models. Ifmodelreturns a rate limit or server error, Aniron automatically retries with the next model in the array. See Model Fallbacks. -
temperature— optional, 0–2. Controls sampling randomness. Omit it to use the model's default. -
stream— optional, defaults tofalse. Set totrueto receive the response as server-sent events — see Streaming.
The response
200 OK
{
"id": "chatcmpl-8f3a1c2b9d4e",
"object": "chat.completion",
"created": 1757500000,
"model": "aniron/llama-3.1-70b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "TCP is a connection-oriented protocol that guarantees ordered, reliable delivery of a byte stream between two hosts."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 27,
"total_tokens": 51
}
} -
id— a unique identifier for this completion. Useful to include in support requests. -
model— the model that actually produced the response. If a fallback was triggered, this will differ from themodelyou requested. -
choices[0].message.content— the assistant's reply. Access it the same way you would with any OpenAI-compatible SDK. -
choices[0].finish_reason—stopfor a natural completion,lengthif it was truncated bymax_tokens, ortool_callsif the model wants to call a function — see Tool Calling. -
usage— token counts for billing. Credits are deducted only for the model that produced the final response, not for any failed fallback attempts.
Read the full API reference
Every parameter, response field, and error code for the Chat Completions endpoint.