ModelChat

Claude Sonnet 4.6

claude-sonnet-4-6

Use 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.

Auto route pricing

Route source: Anthropic

Input / Output
Input: $2.897Output: $14.483
Cache read / write
Cache read: $0.290Cache write: $3.621
Context / Max output
1000K / 128K
Live routes
1

Rates / 1M tokens

Image output: Price not supplied

These are separate usage rates, not a total request price.

On this page

Overview

Use 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.

Playground

Provider

Auto route pricing Input $2.897 · Output $14.483 / 1M tokens

Request parameters

POST /v1/messages
Other parameters (11)

Result preview

Anthropic · 216ms

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
}
Agent handoff preview

Providers

Auto route · Input $2.897 · Output $14.483 / 1M tokens
ProviderPricingLatencyUptimeSupplyRoute
Live
Input $2.897 / 1M tokens
Output $14.483
Cache read $0.290
Cache write $3.621
216ms—Verified
Selected pricing · AnthropicUSD / 1M tokens
Input
$2.897
Output
$14.483
Cache read
$0.290
Cache write
$3.621

Source: the selected provider route in OpenAny's public model catalog. A price update timestamp is not supplied.

API

Base URL
https://api.openany.si/v1
POST
/v1/messages
Authentication
Authorization: Bearer $OPENANY_API_KEY

Provider

Auto route pricing Input $2.897 · Output $14.483 / 1M tokens

Request parameters

ParameterType / rangeDefault valueRequiredDescription
max_tokensinteger—YesMaximum number of tokens to generate. This is required by Anthropic and is a hard limit for total output, including thinking and visible response content.
messagesarray—Yesmessages
modelstring—Yesmodel
metadataobject—NoMetadata object. Can include user_id to identify the end user for abuse monitoring and tracing. Example: {"user_id":"user-123"}.
stop_sequencesarray—NoCustom stop sequences. Supports up to 4 strings. Generation stops when any sequence is produced, and the stop sequence is not included in the output.
streambooleanfalseNoWhether to enable Server-Sent Events streaming output.
systemstring | array—Nosystem
temperaturenumber · 0 ~ 11NoSampling 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.
thinkingobject—NoExtended thinking configuration for supported models.
tool_choiceobject{"type":"auto"}NoControls tool use behavior. Use {"type":"auto"}, {"type":"any"}, or {"type":"tool","name":"tool_name"}.
toolsarray—NoTools available to the model. Each tool should define name, description, and input_schema.
top_kinteger—NoSample only from the top K most likely tokens. Prefer changing only one of temperature, top_p, or top_k.
top_pnumber · 0 ~ 1—NoNucleus 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

JSON
{
  "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."
    }
  }
}

Examples

Provider

Auto route pricing Input $2.897 · Output $14.483 / 1M tokens

Request example

POST /v1/messages
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"
  }
}'

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.