curl --request POST \
--url https://www.anyfast.ai/v1/messages \
--header 'Content-Type: application/json' \
--data '
{
"model": "claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"system": "<string>",
"metadata": {
"user_id": "<string>"
},
"stop_sequences": [
"<string>"
],
"temperature": 1,
"top_p": 1,
"top_k": 1,
"stream": false,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"tool_choice": {
"name": "<string>"
},
"output_config": {
"effort": "high"
},
"thinking": {}
}
'import requests
url = "https://www.anyfast.ai/v1/messages"
payload = {
"model": "claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"system": "<string>",
"metadata": { "user_id": "<string>" },
"stop_sequences": ["<string>"],
"temperature": 1,
"top_p": 1,
"top_k": 1,
"stream": False,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"tool_choice": { "name": "<string>" },
"output_config": { "effort": "high" },
"thinking": {}
}
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({
model: 'claude-sonnet-5',
messages: [{role: 'user', content: 'Hello, Claude!'}],
max_tokens: 1024,
system: '<string>',
metadata: {user_id: '<string>'},
stop_sequences: ['<string>'],
temperature: 1,
top_p: 1,
top_k: 1,
stream: false,
tools: [{name: '<string>', input_schema: {}, description: '<string>'}],
tool_choice: {name: '<string>'},
output_config: {effort: 'high'},
thinking: {}
})
};
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',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, Claude!'
]
],
'max_tokens' => 1024,
'system' => '<string>',
'metadata' => [
'user_id' => '<string>'
],
'stop_sequences' => [
'<string>'
],
'temperature' => 1,
'top_p' => 1,
'top_k' => 1,
'stream' => false,
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'description' => '<string>'
]
],
'tool_choice' => [
'name' => '<string>'
],
'output_config' => [
'effort' => 'high'
],
'thinking' => [
]
]),
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://www.anyfast.ai/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-sonnet-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {}\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://www.anyfast.ai/v1/messages")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-sonnet-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {}\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["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"claude-sonnet-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"model": "claude-sonnet-5",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123
},
"stop_sequence": "<string>"
}claude-sonnet-5
Send a structured list of input messages with text and/or image content, and Claude Sonnet 5 will generate the next message in the conversation.
curl --request POST \
--url https://www.anyfast.ai/v1/messages \
--header 'Content-Type: application/json' \
--data '
{
"model": "claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"system": "<string>",
"metadata": {
"user_id": "<string>"
},
"stop_sequences": [
"<string>"
],
"temperature": 1,
"top_p": 1,
"top_k": 1,
"stream": false,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"tool_choice": {
"name": "<string>"
},
"output_config": {
"effort": "high"
},
"thinking": {}
}
'import requests
url = "https://www.anyfast.ai/v1/messages"
payload = {
"model": "claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"system": "<string>",
"metadata": { "user_id": "<string>" },
"stop_sequences": ["<string>"],
"temperature": 1,
"top_p": 1,
"top_k": 1,
"stream": False,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"tool_choice": { "name": "<string>" },
"output_config": { "effort": "high" },
"thinking": {}
}
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({
model: 'claude-sonnet-5',
messages: [{role: 'user', content: 'Hello, Claude!'}],
max_tokens: 1024,
system: '<string>',
metadata: {user_id: '<string>'},
stop_sequences: ['<string>'],
temperature: 1,
top_p: 1,
top_k: 1,
stream: false,
tools: [{name: '<string>', input_schema: {}, description: '<string>'}],
tool_choice: {name: '<string>'},
output_config: {effort: 'high'},
thinking: {}
})
};
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',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, Claude!'
]
],
'max_tokens' => 1024,
'system' => '<string>',
'metadata' => [
'user_id' => '<string>'
],
'stop_sequences' => [
'<string>'
],
'temperature' => 1,
'top_p' => 1,
'top_k' => 1,
'stream' => false,
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'description' => '<string>'
]
],
'tool_choice' => [
'name' => '<string>'
],
'output_config' => [
'effort' => 'high'
],
'thinking' => [
]
]),
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://www.anyfast.ai/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-sonnet-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {}\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://www.anyfast.ai/v1/messages")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-sonnet-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {}\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["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"claude-sonnet-5\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 1,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"output_config\": {\n \"effort\": \"high\"\n },\n \"thinking\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"model": "claude-sonnet-5",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123
},
"stop_sequence": "<string>"
}Body
Model ID.
claude-sonnet-5 "claude-sonnet-5"
Input messages. Each message has a role and content.
1Show child attributes
Show child attributes
[
{
"role": "user",
"content": "Hello, Claude!"
}
]
The maximum number of tokens to generate before stopping. Claude Sonnet 5 supports up to 128K output tokens.
1 <= x <= 1280001024
System prompt. Provides context and instructions to Claude.
An object describing metadata about the request.
Show child attributes
Show child attributes
Custom text sequences that will cause the model to stop generating.
Custom values are not supported. Only the compatibility value 1 is accepted; omit this field for normal requests.
1 <= x <= 11
Custom nucleus sampling is not supported. Values from 0.99 to 1 are accepted only for backward compatibility; omit this field for normal requests.
0.99 <= x <= 1Not supported on Claude Sonnet 5. Any supplied value returns a 400 error.
x >= 0Whether to incrementally stream the response using server-sent events.
Definitions of tools that the model may use.
Show child attributes
Show child attributes
How the model should use the provided tools.
Show child attributes
Show child attributes
Output controls for models that support adaptive thinking effort.
Show child attributes
Show child attributes
Adaptive thinking configuration. Claude Sonnet 5 uses adaptive thinking by default; use output_config.effort to control depth. Manual extended thinking is not supported.
Show child attributes
Show child attributes
Response
Message created successfully
"msg_01XFDUDYJgAACzvnptvVoYEL"
"message"
"assistant"
Show child attributes
Show child attributes
[
{
"type": "text",
"text": "Hello! How can I help you today?"
}
]
"claude-sonnet-5"
Includes refusal for requests that the model declines.
end_turn, max_tokens, stop_sequence, tool_use, refusal, null Show child attributes
Show child attributes
Was this page helpful?