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 with aniron/. See the model list in the dashboard for available names.
  • messages — an array of { role, content } objects. Roles are system, user, and assistant — identical to the OpenAI shape.
  • fallbacks — optional. An ordered array of backup models. If model returns 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 to false. Set to true to 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 the model you requested.
  • choices[0].message.content — the assistant's reply. Access it the same way you would with any OpenAI-compatible SDK.
  • choices[0].finish_reasonstop for a natural completion, length if it was truncated by max_tokens, or tool_calls if 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.