Skip to main content
POST
/
v3
/
llm
/
responses
Create Response
curl --request POST \
  --url https://api.edenai.run/v3/llm/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": "<string>",
  "instructions": "<string>",
  "previous_response_id": "<string>",
  "stream": false,
  "tools": [
    {}
  ],
  "tool_choice": "<string>",
  "temperature": 1,
  "top_p": 0.5,
  "max_output_tokens": 2,
  "reasoning": {},
  "truncation": "auto",
  "store": true,
  "metadata": {},
  "user": "<string>",
  "parallel_tool_calls": true,
  "text": {},
  "include": [
    "<string>"
  ],
  "background": true,
  "fallbacks": [
    "<string>"
  ],
  "router_candidates": [
    "<string>"
  ]
}
'
{
  "id": "<string>",
  "created_at": 123,
  "model": "<string>",
  "status": "<string>",
  "output": [
    {
      "id": "<string>",
      "type": "<string>",
      "role": "<string>",
      "status": "<string>",
      "content": [
        {
          "type": "<string>",
          "text": "<string>",
          "annotations": []
        }
      ]
    }
  ],
  "object": "response",
  "instructions": "<string>",
  "previous_response_id": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "total_tokens": 123,
    "input_tokens_details": {},
    "output_tokens_details": {}
  },
  "error": {},
  "metadata": {},
  "cost": 123,
  "provider": "<string>"
}

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

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

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

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

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.

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.

Response

Successful Response

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