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'

input
required

Text, image, or file inputs to the model

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
router_candidates
string[] | null

List of model candidates for dynamic routing when using 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.

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.

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