Claude Sonnet 4.6
claude-sonnet-4-6Use the Claude Sonnet 4 6 API for chat and coding. Send conversation messages and include tool definitions on supported routes. Use it to work through multi-step coding tasks or review longer technical material. Compare the available provider routes, request examples, and usage prices on OpenAny.
- Published price
- From $2.897 / 1M tokens
- Billing unit
- / 1M tokens
- Context / Max output
- 1000K / 128K
- Listed routes
- 1
Other parameters (11)
Result preview
Anthropic · 1269ms
Response example. Run to see the actual response.
{
"id": "msg_bdrk_01Bg1KUdHeA2Nf2TMgxsQ2P2",
"model": "claude-sonnet-4-6",
"usage": {
"input_tokens": 0,
"total_tokens": 31,
"output_tokens": 0,
"prompt_tokens": 8,
"completion_tokens": 23,
"input_tokens_details": null,
"prompt_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0,
"cached_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0,
"reasoning_tokens": 0
},
"claude_cache_creation_1_h_tokens": 0,
"claude_cache_creation_5_m_tokens": 0
},
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How are you doing? Is there something I can help you with today? 😊"
},
"finish_reason": "stop"
}
],
"created": 1784810011,
"openmodels_cost": 380
}- Base URL
https://api.openany.si/v1- POST
/v1/messages- Authentication
Authorization: Bearer $OPENANY_API_KEY
Request parameters
| Parameter | Type / range | Default value | Required | Description |
|---|---|---|---|---|
max_tokens | integer | — | Yes | Maximum number of tokens to generate. This is required by Anthropic and is a hard limit for total output, including thinking and visible response content. |
messages | array | — | Yes | messages |
model | string | — | Yes | model |
metadata | object | — | No | Metadata object. Can include user_id to identify the end user for abuse monitoring and tracing. Example: {"user_id":"user-123"}. |
stop_sequences | array | — | No | Custom stop sequences. Supports up to 4 strings. Generation stops when any sequence is produced, and the stop sequence is not included in the output. |
stream | boolean | false | No | Whether to enable Server-Sent Events streaming output. |
system | string | array | — | No | system |
temperature | number · 0 ~ 1 | 1 | No | Sampling temperature from 0.0 to 1.0. Higher values make output more random; lower values make output more deterministic. Prefer changing only one of temperature, top_p, or top_k. |
thinking | object | — | No | Extended thinking configuration for supported models. |
tool_choice | object | {"type":"auto"} | No | Controls tool use behavior. Use {"type":"auto"}, {"type":"any"}, or {"type":"tool","name":"tool_name"}. |
tools | array | — | No | Tools available to the model. Each tool should define name, description, and input_schema. |
top_k | integer | — | No | Sample only from the top K most likely tokens. Prefer changing only one of temperature, top_p, or top_k. |
top_p | number · 0 ~ 1 | — | No | Nucleus sampling threshold from 0.0 to 1.0. Prefer changing only one of temperature, top_p, or top_k. |
Request example
curl 'https://api.openany.si/v1/messages' \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_tokens": 1024,
"messages": [
{
"content": "hello",
"role": "user"
}
],
"model": "claude-sonnet-4-6",
"stream": false,
"temperature": 1,
"tool_choice": {
"type": "auto"
}
}'Response example
Configured response example · not a live result
{
"id": "msg_bdrk_01Bg1KUdHeA2Nf2TMgxsQ2P2",
"model": "claude-sonnet-4-6",
"usage": {
"input_tokens": 0,
"total_tokens": 31,
"output_tokens": 0,
"prompt_tokens": 8,
"completion_tokens": 23,
"input_tokens_details": null,
"prompt_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0,
"cached_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 0,
"audio_tokens": 0,
"image_tokens": 0,
"reasoning_tokens": 0
},
"claude_cache_creation_1_h_tokens": 0,
"claude_cache_creation_5_m_tokens": 0
},
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How are you doing? Is there something I can help you with today? 😊"
},
"finish_reason": "stop"
}
],
"created": 1784810011,
"openmodels_cost": 380
}Error handling
400Check the model ID and request fields.429Retry with exponential backoff.5xxRetry only temporary provider failures.JSON Schema
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"max_tokens",
"messages",
"model"
],
"properties": {
"model": {
"type": "string"
},
"tools": {
"type": "array",
"items": {
"type": "object"
},
"description": "Tools available to the model. Each tool should define name, description, and input_schema."
},
"top_k": {
"type": "integer",
"description": "Sample only from the top K most likely tokens. Prefer changing only one of temperature, top_p, or top_k."
},
"top_p": {
"type": "number",
"maximum": 1,
"minimum": 0,
"description": "Nucleus sampling threshold from 0.0 to 1.0. Prefer changing only one of temperature, top_p, or top_k."
},
"stream": {
"type": "boolean",
"default": false,
"description": "Whether to enable Server-Sent Events streaming output."
},
"system": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"text"
],
"properties": {
"text": {
"type": "string"
},
"type": {
"const": "text"
}
}
}
}
]
},
"messages": {
"type": "array",
"items": {
"type": "object",
"required": [
"role",
"content"
],
"properties": {
"role": {
"enum": [
"user",
"assistant"
],
"type": "string",
"description": "Message role. The Messages API does not support a system role inside messages; use the top-level system parameter instead."
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string"
}
}
}
}
],
"description": "Message content. Can be a string or an array of typed content blocks such as text, image, tool_result, or document blocks."
}
}
}
},
"metadata": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"description": "End-user identifier used for abuse monitoring and tracing."
}
},
"description": "Metadata object. Can include user_id to identify the end user for abuse monitoring and tracing. Example: {\"user_id\":\"user-123\"}."
},
"thinking": {
"type": "object",
"properties": {
"type": {
"enum": [
"adaptive",
"enabled"
],
"type": "string",
"description": "Thinking mode type. adaptive is recommended and lets the model decide when and how deeply to think. enabled is supported by older models and usually requires budget_tokens."
},
"budget_tokens": {
"type": "integer",
"description": "Token budget for extended thinking. Used with older enabled thinking mode when supported by the model."
}
},
"description": "Extended thinking configuration for supported models."
},
"max_tokens": {
"type": "integer",
"description": "Maximum number of tokens to generate. This is required by Anthropic and is a hard limit for total output, including thinking and visible response content."
},
"temperature": {
"type": "number",
"default": 1,
"maximum": 1,
"minimum": 0,
"description": "Sampling temperature from 0.0 to 1.0. Higher values make output more random; lower values make output more deterministic. Prefer changing only one of temperature, top_p, or top_k."
},
"tool_choice": {
"type": "object",
"default": {
"type": "auto"
},
"description": "Controls tool use behavior. Use {\"type\":\"auto\"}, {\"type\":\"any\"}, or {\"type\":\"tool\",\"name\":\"tool_name\"}."
},
"stop_sequences": {
"type": "array",
"items": {
"type": "string"
},
"description": "Custom stop sequences. Supports up to 4 strings. Generation stops when any sequence is produced, and the stop sequence is not included in the output."
}
}
}Request example
POST /v1/messagescurl 'https://api.openany.si/v1/messages' \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_tokens": 1024,
"messages": [
{
"content": "hello",
"role": "user"
}
],
"model": "claude-sonnet-4-6",
"stream": false,
"temperature": 1,
"tool_choice": {
"type": "auto"
}
}'Model API questions
How do I call Claude Sonnet 4.6 through OpenAny?
Use model ID claude-sonnet-4-6 with an OpenAny key and the operation published in this model's API tab. The model API base is https://api.openany.si/v1. Confirm the protocol and request schema; model availability does not imply every OpenAI API operation is supported.
How is Claude Sonnet 4.6 billed?
Compare the published rate and billing unit of the selected provider route. Input, output and cache token rates may differ. Image, audio and video models can use other units. Recorded usage determines the charge under that route's billing contract.
Are Community and Verified routes the same as an official publisher API?
No. Inspect the provider name and supply classification for the specific route. A marketplace listing or a supply label is not a claim of publisher endorsement, identical service or measured uptime. Different route prices may reflect different supply and conditions.
Where do these prices come from, and when were they updated?
Rates come from the provider routes in OpenAny's public model catalog, not an independent quote from the model publisher. The catalog does not supply a price update timestamp. A page or catalog snapshot date is not a price revision date. Compare supply, billing units, tiers and conditions; a lower listed rate alone does not establish equivalent service or explain the price difference.
Use Claude Sonnet 4.6 with your agent
Inspect endpoint contracts and confirm availability and pricing before a paid call.