← All docs

Endpoints

Create a chat completion

POST/v1/chat/completions

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

Body

modelstringYes
Model ID (e.g. everyais/claude-opus-5)
messagesarrayYes
Array 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)
streambooleanNo
SSE streaming (default false)
stream_optionsobjectNo
With {"include_usage": true}, the final chunk includes usage
max_tokensintegerNo
Maximum output tokens, 1–200000. max_completion_tokens is normalized automatically
temperaturenumberNo
0–2
top_pnumberNo
0–1
stopstring | string[]No
Up to 4
nintegerNo
Only 1 is supported (default 1). 2 or more returns 400
presence_penalty / frequency_penaltynumberNo
-2–2
seedintegerNo
Reproducibility hint
toolsarrayNo
Function tool definitions (up to 512) and the server-side web search {"type":"web_search"} (up to 1 — see the web search guide)
tool_choicestring | objectNo
auto / none / required, or {"type":"function","function":{"name":"..."}}. none also disables web search
response_formatobjectNo
{"type":"text"} · {"type":"json_object"} · {"type":"json_schema","json_schema":{...}}
reasoning_effortstringNo
none / low / medium / high
parallel_tool_callsbooleanNo
Allow parallel tool calls
logprobs / top_logprobsboolean / integerNo
Forwarded on Chat Completions routes that support them. top_logprobs is 0–20. Explicit values return 400 on OpenAI/Mantle upstream Responses routes
userstringNo
End-user identifier
everyaisobjectNo
Gateway options — {"cache":"on"|"off","cache_ttl":"5m"|"1h"} and provider
providerobjectNo
Routing hints: sort (price / latency / throughput) and allow_fallbacks. Selecting providers by name is not supported.
modelsstring[]No
Catalog fallback, max 5. Tried before reservation when the first model is not callable.
extra_bodyobjectNo
Provider-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.

Model-specific options

The table above describes the shared input schema, not universal model support. Check capabilities and limits in GET /v1/models. false means unsupported; an omitted field means support is unverified. Explicit unsupported options, values, and combinations return 400.

Model / routeSupported values and combinations
Claude Opus 5 and other latest Claude / BedrockOmit temperature, top_p, and extra_body.anthropic.top_k; explicit values return 400. reasoning_effort values low/medium/high use adaptive thinking and effort, without converting them into manual budget_tokens
Claude Opus 4.6 / Sonnet 4.6Support both adaptive and manual thinking. Manual budgets require 1024 ≤ budget_tokens < max_tokens
Claude 3.7 Sonnet / Opus 4, 4.1, 4.5 / Sonnet 4, 4.5 / Haiku 4.5Support manual thinking. reasoning_effort requests thinking budgets of 2048 (low), 8192 (medium), or 32768 (high); this budget is added to max_tokens in the provider request
Claude Fable / MythosDisabling reasoning with reasoning_effort: "none" returns 400
Gemini 3.6, 3.7, 3.8 Flash / 3.5 Flash-LiteExplicit temperature, top_p, or extra_body.google.top_k returns 400. Omission uses the provider default
Gemini 3.1 Flash Image / Flash-Lite Image (Chat)Only explicit reasoning_effort: "high" is supported. See image endpoint documentation for size and quality
Gemini 3 ProSupports low/high; medium/none return 400
Gemini 3.1 Pro / Gemini 3 Flash, 3.1 Flash-Lite, 3.5 FlashSupports low/medium/high. none returns 400 and is never changed to low
Gemini 2.5 ProThinking budgets: low=2048, medium=8192, high=32768 tokens; none returns 400
Gemini 2.5 Flash / Flash-LiteThinking budgets: none=0, low=2048, medium=8192, high=24576 tokens
  • With thinking enabled on Claude 4.6 and earlier, explicit temperature must be 1, top_p must be 0.95–1, and top_k returns 400. Opus/Sonnet 4.5 and 4.6, plus Haiku 4.5, also reject specifying both temperature and top_p. Manual thinking cannot be combined with tool_choice: "required" or a named function. Fable/Mythos 5.1 does not support forced tool selection at all.
  • Chat max_tokens can be capped at the model's output limit. A manual budget supplied directly through extra_body.anthropic.thinking is not added to max_tokens; it must be smaller than max_tokens.
  • An OpenAI-compatible request format does not imply identical options across provider routes. OpenAI/Mantle upstream Responses routes (including GPT-6 and Responses-only models) return 400 for explicit stop, seed, presence_penalty, frequency_penalty, logprobs, or top_logprobs. Even logprobs: false differs from omission. These options are not silently ignored; user is forwarded unchanged as the end-user identifier. This provider-route restriction also applies when your public endpoint is /v1/chat/completions.
  • capabilities.sampling describes sampling support; limits.reasoning_efforts lists the model's reasoning levels. Omission uses the model default and differs from none.
  • json_mode means JSON output requests; structured_outputs means native strict schema support. Claude json_object and JSON schemas with strict omitted or false use a best-effort prompt and do not guarantee schema compliance. strict: true requires native support; otherwise it returns 400. Claude function.strict also requires native support.
  • Strict function tools have separate support requirements from JSON schemas. Gemini 3 function.strict: true uses the provider's VALIDATED mode for automatic tool selection. Gemini 2.5 supports JSON schemas but rejects strict function tools (strict: true) with 400.
  • Claude native strict support depends on the route. Bedrock supports Opus/Sonnet 4.5 and 4.6, plus Haiku 4.5; this does not automatically extend to Opus 5. Rely on support only when the public capability is true.
  • Claude honors parallel_tool_calls: false by disabling parallel tool use. Gemini rejects false with 400; true or omission allows the provider's parallel calls.
  • Gemini 2.5 rejects combining JSON output (json_object/json_schema) with tools, and rejects mixing web search with function tools, with 400. Use those features separately. Gemini 3 supports these combinations. capabilities.json_mode_with_tools and web_search_with_tools are false for unsupported combinations; omission means unverified support.
  • In a function-tool loop, replay the original assistant tool_calls unchanged to the same model, followed by the tool result for its tool_call_id. Gemini tool_calls[].extra_content.google.thought_signature is opaque provider state; do not modify it, strip it, or reuse it with another model.
  • web_search is available only on Chat models with capabilities.web_search: true. Gemini tool_choice: "none" also disables search. Requiring a tool or naming a function when only a search tool is present returns 400.

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.

See the streaming guide for a complete example and completion/error handling.

Current model options

Loading…