> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Sonnet 5.5

> Use Claude Sonnet 5.5 through AnyFast for coding, agent workflows, long-context analysis, and adaptive thinking.

Claude Sonnet 5.5 combines Sonnet-class speed with strong coding, agent, and long-context capabilities. Call it through AnyFast's Anthropic Messages API at `POST /v1/messages` using the model ID `claude-sonnet-5-5`.

## Key capabilities

* **1M context window** — Supports up to 1M context tokens and 128K output tokens according to Anthropic's model specification
* **Adaptive thinking** — On by default; use `output_config.effort` to control depth
* **Coding and agents** — Suited to multi-step implementation, tool use, and analysis
* **Text and vision** — Accepts text and image inputs and returns text
* **Model ID** — Use `claude-sonnet-5-5` in requests

## Quick example

<CodeGroup>
  ```bash cURL theme={null}
  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": "medium"},
      "messages": [
        {"role": "user", "content": "Review this rollout plan and identify its three highest-risk assumptions."}
      ]
    }'
  ```

  ```python Python theme={null}
  import anthropic

  client = anthropic.Anthropic(
      api_key="YOUR_API_KEY",
      base_url="https://www.anyfast.ai",
  )

  message = client.messages.create(
      model="claude-sonnet-5-5",
      max_tokens=4096,
      output_config={"effort": "medium"},
      messages=[{"role": "user", "content": "Review this rollout plan."}],
  )

  for block in message.content:
      if block.type == "text":
          print(block.text)
  ```

  ```python Streaming theme={null}
  import anthropic

  client = anthropic.Anthropic(
      api_key="YOUR_API_KEY",
      base_url="https://www.anyfast.ai",
  )

  with client.messages.stream(
      model="claude-sonnet-5-5",
      max_tokens=1024,
      messages=[{"role": "user", "content": "Summarize the rollout risks."}],
  ) as stream:
      for text in stream.text_stream:
          print(text, end="")
  ```
</CodeGroup>

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `model` | string | Yes | Must be `claude-sonnet-5-5`. |
| `messages` | array | Yes | User and assistant turns with text, image, or tool-result content. |
| `max_tokens` | integer | Yes | Maximum output tokens across thinking and visible text; up to 128,000. |
| `output_config` | object | No | Set `effort` to `low`, `medium`, `high`, `xhigh`, or `max`; default `high`. |
| `thinking` | object | No | Adaptive by default. `between_tools` is available with effort up to `high`. |
| `tools` | array | No | Tool definitions for model-selected calls. |
| `tool_choice` | object | No | Use `auto` or `none`. |
| `stream` | boolean | No | Enable SSE streaming; default `false`. |

<Note>
  At `low`, `medium`, or `high` effort, `thinking: {"type":"between_tools"}` skips thinking before the first tool call while allowing it between calls. Sonnet 5.5 does not support `thinking.type` values `disabled` or manual `enabled`, or forced `tool_choice` modes `any` and named `tool`; AnyFast returned `400` for `any` in a live test. Omit custom `temperature`, `top_p`, and `top_k` values. Replay thinking blocks unchanged when continuing a tool conversation.
</Note>

<Note>
  In a tested AnyFast text response, the request ID `claude-sonnet-5-5` appeared as `model: "claude-sonnet-5.5"`. The response also included `request_id`, `billing.billed_cost_usd` as a string, and `usage.service_tier`. Keep using the hyphen-form ID in requests; read response content blocks by `type`.
</Note>

<Card title="API Reference" icon="code" href="/api-reference/model-api/anthropic/claude-sonnet-5-5">
  Review the Claude Sonnet 5.5 request and response fields.
</Card>

<script src="/public/feedback.js" />


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.