← All docs

POST /v1/chat/completions

OpenAI-compatible chat completions. Supports streaming, tool calls, and structured outputs.

Chat completions (LLM). Set stream: true for token-by-token SSE streaming.

Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g. everyais/claude-opus-5)
messagesarrayYesArray of 1–1000 messages. role is system / user / assistant / tool / developer (normalized to system). content is a string, null, or an array of multimodal parts (up to 1000)
streambooleanNoSSE streaming (default false)
stream_optionsobjectNoWith {"include_usage": true}, the final chunk includes usage
max_tokensintegerNoMaximum output tokens, 1–200000. max_completion_tokens is normalized automatically
temperaturenumberNo0–2
top_pnumberNo0–1
stopstring | string[]NoUp to 4
nintegerNoOnly 1 is supported (default 1). 2 or more returns 400
presence_penalty / frequency_penaltynumberNo-2–2
seedintegerNoReproducibility hint
toolsarrayNoFunction tool definitions (up to 512) and the server-side web search {"type":"web_search"} (up to 1 — see the web search guide)
tool_choicestring | objectNoauto / none / required, or {"type":"function","function":{"name":"..."}}. Applies to function tools only
response_formatobjectNo{"type":"text"} · {"type":"json_object"} · {"type":"json_schema","json_schema":{...}}
reasoning_effortstringNonone / low / medium / high
parallel_tool_callsbooleanNoAllow parallel tool calls
logprobs / top_logprobsboolean / integerNoPassed through to OpenAI-compatible backends only. top_logprobs is 0–20
userstringNoEnd-user identifier
everyaisobjectNoGateway options — {"cache":"on"|"off","cache_ttl":"5m"|"1h"} and provider
providerobjectNoEndpoint hint — only / order / ignore / sort (price| latency| throughput) / allow_fallbacks. List price stays the model price. sort changes routing only.
modelsstring[]NoCatalog fallback, max 5. Tried before reservation when the first model is not callable.
extra_bodyobjectNoProvider-specific extensions — only the anthropic / google / openai / everyais keys are allowed (any other key returns 400). extra_body.provider is rejected.

You may append :nitro (prefer lower latency) or :floor (prefer lower endpoint cost) to a model slug. Billing does not change.

Undefined OpenAI parameters (logit_bias, store, etc.) are silently ignored.

Request

{
  "model": "everyais/claude-opus-5",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ],
  "stream": false,
  "max_tokens": 1024
}

Response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1709884800,
  "model": "everyais/claude-opus-5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 10,
    "total_tokens": 35
  }
}

Streaming

With stream: true, data: {...} SSE chunks follow one another and end with data: [DONE]. Enabling stream_options.include_usage appends a final usage chunk.