Chat Completions
OpenAI-compatible chat completions endpoint (v3).
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The name of the LLM model to use.
The messages to send to the LLM model.
How to pick between the providers that serve the requested model. Applies only when model is a model name with no provider prefix (e.g. 'gpt-5.5'); ignored for a concrete 'provider/model' id, which already names its provider. This does not choose the model — for that see router_candidates with model='@edenai'.
List of fallback model IDs to try if the primary model fails. Models are tried in order. Example: ['anthropic/claude-3-opus', 'openai/gpt-4o']
3Identifies a conversation, so its requests keep reaching the provider that holds its prompt cache. Any stable string you choose — a thread id, a ticket number, an agent run. Also accepted as the x-session-id header, for clients that cannot add body fields; the body field wins if both are sent. Without one, a conversation is recognised from its opening messages instead.
256Models the '@edenai' router may choose BETWEEN — it picks the model, whereas routing picks the provider for a model you already named. Used only when model='@edenai'. Each entry should be 'provider/model', e.g. ['openai/gpt-4o', 'anthropic/claude-3-5-sonnet-20241022']. If not provided, defaults to all available models.
List of hooks to run before the LLM provider call. Each entry must have an 'action' key and optional 'params'. Example: [{'action': 'pdf_text_extract', 'params': {'method': 'default'}}]
List of hooks to run after the LLM provider call. Each entry must have an 'action' key and optional 'params'. Example: [{'action': 'json_heal', 'params': {'json_schema': {...}}}]
The number of completions to generate for each prompt. Defaults to 1.
x >= 1The reasoning effort level for the LLM model.
minimal, low, medium, high, max, xhigh, disable, none Object of metadata associated with the chat request. Can be used to provide additional context or tracking information.
Penalty for repeated tokens in the output.
-2 <= x <= 2Logit bias to influence token generation.
Whether to include log probabilities of tokens in the output. Defaults to False.
Number of top log probabilities to return with each token. An integer between 0 and 20.
0 <= x <= 20The maximum number of tokens to generate in the chat completion
x >= 1An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
x >= 1List of supported input/output modalities for the chat.
field for storing prediction-related information.
dictionary for audio-related parameters or metadata.
Penalty for new tokens based on their presence in the text so far.
-2 <= x <= 2Specify the desired response format for the completion.
Seed for random number generation.
'auto': Automatically select appropriate tier 'default': Use the default service tier 'flex': 50% cheaper processing with increased latency (OpenAI o3/o4-mini) 'scale' / 'priority': OpenAI scale and priority processing tiers
auto, default, flex, scale, priority Stop sequence(s) that end generation: a single string or a list of up to 4 strings.
Whether to stream the response in real-time. Defaults to False.
Options for streaming responses, such as chunk size or format.
Sampling temperature for controlling randomness in output.
0 <= x <= 2Nucleus sampling parameter for controlling diversity in output. Defaults to 1.0.
0 <= x <= 1List of tools that can be used by the model to assist in generating responses.
Specify how tools should be used. Can be 'auto', 'required', 'none', or an object to force a specific tool.
Whether to allow parallel tool calls in the completion.
User identifier for tracking or personalization purposes.
Controls function calling (legacy). The string 'none' or 'auto', or an object forcing a specific function, e.g. {'name': 'my_function'}.
none, auto List of functions that can be called by the model to assist in generating responses.
Parameters related to the model's reasoning or thinking process.
Options for web search integration. Example: json web_search_options={ "search_context_size": "medium" # Options: "low", "medium", "high" }
Hint the model to be more or less expansive in its replies. Values: "low", "medium", "high". low (gpt5 models)
low, medium, high Prompt-cache routing hint (OpenAI): requests sharing a key and a common prompt prefix are routed to the same cache shard, improving hit rates for high-volume shared prefixes. Forwarded to providers that support it, dropped elsewhere. Also read for provider stickiness when no session_id or x-session-id is given.
How long the provider retains the prompt cache — OpenAI currently accepts "in_memory" (provider default, typically 5-10 minutes) and "24h" (extended retention, supported on gpt-5.x and gpt-4.1). The known values are advertised in the schema but not enforced: the value is passed through verbatim for the provider to validate, so new provider values work without an Eden AI release. Dropped for providers that don't support it.
in_memory, 24h Request-level prompt-cache settings (mode and ttl) for OpenAI GPT-5.6 and newer models. Ignored by models that don't support prompt caching.
Additional parameters to pass in the request body to the provider API.
Image generation configuration for Google Gemini image models (e.g. google/gemini-2.5-flash-image).
Additional HTTP headers to pass to the provider API.
Response
Successful Response
Response body for POST /chat/completions (non-streaming).
Unique identifier for the chat completion.
Unix timestamp (seconds) when the completion was created.
Model that produced the completion.
List of completion choices generated for the request.
Object type. Always 'chat.completion' for this endpoint.
"chat.completion"Token usage statistics for the request.
Backend configuration fingerprint that produced the response.
Service tier that processed the request.