curl --request POST \
--url https://api.concentrate.ai/v1/messages/ \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>"
}
],
"max_tokens": 4503599627370495,
"model": "<string>",
"provider": "<string>",
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
},
"metadata": {
"user_id": "<string>"
},
"output_config": {
"format": {
"type": "json_schema",
"schema": {}
}
},
"stream": true,
"system": "<string>",
"temperature": 0.5,
"thinking": {
"type": "enabled",
"budget_tokens": 1025
},
"tool_choice": {
"type": "auto",
"disable_parallel_tool_use": true
},
"tools": [
{
"name": "<string>",
"input_schema": {},
"type": "custom",
"description": "<string>",
"strict": true,
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
}
}
],
"top_p": 0.5,
"container": "<string>",
"inference_geo": "<string>",
"service_tier": "<string>",
"stop_sequences": [
"<string>"
],
"top_k": 4503599627370495,
"routing": {
"model": {
"fallbacks": [
"<string>"
],
"sort": "performance"
},
"provider": {
"fallbacks": [
"<string>"
],
"sort": "performance",
"interval": "<string>"
}
}
}
'import requests
url = "https://api.concentrate.ai/v1/messages/"
payload = {
"messages": [{ "content": "<string>" }],
"max_tokens": 4503599627370495,
"model": "<string>",
"provider": "<string>",
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
},
"metadata": { "user_id": "<string>" },
"output_config": { "format": {
"type": "json_schema",
"schema": {}
} },
"stream": True,
"system": "<string>",
"temperature": 0.5,
"thinking": {
"type": "enabled",
"budget_tokens": 1025
},
"tool_choice": {
"type": "auto",
"disable_parallel_tool_use": True
},
"tools": [
{
"name": "<string>",
"input_schema": {},
"type": "custom",
"description": "<string>",
"strict": True,
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
}
}
],
"top_p": 0.5,
"container": "<string>",
"inference_geo": "<string>",
"service_tier": "<string>",
"stop_sequences": ["<string>"],
"top_k": 4503599627370495,
"routing": {
"model": {
"fallbacks": ["<string>"],
"sort": "performance"
},
"provider": {
"fallbacks": ["<string>"],
"sort": "performance",
"interval": "<string>"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{content: '<string>'}],
max_tokens: 4503599627370495,
model: '<string>',
provider: '<string>',
cache_control: {type: 'ephemeral', ttl: '5m'},
metadata: {user_id: '<string>'},
output_config: {format: {type: 'json_schema', schema: {}}},
stream: true,
system: '<string>',
temperature: 0.5,
thinking: {type: 'enabled', budget_tokens: 1025},
tool_choice: {type: 'auto', disable_parallel_tool_use: true},
tools: [
{
name: '<string>',
input_schema: {},
type: 'custom',
description: '<string>',
strict: true,
cache_control: {type: 'ephemeral', ttl: '5m'}
}
],
top_p: 0.5,
container: '<string>',
inference_geo: '<string>',
service_tier: '<string>',
stop_sequences: ['<string>'],
top_k: 4503599627370495,
routing: {
model: {fallbacks: ['<string>'], sort: 'performance'},
provider: {fallbacks: ['<string>'], sort: 'performance', interval: '<string>'}
}
})
};
fetch('https://api.concentrate.ai/v1/messages/', 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.concentrate.ai/v1/messages/",
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([
'messages' => [
[
'content' => '<string>'
]
],
'max_tokens' => 4503599627370495,
'model' => '<string>',
'provider' => '<string>',
'cache_control' => [
'type' => 'ephemeral',
'ttl' => '5m'
],
'metadata' => [
'user_id' => '<string>'
],
'output_config' => [
'format' => [
'type' => 'json_schema',
'schema' => [
]
]
],
'stream' => true,
'system' => '<string>',
'temperature' => 0.5,
'thinking' => [
'type' => 'enabled',
'budget_tokens' => 1025
],
'tool_choice' => [
'type' => 'auto',
'disable_parallel_tool_use' => true
],
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'type' => 'custom',
'description' => '<string>',
'strict' => true,
'cache_control' => [
'type' => 'ephemeral',
'ttl' => '5m'
]
]
],
'top_p' => 0.5,
'container' => '<string>',
'inference_geo' => '<string>',
'service_tier' => '<string>',
'stop_sequences' => [
'<string>'
],
'top_k' => 4503599627370495,
'routing' => [
'model' => [
'fallbacks' => [
'<string>'
],
'sort' => 'performance'
],
'provider' => [
'fallbacks' => [
'<string>'
],
'sort' => 'performance',
'interval' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"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.concentrate.ai/v1/messages/"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 4503599627370495,\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"output_config\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"schema\": {}\n }\n },\n \"stream\": true,\n \"system\": \"<string>\",\n \"temperature\": 0.5,\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 1025\n },\n \"tool_choice\": {\n \"type\": \"auto\",\n \"disable_parallel_tool_use\": true\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"type\": \"custom\",\n \"description\": \"<string>\",\n \"strict\": true,\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n }\n }\n ],\n \"top_p\": 0.5,\n \"container\": \"<string>\",\n \"inference_geo\": \"<string>\",\n \"service_tier\": \"<string>\",\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"top_k\": 4503599627370495,\n \"routing\": {\n \"model\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\"\n },\n \"provider\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\",\n \"interval\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.concentrate.ai/v1/messages/")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 4503599627370495,\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"output_config\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"schema\": {}\n }\n },\n \"stream\": true,\n \"system\": \"<string>\",\n \"temperature\": 0.5,\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 1025\n },\n \"tool_choice\": {\n \"type\": \"auto\",\n \"disable_parallel_tool_use\": true\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"type\": \"custom\",\n \"description\": \"<string>\",\n \"strict\": true,\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n }\n }\n ],\n \"top_p\": 0.5,\n \"container\": \"<string>\",\n \"inference_geo\": \"<string>\",\n \"service_tier\": \"<string>\",\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"top_k\": 4503599627370495,\n \"routing\": {\n \"model\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\"\n },\n \"provider\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\",\n \"interval\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.concentrate.ai/v1/messages/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 4503599627370495,\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"output_config\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"schema\": {}\n }\n },\n \"stream\": true,\n \"system\": \"<string>\",\n \"temperature\": 0.5,\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 1025\n },\n \"tool_choice\": {\n \"type\": \"auto\",\n \"disable_parallel_tool_use\": true\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"type\": \"custom\",\n \"description\": \"<string>\",\n \"strict\": true,\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n }\n }\n ],\n \"top_p\": 0.5,\n \"container\": \"<string>\",\n \"inference_geo\": \"<string>\",\n \"service_tier\": \"<string>\",\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"top_k\": 4503599627370495,\n \"routing\": {\n \"model\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\"\n },\n \"provider\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\",\n \"interval\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "message",
"role": "assistant",
"model": "<string>",
"content": [
{
"type": "text",
"text": "<string>",
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
},
"citations": [
{
"type": "web_search_result_location",
"title": "<string>",
"url": "<string>",
"cited_text": "<string>",
"encrypted_index": "<string>"
}
]
}
],
"usage": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"inference_geo": "<string>",
"input_tokens": 0,
"output_tokens": 0,
"server_tool_use": {
"web_fetch_requests": 0,
"web_search_requests": 0
},
"cache_creation": {
"ephemeral_5m_input_tokens": 1,
"ephemeral_1h_input_tokens": 1
}
},
"cost": {
"total": 123,
"byok": true,
"breakdown": {}
},
"stop_sequence": "<string>",
"redact": {
"entities_found": 123,
"entity_types": [
"<string>"
],
"models_used": [
"<string>"
],
"execution_time_ms": 123,
"redaction_coverage": 123,
"redacted_input": [
{
"content": "<string>",
"type": "message"
}
],
"redacted_tools": [
{
"type": "function",
"name": "<unknown>",
"parameters": {},
"description": "<string>",
"strict": true,
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
}
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"upstream_error": "<string>"
}
}Create Message
Anthropic Messages API compatibility endpoint for Claude Code and other clients
curl --request POST \
--url https://api.concentrate.ai/v1/messages/ \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>"
}
],
"max_tokens": 4503599627370495,
"model": "<string>",
"provider": "<string>",
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
},
"metadata": {
"user_id": "<string>"
},
"output_config": {
"format": {
"type": "json_schema",
"schema": {}
}
},
"stream": true,
"system": "<string>",
"temperature": 0.5,
"thinking": {
"type": "enabled",
"budget_tokens": 1025
},
"tool_choice": {
"type": "auto",
"disable_parallel_tool_use": true
},
"tools": [
{
"name": "<string>",
"input_schema": {},
"type": "custom",
"description": "<string>",
"strict": true,
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
}
}
],
"top_p": 0.5,
"container": "<string>",
"inference_geo": "<string>",
"service_tier": "<string>",
"stop_sequences": [
"<string>"
],
"top_k": 4503599627370495,
"routing": {
"model": {
"fallbacks": [
"<string>"
],
"sort": "performance"
},
"provider": {
"fallbacks": [
"<string>"
],
"sort": "performance",
"interval": "<string>"
}
}
}
'import requests
url = "https://api.concentrate.ai/v1/messages/"
payload = {
"messages": [{ "content": "<string>" }],
"max_tokens": 4503599627370495,
"model": "<string>",
"provider": "<string>",
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
},
"metadata": { "user_id": "<string>" },
"output_config": { "format": {
"type": "json_schema",
"schema": {}
} },
"stream": True,
"system": "<string>",
"temperature": 0.5,
"thinking": {
"type": "enabled",
"budget_tokens": 1025
},
"tool_choice": {
"type": "auto",
"disable_parallel_tool_use": True
},
"tools": [
{
"name": "<string>",
"input_schema": {},
"type": "custom",
"description": "<string>",
"strict": True,
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
}
}
],
"top_p": 0.5,
"container": "<string>",
"inference_geo": "<string>",
"service_tier": "<string>",
"stop_sequences": ["<string>"],
"top_k": 4503599627370495,
"routing": {
"model": {
"fallbacks": ["<string>"],
"sort": "performance"
},
"provider": {
"fallbacks": ["<string>"],
"sort": "performance",
"interval": "<string>"
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{content: '<string>'}],
max_tokens: 4503599627370495,
model: '<string>',
provider: '<string>',
cache_control: {type: 'ephemeral', ttl: '5m'},
metadata: {user_id: '<string>'},
output_config: {format: {type: 'json_schema', schema: {}}},
stream: true,
system: '<string>',
temperature: 0.5,
thinking: {type: 'enabled', budget_tokens: 1025},
tool_choice: {type: 'auto', disable_parallel_tool_use: true},
tools: [
{
name: '<string>',
input_schema: {},
type: 'custom',
description: '<string>',
strict: true,
cache_control: {type: 'ephemeral', ttl: '5m'}
}
],
top_p: 0.5,
container: '<string>',
inference_geo: '<string>',
service_tier: '<string>',
stop_sequences: ['<string>'],
top_k: 4503599627370495,
routing: {
model: {fallbacks: ['<string>'], sort: 'performance'},
provider: {fallbacks: ['<string>'], sort: 'performance', interval: '<string>'}
}
})
};
fetch('https://api.concentrate.ai/v1/messages/', 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.concentrate.ai/v1/messages/",
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([
'messages' => [
[
'content' => '<string>'
]
],
'max_tokens' => 4503599627370495,
'model' => '<string>',
'provider' => '<string>',
'cache_control' => [
'type' => 'ephemeral',
'ttl' => '5m'
],
'metadata' => [
'user_id' => '<string>'
],
'output_config' => [
'format' => [
'type' => 'json_schema',
'schema' => [
]
]
],
'stream' => true,
'system' => '<string>',
'temperature' => 0.5,
'thinking' => [
'type' => 'enabled',
'budget_tokens' => 1025
],
'tool_choice' => [
'type' => 'auto',
'disable_parallel_tool_use' => true
],
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'type' => 'custom',
'description' => '<string>',
'strict' => true,
'cache_control' => [
'type' => 'ephemeral',
'ttl' => '5m'
]
]
],
'top_p' => 0.5,
'container' => '<string>',
'inference_geo' => '<string>',
'service_tier' => '<string>',
'stop_sequences' => [
'<string>'
],
'top_k' => 4503599627370495,
'routing' => [
'model' => [
'fallbacks' => [
'<string>'
],
'sort' => 'performance'
],
'provider' => [
'fallbacks' => [
'<string>'
],
'sort' => 'performance',
'interval' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"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.concentrate.ai/v1/messages/"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 4503599627370495,\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"output_config\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"schema\": {}\n }\n },\n \"stream\": true,\n \"system\": \"<string>\",\n \"temperature\": 0.5,\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 1025\n },\n \"tool_choice\": {\n \"type\": \"auto\",\n \"disable_parallel_tool_use\": true\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"type\": \"custom\",\n \"description\": \"<string>\",\n \"strict\": true,\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n }\n }\n ],\n \"top_p\": 0.5,\n \"container\": \"<string>\",\n \"inference_geo\": \"<string>\",\n \"service_tier\": \"<string>\",\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"top_k\": 4503599627370495,\n \"routing\": {\n \"model\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\"\n },\n \"provider\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\",\n \"interval\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.concentrate.ai/v1/messages/")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 4503599627370495,\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"output_config\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"schema\": {}\n }\n },\n \"stream\": true,\n \"system\": \"<string>\",\n \"temperature\": 0.5,\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 1025\n },\n \"tool_choice\": {\n \"type\": \"auto\",\n \"disable_parallel_tool_use\": true\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"type\": \"custom\",\n \"description\": \"<string>\",\n \"strict\": true,\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n }\n }\n ],\n \"top_p\": 0.5,\n \"container\": \"<string>\",\n \"inference_geo\": \"<string>\",\n \"service_tier\": \"<string>\",\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"top_k\": 4503599627370495,\n \"routing\": {\n \"model\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\"\n },\n \"provider\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\",\n \"interval\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.concentrate.ai/v1/messages/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"max_tokens\": 4503599627370495,\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"output_config\": {\n \"format\": {\n \"type\": \"json_schema\",\n \"schema\": {}\n }\n },\n \"stream\": true,\n \"system\": \"<string>\",\n \"temperature\": 0.5,\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 1025\n },\n \"tool_choice\": {\n \"type\": \"auto\",\n \"disable_parallel_tool_use\": true\n },\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"type\": \"custom\",\n \"description\": \"<string>\",\n \"strict\": true,\n \"cache_control\": {\n \"type\": \"ephemeral\",\n \"ttl\": \"5m\"\n }\n }\n ],\n \"top_p\": 0.5,\n \"container\": \"<string>\",\n \"inference_geo\": \"<string>\",\n \"service_tier\": \"<string>\",\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"top_k\": 4503599627370495,\n \"routing\": {\n \"model\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\"\n },\n \"provider\": {\n \"fallbacks\": [\n \"<string>\"\n ],\n \"sort\": \"performance\",\n \"interval\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "message",
"role": "assistant",
"model": "<string>",
"content": [
{
"type": "text",
"text": "<string>",
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
},
"citations": [
{
"type": "web_search_result_location",
"title": "<string>",
"url": "<string>",
"cited_text": "<string>",
"encrypted_index": "<string>"
}
]
}
],
"usage": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"inference_geo": "<string>",
"input_tokens": 0,
"output_tokens": 0,
"server_tool_use": {
"web_fetch_requests": 0,
"web_search_requests": 0
},
"cache_creation": {
"ephemeral_5m_input_tokens": 1,
"ephemeral_1h_input_tokens": 1
}
},
"cost": {
"total": 123,
"byok": true,
"breakdown": {}
},
"stop_sequence": "<string>",
"redact": {
"entities_found": 123,
"entity_types": [
"<string>"
],
"models_used": [
"<string>"
],
"execution_time_ms": 123,
"redaction_coverage": 123,
"redacted_input": [
{
"content": "<string>",
"type": "message"
}
],
"redacted_tools": [
{
"type": "function",
"name": "<unknown>",
"parameters": {},
"description": "<string>",
"strict": true,
"cache_control": {
"type": "ephemeral",
"ttl": "5m"
}
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"upstream_error": "<string>"
}
}Overview
The Messages API provides compatibility with the Anthropic Messages API format. It’s designed primarily for clients that expect Anthropic’s API structure, such as Claude Code and other tools built for Claude’s API.Body
1Show child attributes
Show child attributes
0 < x <= 9007199254740991Model identifier. Use /v1/models to list all available models. Supports canonical names (e.g. gpt-5.2, claude-opus-4-6), aliases, and provider-prefixed formats (e.g. openai/gpt-5.2). Use "auto" for automatic model selection.
One of 4616 allowed values.
Cache control settings for explicit prompt caching of this content.
Show child attributes
Show child attributes
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
0 <= x <= 1- Enabled
- Disabled
- Adaptive
Show child attributes
Show child attributes
- Auto
- Any
- Tool
- None
Show child attributes
Show child attributes
- Custom Tool
- Web Search Tool
Show child attributes
Show child attributes
0 <= x <= 10 < x <= 9007199254740991Concentrate routing configuration controlling how requests are routed across models and providers. Learn more about routing.
Show child attributes
Show child attributes
Response
Default Response
message assistant - Text
- Image
- Document
- Thinking
- Redacted Thinking
- Tool Use
- Tool Result
- Server Tool Use
- Web Search Tool Result
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
end_turn, max_tokens, stop_sequence, tool_use, pause_turn, refusal Show child attributes
Show child attributes
Was this page helpful?