curl --request POST \
--url https://api.deepinfra.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "meta-llama/Llama-2-70b-chat-hf",
"messages": [
{
"content": "<string>",
"tool_call_id": "<string>",
"cache_control": {},
"role": "tool"
}
],
"fail_fast": false,
"models": [
"<string>"
],
"stream": false,
"temperature": 1,
"top_p": 1,
"min_p": 0,
"top_k": 0,
"max_tokens": 5000000,
"stop": "<string>",
"stop_token_ids": [
123
],
"n": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
},
"cache_control": {},
"type": "function"
}
],
"response_format": {
"type": "text"
},
"repetition_penalty": 1,
"user": "<string>",
"seed": 4611686018427388000,
"logprobs": true,
"stream_options": {
"include_usage": true,
"continuous_usage_stats": false
},
"reasoning": {
"enabled": true
},
"prompt_cache_key": "<string>",
"prompt_cache_options": {},
"cache_salt": "<string>",
"chat_template_kwargs": {},
"media_io_kwargs": {
"video": {
"num_frames": 128,
"width": 974,
"height": 974
}
},
"continue_final_message": true,
"ignore_eos": true
}
'import requests
url = "https://api.deepinfra.com/v1/chat/completions"
payload = {
"model": "meta-llama/Llama-2-70b-chat-hf",
"messages": [
{
"content": "<string>",
"tool_call_id": "<string>",
"cache_control": {},
"role": "tool"
}
],
"fail_fast": False,
"models": ["<string>"],
"stream": False,
"temperature": 1,
"top_p": 1,
"min_p": 0,
"top_k": 0,
"max_tokens": 5000000,
"stop": "<string>",
"stop_token_ids": [123],
"n": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
},
"cache_control": {},
"type": "function"
}
],
"response_format": { "type": "text" },
"repetition_penalty": 1,
"user": "<string>",
"seed": 4611686018427388000,
"logprobs": True,
"stream_options": {
"include_usage": True,
"continuous_usage_stats": False
},
"reasoning": { "enabled": True },
"prompt_cache_key": "<string>",
"prompt_cache_options": {},
"cache_salt": "<string>",
"chat_template_kwargs": {},
"media_io_kwargs": { "video": {
"num_frames": 128,
"width": 974,
"height": 974
} },
"continue_final_message": True,
"ignore_eos": 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: 'meta-llama/Llama-2-70b-chat-hf',
messages: [
{content: '<string>', tool_call_id: '<string>', cache_control: {}, role: 'tool'}
],
fail_fast: false,
models: ['<string>'],
stream: false,
temperature: 1,
top_p: 1,
min_p: 0,
top_k: 0,
max_tokens: 5000000,
stop: '<string>',
stop_token_ids: [123],
n: 1,
presence_penalty: 0,
frequency_penalty: 0,
tools: [
{
function: {name: '<string>', description: '<string>', parameters: {}},
cache_control: {},
type: 'function'
}
],
response_format: {type: 'text'},
repetition_penalty: 1,
user: '<string>',
seed: 4611686018427388000,
logprobs: true,
stream_options: {include_usage: true, continuous_usage_stats: false},
reasoning: {enabled: true},
prompt_cache_key: '<string>',
prompt_cache_options: {},
cache_salt: '<string>',
chat_template_kwargs: {},
media_io_kwargs: {video: {num_frames: 128, width: 974, height: 974}},
continue_final_message: true,
ignore_eos: true
})
};
fetch('https://api.deepinfra.com/v1/chat/completions', 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.deepinfra.com/v1/chat/completions",
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' => 'meta-llama/Llama-2-70b-chat-hf',
'messages' => [
[
'content' => '<string>',
'tool_call_id' => '<string>',
'cache_control' => [
],
'role' => 'tool'
]
],
'fail_fast' => false,
'models' => [
'<string>'
],
'stream' => false,
'temperature' => 1,
'top_p' => 1,
'min_p' => 0,
'top_k' => 0,
'max_tokens' => 5000000,
'stop' => '<string>',
'stop_token_ids' => [
123
],
'n' => 1,
'presence_penalty' => 0,
'frequency_penalty' => 0,
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
]
],
'cache_control' => [
],
'type' => 'function'
]
],
'response_format' => [
'type' => 'text'
],
'repetition_penalty' => 1,
'user' => '<string>',
'seed' => 4611686018427388000,
'logprobs' => true,
'stream_options' => [
'include_usage' => true,
'continuous_usage_stats' => false
],
'reasoning' => [
'enabled' => true
],
'prompt_cache_key' => '<string>',
'prompt_cache_options' => [
],
'cache_salt' => '<string>',
'chat_template_kwargs' => [
],
'media_io_kwargs' => [
'video' => [
'num_frames' => 128,
'width' => 974,
'height' => 974
]
],
'continue_final_message' => true,
'ignore_eos' => 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.deepinfra.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"meta-llama/Llama-2-70b-chat-hf\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"cache_control\": {},\n \"role\": \"tool\"\n }\n ],\n \"fail_fast\": false,\n \"models\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"min_p\": 0,\n \"top_k\": 0,\n \"max_tokens\": 5000000,\n \"stop\": \"<string>\",\n \"stop_token_ids\": [\n 123\n ],\n \"n\": 1,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n },\n \"cache_control\": {},\n \"type\": \"function\"\n }\n ],\n \"response_format\": {\n \"type\": \"text\"\n },\n \"repetition_penalty\": 1,\n \"user\": \"<string>\",\n \"seed\": 4611686018427388000,\n \"logprobs\": true,\n \"stream_options\": {\n \"include_usage\": true,\n \"continuous_usage_stats\": false\n },\n \"reasoning\": {\n \"enabled\": true\n },\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {},\n \"cache_salt\": \"<string>\",\n \"chat_template_kwargs\": {},\n \"media_io_kwargs\": {\n \"video\": {\n \"num_frames\": 128,\n \"width\": 974,\n \"height\": 974\n }\n },\n \"continue_final_message\": true,\n \"ignore_eos\": 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.deepinfra.com/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"meta-llama/Llama-2-70b-chat-hf\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"cache_control\": {},\n \"role\": \"tool\"\n }\n ],\n \"fail_fast\": false,\n \"models\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"min_p\": 0,\n \"top_k\": 0,\n \"max_tokens\": 5000000,\n \"stop\": \"<string>\",\n \"stop_token_ids\": [\n 123\n ],\n \"n\": 1,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n },\n \"cache_control\": {},\n \"type\": \"function\"\n }\n ],\n \"response_format\": {\n \"type\": \"text\"\n },\n \"repetition_penalty\": 1,\n \"user\": \"<string>\",\n \"seed\": 4611686018427388000,\n \"logprobs\": true,\n \"stream_options\": {\n \"include_usage\": true,\n \"continuous_usage_stats\": false\n },\n \"reasoning\": {\n \"enabled\": true\n },\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {},\n \"cache_salt\": \"<string>\",\n \"chat_template_kwargs\": {},\n \"media_io_kwargs\": {\n \"video\": {\n \"num_frames\": 128,\n \"width\": 974,\n \"height\": 974\n }\n },\n \"continue_final_message\": true,\n \"ignore_eos\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepinfra.com/v1/chat/completions")
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\": \"meta-llama/Llama-2-70b-chat-hf\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"cache_control\": {},\n \"role\": \"tool\"\n }\n ],\n \"fail_fast\": false,\n \"models\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"min_p\": 0,\n \"top_k\": 0,\n \"max_tokens\": 5000000,\n \"stop\": \"<string>\",\n \"stop_token_ids\": [\n 123\n ],\n \"n\": 1,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n },\n \"cache_control\": {},\n \"type\": \"function\"\n }\n ],\n \"response_format\": {\n \"type\": \"text\"\n },\n \"repetition_penalty\": 1,\n \"user\": \"<string>\",\n \"seed\": 4611686018427388000,\n \"logprobs\": true,\n \"stream_options\": {\n \"include_usage\": true,\n \"continuous_usage_stats\": false\n },\n \"reasoning\": {\n \"enabled\": true\n },\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {},\n \"cache_salt\": \"<string>\",\n \"chat_template_kwargs\": {},\n \"media_io_kwargs\": {\n \"video\": {\n \"num_frames\": 128,\n \"width\": 974,\n \"height\": 974\n }\n },\n \"continue_final_message\": true,\n \"ignore_eos\": true\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Openai Chat Completions
curl --request POST \
--url https://api.deepinfra.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "meta-llama/Llama-2-70b-chat-hf",
"messages": [
{
"content": "<string>",
"tool_call_id": "<string>",
"cache_control": {},
"role": "tool"
}
],
"fail_fast": false,
"models": [
"<string>"
],
"stream": false,
"temperature": 1,
"top_p": 1,
"min_p": 0,
"top_k": 0,
"max_tokens": 5000000,
"stop": "<string>",
"stop_token_ids": [
123
],
"n": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
},
"cache_control": {},
"type": "function"
}
],
"response_format": {
"type": "text"
},
"repetition_penalty": 1,
"user": "<string>",
"seed": 4611686018427388000,
"logprobs": true,
"stream_options": {
"include_usage": true,
"continuous_usage_stats": false
},
"reasoning": {
"enabled": true
},
"prompt_cache_key": "<string>",
"prompt_cache_options": {},
"cache_salt": "<string>",
"chat_template_kwargs": {},
"media_io_kwargs": {
"video": {
"num_frames": 128,
"width": 974,
"height": 974
}
},
"continue_final_message": true,
"ignore_eos": true
}
'import requests
url = "https://api.deepinfra.com/v1/chat/completions"
payload = {
"model": "meta-llama/Llama-2-70b-chat-hf",
"messages": [
{
"content": "<string>",
"tool_call_id": "<string>",
"cache_control": {},
"role": "tool"
}
],
"fail_fast": False,
"models": ["<string>"],
"stream": False,
"temperature": 1,
"top_p": 1,
"min_p": 0,
"top_k": 0,
"max_tokens": 5000000,
"stop": "<string>",
"stop_token_ids": [123],
"n": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"tools": [
{
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
},
"cache_control": {},
"type": "function"
}
],
"response_format": { "type": "text" },
"repetition_penalty": 1,
"user": "<string>",
"seed": 4611686018427388000,
"logprobs": True,
"stream_options": {
"include_usage": True,
"continuous_usage_stats": False
},
"reasoning": { "enabled": True },
"prompt_cache_key": "<string>",
"prompt_cache_options": {},
"cache_salt": "<string>",
"chat_template_kwargs": {},
"media_io_kwargs": { "video": {
"num_frames": 128,
"width": 974,
"height": 974
} },
"continue_final_message": True,
"ignore_eos": 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: 'meta-llama/Llama-2-70b-chat-hf',
messages: [
{content: '<string>', tool_call_id: '<string>', cache_control: {}, role: 'tool'}
],
fail_fast: false,
models: ['<string>'],
stream: false,
temperature: 1,
top_p: 1,
min_p: 0,
top_k: 0,
max_tokens: 5000000,
stop: '<string>',
stop_token_ids: [123],
n: 1,
presence_penalty: 0,
frequency_penalty: 0,
tools: [
{
function: {name: '<string>', description: '<string>', parameters: {}},
cache_control: {},
type: 'function'
}
],
response_format: {type: 'text'},
repetition_penalty: 1,
user: '<string>',
seed: 4611686018427388000,
logprobs: true,
stream_options: {include_usage: true, continuous_usage_stats: false},
reasoning: {enabled: true},
prompt_cache_key: '<string>',
prompt_cache_options: {},
cache_salt: '<string>',
chat_template_kwargs: {},
media_io_kwargs: {video: {num_frames: 128, width: 974, height: 974}},
continue_final_message: true,
ignore_eos: true
})
};
fetch('https://api.deepinfra.com/v1/chat/completions', 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.deepinfra.com/v1/chat/completions",
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' => 'meta-llama/Llama-2-70b-chat-hf',
'messages' => [
[
'content' => '<string>',
'tool_call_id' => '<string>',
'cache_control' => [
],
'role' => 'tool'
]
],
'fail_fast' => false,
'models' => [
'<string>'
],
'stream' => false,
'temperature' => 1,
'top_p' => 1,
'min_p' => 0,
'top_k' => 0,
'max_tokens' => 5000000,
'stop' => '<string>',
'stop_token_ids' => [
123
],
'n' => 1,
'presence_penalty' => 0,
'frequency_penalty' => 0,
'tools' => [
[
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
]
],
'cache_control' => [
],
'type' => 'function'
]
],
'response_format' => [
'type' => 'text'
],
'repetition_penalty' => 1,
'user' => '<string>',
'seed' => 4611686018427388000,
'logprobs' => true,
'stream_options' => [
'include_usage' => true,
'continuous_usage_stats' => false
],
'reasoning' => [
'enabled' => true
],
'prompt_cache_key' => '<string>',
'prompt_cache_options' => [
],
'cache_salt' => '<string>',
'chat_template_kwargs' => [
],
'media_io_kwargs' => [
'video' => [
'num_frames' => 128,
'width' => 974,
'height' => 974
]
],
'continue_final_message' => true,
'ignore_eos' => 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.deepinfra.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"meta-llama/Llama-2-70b-chat-hf\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"cache_control\": {},\n \"role\": \"tool\"\n }\n ],\n \"fail_fast\": false,\n \"models\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"min_p\": 0,\n \"top_k\": 0,\n \"max_tokens\": 5000000,\n \"stop\": \"<string>\",\n \"stop_token_ids\": [\n 123\n ],\n \"n\": 1,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n },\n \"cache_control\": {},\n \"type\": \"function\"\n }\n ],\n \"response_format\": {\n \"type\": \"text\"\n },\n \"repetition_penalty\": 1,\n \"user\": \"<string>\",\n \"seed\": 4611686018427388000,\n \"logprobs\": true,\n \"stream_options\": {\n \"include_usage\": true,\n \"continuous_usage_stats\": false\n },\n \"reasoning\": {\n \"enabled\": true\n },\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {},\n \"cache_salt\": \"<string>\",\n \"chat_template_kwargs\": {},\n \"media_io_kwargs\": {\n \"video\": {\n \"num_frames\": 128,\n \"width\": 974,\n \"height\": 974\n }\n },\n \"continue_final_message\": true,\n \"ignore_eos\": 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.deepinfra.com/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"meta-llama/Llama-2-70b-chat-hf\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"cache_control\": {},\n \"role\": \"tool\"\n }\n ],\n \"fail_fast\": false,\n \"models\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"min_p\": 0,\n \"top_k\": 0,\n \"max_tokens\": 5000000,\n \"stop\": \"<string>\",\n \"stop_token_ids\": [\n 123\n ],\n \"n\": 1,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n },\n \"cache_control\": {},\n \"type\": \"function\"\n }\n ],\n \"response_format\": {\n \"type\": \"text\"\n },\n \"repetition_penalty\": 1,\n \"user\": \"<string>\",\n \"seed\": 4611686018427388000,\n \"logprobs\": true,\n \"stream_options\": {\n \"include_usage\": true,\n \"continuous_usage_stats\": false\n },\n \"reasoning\": {\n \"enabled\": true\n },\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {},\n \"cache_salt\": \"<string>\",\n \"chat_template_kwargs\": {},\n \"media_io_kwargs\": {\n \"video\": {\n \"num_frames\": 128,\n \"width\": 974,\n \"height\": 974\n }\n },\n \"continue_final_message\": true,\n \"ignore_eos\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepinfra.com/v1/chat/completions")
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\": \"meta-llama/Llama-2-70b-chat-hf\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"cache_control\": {},\n \"role\": \"tool\"\n }\n ],\n \"fail_fast\": false,\n \"models\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"temperature\": 1,\n \"top_p\": 1,\n \"min_p\": 0,\n \"top_k\": 0,\n \"max_tokens\": 5000000,\n \"stop\": \"<string>\",\n \"stop_token_ids\": [\n 123\n ],\n \"n\": 1,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0,\n \"tools\": [\n {\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {}\n },\n \"cache_control\": {},\n \"type\": \"function\"\n }\n ],\n \"response_format\": {\n \"type\": \"text\"\n },\n \"repetition_penalty\": 1,\n \"user\": \"<string>\",\n \"seed\": 4611686018427388000,\n \"logprobs\": true,\n \"stream_options\": {\n \"include_usage\": true,\n \"continuous_usage_stats\": false\n },\n \"reasoning\": {\n \"enabled\": true\n },\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {},\n \"cache_salt\": \"<string>\",\n \"chat_template_kwargs\": {},\n \"media_io_kwargs\": {\n \"video\": {\n \"num_frames\": 128,\n \"width\": 974,\n \"height\": 974\n }\n },\n \"continue_final_message\": true,\n \"ignore_eos\": true\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}inference scope (about scopes).Authorizations
Headers
Body
conversation messages: (user,assistant,tool)*,user including one system message anywhere
- ChatCompletionToolMessage
- ChatCompletionAssistantMessage
- ChatCompletionUserMessage
- ChatCompletionSystemMessage
Show child attributes
Show child attributes
The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'.
default, priority, flex Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence.
1 - 4 elementsThe maximum number of tokens to generate in the chat completion.
The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 65536, whichever is smaller.
0 < x <= 10000000Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present.
none, auto, required Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports.
none, minimal, low, medium, high, xhigh, max Per-request media decode options keyed by modality, e.g. {"video": {"num_frames": 16, "width": 448, "height": 252}}. num_frames is honoured by video-input models served on vLLM or Dynamo; width/height by every model that takes video natively.
Show child attributes
Show child attributes
Response
Successful Response