Skip to main content
POST
Create Response

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required

Model identifier, e.g. 'openai/gpt-4o'

routing
ProviderRoutingPreferences · object | null

How to pick between the providers that serve the requested model. Applies 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. With model='@edenai' the platform chooses the model too: quality_cost steers that choice, and the provider fields apply whenever the chosen model is a provider-less name.

fallbacks
string[] | null

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']

Maximum array length: 3
session_id
string | null

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; the body field wins if both are sent. Without one, a conversation is recognised from its opening messages instead.

Maximum string length: 256
router_candidates
string[] | null

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.

Maximum array length: 64
Maximum string length: 128
input

Text, image, or file inputs to the model. Optional when continuing a conversation via previous_response_id.

instructions
string | null

System/developer instructions prepended to input. Not carried over when using previous_response_id.

previous_response_id
string | null

ID of a prior response to continue a multi-turn conversation. The provider manages conversation state server-side.

stream
boolean | null
default:false

Whether to stream the response via server-sent events.

tools
Tools · object[] | null

List of tools the model may call (function, web_search, file_search, etc.).

tool_choice

Controls which tool is called. 'auto', 'required', 'none', or a specific tool object.

temperature
number | null
Required range: 0 <= x <= 2
top_p
number | null
Required range: 0 <= x <= 1
max_output_tokens
integer | null
Required range: x >= 1
reasoning
Reasoning · object | null

Reasoning configuration, e.g. {'effort': 'low'|'medium'|'high'}.

truncation
enum<string> | null

How to handle context that exceeds the model's context window.

Available options:
auto,
disabled
store
boolean | null
default:true

Whether the provider should store the response server-side for later retrieval.

metadata
Metadata · object | null

Up to 16 key-value pairs for tagging.

user
string | null

Stable end-user identifier for abuse detection.

prompt_cache_key
string | null

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.

prompt_cache_retention

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.

Available options:
in_memory,
24h
prompt_cache_options
PromptCacheOptions · object | null

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.

parallel_tool_calls
boolean | null
text
Text · object | null

Text output configuration, e.g. {'format': {'type': 'json_schema', ...}}.

include
string[] | null

Additional output data to include, e.g. 'file_search_call.results'.

background
boolean | null

Whether to run the model response in the background.

Response

Successful Response

id
string
required
created_at
integer
required
model
string
required
status
string
required
output
(ResponseOutputMessage · object | object)[]
required
cost
number | null
provider
string | null
object
string
default:response
Allowed value: "response"
instructions
string | null
previous_response_id
string | null
usage
ResponseUsage · object | null
error
Error · object | null
metadata
Metadata · object | null