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

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 should be 'provider/model', e.g. ['openai/gpt-4o', 'anthropic/claude-3-5-sonnet-20241022']. If not provided, defaults to all available models.

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