curl https://www.anyfast.ai/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 4096,
"output_config": { "effort": "high" },
"messages": [
{ "role": "user", "content": "Identify the highest-risk assumptions in this migration plan." }
]
}'import requests
url = "https://www.anyfast.ai/v1/messages"
payload = {
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "Identify the highest-risk assumptions in this migration plan."
}
],
"max_tokens": 4096,
"system": "<string>",
"metadata": { "user_id": "<string>" },
"stop_sequences": ["<string>"],
"stream": False,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"output_config": { "effort": "high" },
"thinking": { "type": "adaptive" }
}
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: 'claude-sonnet-5-5',
messages: [
{
role: 'user',
content: 'Identify the highest-risk assumptions in this migration plan.'
}
],
max_tokens: 4096,
system: '<string>',
metadata: {user_id: '<string>'},
stop_sequences: ['<string>'],
stream: false,
tools: [{name: '<string>', input_schema: {}, description: '<string>'}],
output_config: {effort: 'high'},
thinking: {type: 'adaptive'}
})
};
fetch('https://www.anyfast.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://www.anyfast.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([
'model' => 'claude-sonnet-5-5',
'messages' => [
[
'role' => 'user',
'content' => 'Identify the highest-risk assumptions in this migration plan.'
]
],
'max_tokens' => 4096,
'system' => '<string>',
'metadata' => [
'user_id' => '<string>'
],
'stop_sequences' => [
'<string>'
],
'stream' => false,
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'description' => '<string>'
]
],
'output_config' => [
'effort' => 'high'
],
'thinking' => [
'type' => 'adaptive'
]
]),
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://www.anyfast.ai/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-sonnet-5-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Identify the highest-risk assumptions in this migration plan.\"\n }\n ],\n \"max_tokens\": 4096,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {\n \"type\": \"adaptive\"\n }\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://www.anyfast.ai/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-sonnet-5-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Identify the highest-risk assumptions in this migration plan.\"\n }\n ],\n \"max_tokens\": 4096,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {\n \"type\": \"adaptive\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/messages")
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\": \"claude-sonnet-5-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Identify the highest-risk assumptions in this migration plan.\"\n }\n ],\n \"max_tokens\": 4096,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {\n \"type\": \"adaptive\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "The highest-risk assumption is that every client can tolerate the planned cutover window."
}
],
"model": "claude-sonnet-5.5",
"stop_reason": "end_turn",
"usage": {
"service_tier": "standard",
"input_tokens": 123,
"output_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"output_tokens_details": {
"thinking_tokens": 123
}
},
"container": {},
"stop_sequence": "<string>",
"stop_details": {},
"request_id": "<string>",
"billing": {
"status": "<string>",
"billed_cost_usd": "<string>",
"currency": "<string>",
"zero_data_retention": true,
"effective_discount_percent": 123
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid request parameters"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid request parameters"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid request parameters"
}
}claude-sonnet-5-5
Create Claude Sonnet 5.5 Messages through AnyFast.
curl https://www.anyfast.ai/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 4096,
"output_config": { "effort": "high" },
"messages": [
{ "role": "user", "content": "Identify the highest-risk assumptions in this migration plan." }
]
}'import requests
url = "https://www.anyfast.ai/v1/messages"
payload = {
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "Identify the highest-risk assumptions in this migration plan."
}
],
"max_tokens": 4096,
"system": "<string>",
"metadata": { "user_id": "<string>" },
"stop_sequences": ["<string>"],
"stream": False,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"output_config": { "effort": "high" },
"thinking": { "type": "adaptive" }
}
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: 'claude-sonnet-5-5',
messages: [
{
role: 'user',
content: 'Identify the highest-risk assumptions in this migration plan.'
}
],
max_tokens: 4096,
system: '<string>',
metadata: {user_id: '<string>'},
stop_sequences: ['<string>'],
stream: false,
tools: [{name: '<string>', input_schema: {}, description: '<string>'}],
output_config: {effort: 'high'},
thinking: {type: 'adaptive'}
})
};
fetch('https://www.anyfast.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://www.anyfast.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([
'model' => 'claude-sonnet-5-5',
'messages' => [
[
'role' => 'user',
'content' => 'Identify the highest-risk assumptions in this migration plan.'
]
],
'max_tokens' => 4096,
'system' => '<string>',
'metadata' => [
'user_id' => '<string>'
],
'stop_sequences' => [
'<string>'
],
'stream' => false,
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'description' => '<string>'
]
],
'output_config' => [
'effort' => 'high'
],
'thinking' => [
'type' => 'adaptive'
]
]),
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://www.anyfast.ai/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-sonnet-5-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Identify the highest-risk assumptions in this migration plan.\"\n }\n ],\n \"max_tokens\": 4096,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {\n \"type\": \"adaptive\"\n }\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://www.anyfast.ai/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-sonnet-5-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Identify the highest-risk assumptions in this migration plan.\"\n }\n ],\n \"max_tokens\": 4096,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {\n \"type\": \"adaptive\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/messages")
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\": \"claude-sonnet-5-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Identify the highest-risk assumptions in this migration plan.\"\n }\n ],\n \"max_tokens\": 4096,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {\n \"type\": \"adaptive\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "The highest-risk assumption is that every client can tolerate the planned cutover window."
}
],
"model": "claude-sonnet-5.5",
"stop_reason": "end_turn",
"usage": {
"service_tier": "standard",
"input_tokens": 123,
"output_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"cache_creation": {
"ephemeral_1h_input_tokens": 123,
"ephemeral_5m_input_tokens": 123
},
"output_tokens_details": {
"thinking_tokens": 123
}
},
"container": {},
"stop_sequence": "<string>",
"stop_details": {},
"request_id": "<string>",
"billing": {
"status": "<string>",
"billed_cost_usd": "<string>",
"currency": "<string>",
"zero_data_retention": true,
"effective_discount_percent": 123
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid request parameters"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid request parameters"
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Invalid request parameters"
}
}model: "claude-sonnet-5.5" for a claude-sonnet-5-5 request and added request_id plus billing. Forced tool choice returned 400.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Model ID.
claude-sonnet-5-5 "claude-sonnet-5-5"
Conversation turns. Pass assistant content blocks, including thinking blocks, back unchanged in multi-turn conversations. Do not prefill the final assistant response.
1Show child attributes
Show child attributes
[
{
"role": "user",
"content": "Identify the highest-risk assumptions in this migration plan."
}
]
Maximum output tokens across thinking and visible response text.
1 <= x <= 1280004096
System prompt. Keep it unchanged when replaying Sonnet 5.5 thinking blocks.
Request metadata.
Show child attributes
Show child attributes
Custom text sequences that stop generation.
Stream message events over SSE.
Tool definitions available to the model. Keep this array unchanged when replaying Sonnet 5.5 thinking blocks.
Show child attributes
Show child attributes
Controls whether the model may use tools.
Show child attributes
Show child attributes
Output controls. Claude Sonnet 5.5 defaults to high effort.
Show child attributes
Show child attributes
Omit this field for adaptive thinking. between_tools works at low, medium, or high effort. Manual enabled with budget_tokens and disabled return 400.
Show child attributes
Show child attributes
Response
Message created successfully. A safeguard refusal is also returned with HTTP 200 and stop_reason set to refusal.
"msg_01XFDUDYJgAACzvnptvVoYEL"
message assistant Show child attributes
Show child attributes
[
{
"type": "text",
"text": "The highest-risk assumption is that every client can tolerate the planned cutover window."
}
]
The observed AnyFast response uses a dot-form ID; requests still use the hyphen-form public model ID.
"claude-sonnet-5.5"
end_turn, max_tokens, stop_sequence, tool_use, refusal, null Show child attributes
Show child attributes
Null in the observed AnyFast text response.
Additional details for a refusal or other stop condition.
Request ID added by AnyFast in the response body.
AnyFast billing metadata; the billed USD amount is a string.
Show child attributes
Show child attributes
Was this page helpful?