Create Response
Create a model response.
Request
- Base URLhttps://api.edenai.run
- AuthHTTP bearer
Request body
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']
Identifies 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, and read from the headers coding agents already send (x-claude-code-session-id, x-session-affinity, session-id, session_id, and x-client-request-id from pi and Codex); the body field wins if both are sent. Without one, a conversation is recognised from its opening messages instead.
Models 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 is a bare model name (e.g. 'gpt-5.5' — the winner's provider is then picked like any provider-less request) or a 'provider/model' id (e.g. 'openai/gpt-5-nano' — the winner is served by that exact provider). Entries the router cannot rank are skipped and listed under edenai_metadata.routing.auto.dropped; entries naming a model already in the list collapse into its earliest spelling, which decides how the winner is returned. The request fails only when no entry is left. If not provided, the router chooses from a default pool of eligible catalog models. At most 64 entries of up to 128 characters each.
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': {...}}}]
Model identifier, e.g. 'openai/gpt-4o'
System/developer instructions prepended to input. Not carried over when using previous_response_id.
ID of a prior response to continue a multi-turn conversation. The provider manages conversation state server-side.
Whether to stream the response via server-sent events.
List of tools the model may call (function, web_search, file_search, etc.).
Reasoning configuration, e.g. {'effort': 'low'|'medium'|'high'}.
How to handle context that exceeds the model's context window.
Whether the provider should store the response server-side for later retrieval.
Up to 16 key-value pairs for tagging.
Stable end-user identifier for abuse detection.
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 session header is given.
Text output configuration, e.g. {'format': {'type': 'json_schema', ...}}.
Additional output data to include, e.g. 'file_search_call.results'.
Whether to run the model response in the background.
Processing tier, billed at that tier's rates (e.g. 'ultrafast' on openai/gpt-6.1-sol and openai/gpt-6-astra). A model that has no rates for the requested priority or ultrafast tier runs on the default tier; the response's service_tier reports the tier that ran.
Example request
{
"tags": {
"client": "acme",
"project": "invoices"
}
}Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.