> ## 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 Opus 5

> Anthropic's Claude Opus 5 via AnyFast. A 1M-context model for deep reasoning, complex agentic coding, and long-horizon enterprise work.

Claude Opus 5 is Anthropic's Opus model for complex agentic coding and enterprise work, available through AnyFast via the native Anthropic Messages API. Compared with Claude Opus 4.8, it improves deep reasoning, long-horizon tool use, code review, vision, and multi-agent coordination.

## Key capabilities

* **1M context window** — 1M tokens by default, with 128K max output tokens
* **Adaptive thinking** — On by default; control depth with `output_config.effort`
* **Five effort levels** — Choose `low`, `medium`, `high`, `xhigh`, or `max`; the default is `high`
* **Agentic coding** — Handles multi-file features, large refactors, code review, and long-running tool workflows
* **Vision and long context** — Understands images, charts, documents, and diagrams across long inputs
* **Tools and streaming** — Supports tool use and real-time SSE responses through the Messages API
* **Model ID** — Use `claude-opus-5`

## 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-opus-5",
      "max_tokens": 4096,
      "output_config": { "effort": "high" },
      "messages": [
        { "role": "user", "content": "Write a Python function to merge two sorted arrays." }
      ]
    }'
  ```

  ```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-opus-5",
      max_tokens=4096,
      output_config={"effort": "high"},
      messages=[
          {"role": "user", "content": "Write a Python function to merge two sorted arrays."}
      ]
  )

  print(message.content[0].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-opus-5",
      max_tokens=1024,
      messages=[
          {"role": "user", "content": "Explain the difference between async and sync programming."}
      ],
  ) as stream:
      for text in stream.text_stream:
          print(text, end="")
  ```
</CodeGroup>

## Parameters

| Parameter        | Type    | Required | Description                                                                                                          |
| ---------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `model`          | string  | Yes      | Must be `claude-opus-5`                                                                                              |
| `messages`       | array   | Yes      | List of `{ role, content }` objects                                                                                  |
| `max_tokens`     | integer | Yes      | Maximum tokens to generate. Claude Opus 5 supports up to 128K output tokens.                                         |
| `output_config`  | object  | No       | Use `{"effort":"low" \| "medium" \| "high" \| "xhigh" \| "max"}` to control adaptive thinking depth. Default: `high` |
| `thinking`       | object  | No       | Omit it to use default adaptive thinking, or use `{"type":"disabled"}` to turn thinking off.                         |
| `stream`         | boolean | No       | Enable SSE streaming. Default: `false`                                                                               |
| `stop_sequences` | array   | No       | Sequences that stop generation                                                                                       |

<Note>
  Claude Opus 5 uses adaptive thinking by default. `max_tokens` limits thinking and visible response tokens together, so use a sufficiently large value for `xhigh` and `max` workloads.
</Note>

<Warning>
  Manual extended thinking (`thinking: {type: "enabled", budget_tokens: N}`) and non-default `temperature`, `top_p`, or `top_k` values return a 400 error. Disabling thinking with `thinking: {type: "disabled"}` is supported only at `low`, `medium`, or `high` effort; combining it with `xhigh` or `max` also returns a 400 error.
</Warning>

<Card title="API Reference" icon="code" href="/api-reference/model-api/anthropic/claude-opus-5">
  View the interactive API playground for Claude Opus 5.
</Card>

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