curl --request POST \
--url https://api.edenai.run/v3/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"fallbacks": [
"<string>"
],
"router_candidates": [
"<string>"
],
"instructions": "<string>",
"previous_response_id": "<string>",
"stream": false,
"tools": [
{}
],
"tool_choice": "<string>",
"temperature": 1,
"top_p": 0.5,
"max_output_tokens": 2,
"reasoning": {},
"store": true,
"metadata": {},
"user": "<string>",
"parallel_tool_calls": true,
"text": {},
"include": [
"<string>"
],
"background": true
}
'import requests
url = "https://api.edenai.run/v3/responses"
payload = {
"model": "<string>",
"input": "<string>",
"fallbacks": ["<string>"],
"router_candidates": ["<string>"],
"instructions": "<string>",
"previous_response_id": "<string>",
"stream": False,
"tools": [{}],
"tool_choice": "<string>",
"temperature": 1,
"top_p": 0.5,
"max_output_tokens": 2,
"reasoning": {},
"store": True,
"metadata": {},
"user": "<string>",
"parallel_tool_calls": True,
"text": {},
"include": ["<string>"],
"background": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: '<string>',
fallbacks: ['<string>'],
router_candidates: ['<string>'],
instructions: '<string>',
previous_response_id: '<string>',
stream: false,
tools: [{}],
tool_choice: '<string>',
temperature: 1,
top_p: 0.5,
max_output_tokens: 2,
reasoning: {},
store: true,
metadata: {},
user: '<string>',
parallel_tool_calls: true,
text: {},
include: ['<string>'],
background: true
})
};
fetch('https://api.edenai.run/v3/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.edenai.run/v3/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'input' => '<string>',
'fallbacks' => [
'<string>'
],
'router_candidates' => [
'<string>'
],
'instructions' => '<string>',
'previous_response_id' => '<string>',
'stream' => false,
'tools' => [
[
]
],
'tool_choice' => '<string>',
'temperature' => 1,
'top_p' => 0.5,
'max_output_tokens' => 2,
'reasoning' => [
],
'store' => true,
'metadata' => [
],
'user' => '<string>',
'parallel_tool_calls' => true,
'text' => [
],
'include' => [
'<string>'
],
'background' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.edenai.run/v3/responses"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"fallbacks\": [\n \"<string>\"\n ],\n \"router_candidates\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": false,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"max_output_tokens\": 2,\n \"reasoning\": {},\n \"store\": true,\n \"metadata\": {},\n \"user\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"text\": {},\n \"include\": [\n \"<string>\"\n ],\n \"background\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.edenai.run/v3/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"fallbacks\": [\n \"<string>\"\n ],\n \"router_candidates\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": false,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"max_output_tokens\": 2,\n \"reasoning\": {},\n \"store\": true,\n \"metadata\": {},\n \"user\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"text\": {},\n \"include\": [\n \"<string>\"\n ],\n \"background\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"fallbacks\": [\n \"<string>\"\n ],\n \"router_candidates\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": false,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"max_output_tokens\": 2,\n \"reasoning\": {},\n \"store\": true,\n \"metadata\": {},\n \"user\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"text\": {},\n \"include\": [\n \"<string>\"\n ],\n \"background\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": 123,
"model": "<string>",
"status": "<string>",
"output": [
{
"id": "<string>",
"type": "message",
"role": "assistant",
"status": "<string>",
"content": [
{
"type": "output_text",
"text": "<string>",
"annotations": []
}
]
}
],
"cost": 123,
"provider": "<string>",
"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": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Response
Create a model response.
curl --request POST \
--url https://api.edenai.run/v3/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"fallbacks": [
"<string>"
],
"router_candidates": [
"<string>"
],
"instructions": "<string>",
"previous_response_id": "<string>",
"stream": false,
"tools": [
{}
],
"tool_choice": "<string>",
"temperature": 1,
"top_p": 0.5,
"max_output_tokens": 2,
"reasoning": {},
"store": true,
"metadata": {},
"user": "<string>",
"parallel_tool_calls": true,
"text": {},
"include": [
"<string>"
],
"background": true
}
'import requests
url = "https://api.edenai.run/v3/responses"
payload = {
"model": "<string>",
"input": "<string>",
"fallbacks": ["<string>"],
"router_candidates": ["<string>"],
"instructions": "<string>",
"previous_response_id": "<string>",
"stream": False,
"tools": [{}],
"tool_choice": "<string>",
"temperature": 1,
"top_p": 0.5,
"max_output_tokens": 2,
"reasoning": {},
"store": True,
"metadata": {},
"user": "<string>",
"parallel_tool_calls": True,
"text": {},
"include": ["<string>"],
"background": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
input: '<string>',
fallbacks: ['<string>'],
router_candidates: ['<string>'],
instructions: '<string>',
previous_response_id: '<string>',
stream: false,
tools: [{}],
tool_choice: '<string>',
temperature: 1,
top_p: 0.5,
max_output_tokens: 2,
reasoning: {},
store: true,
metadata: {},
user: '<string>',
parallel_tool_calls: true,
text: {},
include: ['<string>'],
background: true
})
};
fetch('https://api.edenai.run/v3/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.edenai.run/v3/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'input' => '<string>',
'fallbacks' => [
'<string>'
],
'router_candidates' => [
'<string>'
],
'instructions' => '<string>',
'previous_response_id' => '<string>',
'stream' => false,
'tools' => [
[
]
],
'tool_choice' => '<string>',
'temperature' => 1,
'top_p' => 0.5,
'max_output_tokens' => 2,
'reasoning' => [
],
'store' => true,
'metadata' => [
],
'user' => '<string>',
'parallel_tool_calls' => true,
'text' => [
],
'include' => [
'<string>'
],
'background' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.edenai.run/v3/responses"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"fallbacks\": [\n \"<string>\"\n ],\n \"router_candidates\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": false,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"max_output_tokens\": 2,\n \"reasoning\": {},\n \"store\": true,\n \"metadata\": {},\n \"user\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"text\": {},\n \"include\": [\n \"<string>\"\n ],\n \"background\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.edenai.run/v3/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"fallbacks\": [\n \"<string>\"\n ],\n \"router_candidates\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": false,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"max_output_tokens\": 2,\n \"reasoning\": {},\n \"store\": true,\n \"metadata\": {},\n \"user\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"text\": {},\n \"include\": [\n \"<string>\"\n ],\n \"background\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"fallbacks\": [\n \"<string>\"\n ],\n \"router_candidates\": [\n \"<string>\"\n ],\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"stream\": false,\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<string>\",\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"max_output_tokens\": 2,\n \"reasoning\": {},\n \"store\": true,\n \"metadata\": {},\n \"user\": \"<string>\",\n \"parallel_tool_calls\": true,\n \"text\": {},\n \"include\": [\n \"<string>\"\n ],\n \"background\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": 123,
"model": "<string>",
"status": "<string>",
"output": [
{
"id": "<string>",
"type": "message",
"role": "assistant",
"status": "<string>",
"content": [
{
"type": "output_text",
"text": "<string>",
"annotations": []
}
]
}
],
"cost": 123,
"provider": "<string>",
"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": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Model identifier, e.g. 'openai/gpt-4o'
Text, image, or file inputs to the model
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']
3List 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.
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.).
Controls which tool is called. 'auto', 'required', 'none', or a specific tool object.
0 <= x <= 20 <= x <= 1x >= 1Reasoning configuration, e.g. {'effort': 'low'|'medium'|'high'}.
How to handle context that exceeds the model's context window.
auto, disabled 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.
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.
Response
Successful Response
- ResponseOutputMessage
- Option 2
Show child attributes
Show child attributes
"response"Show child attributes
Show child attributes
Was this page helpful?