> ## 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 4.8

> Anthropic's Claude Opus 4.8 via OpenAI-compatible API. The most capable generally available model with adaptive thinking and fast mode.

Claude Opus 4.8 is Anthropic's most capable generally available model, available through AnyFast via an OpenAI-compatible interface. It builds on Claude Opus 4.7 with improved long-horizon agentic coding, more reliable tool triggering, and better compaction handling.

## Key capabilities

* **OpenAI-compatible** — Works as a drop-in replacement with the OpenAI SDK
* **1M context window** — 128K max output tokens
* **Adaptive thinking** — Smart reasoning that triggers only when the task needs it
* **Fast mode** — Up to 2.5x higher output speed at premium pricing (research preview)
* **Mid-conversation system messages** — Append updated instructions without restating the full system prompt
* **Lower cache minimum** — 1,024 token minimum cacheable prompt length
* **Streaming** — Supports real-time token streaming via SSE

## 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-4-8",
      "messages": [
        { "role": "user", "content": "Explain quantum entanglement in simple terms." }
      ]
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI

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

  response = client.chat.completions.create(
      model="claude-opus-4-8",
      messages=[
          {"role": "user", "content": "Explain quantum entanglement in simple terms."}
      ]
  )

  print(response.choices[0].message.content)
  ```

  ```python Streaming theme={null}
  from openai import OpenAI

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

  stream = client.chat.completions.create(
      model="claude-opus-4-8",
      messages=[
          {"role": "user", "content": "Write a short poem about the sea."}
      ],
      stream=True
  )

  for chunk in stream:
      print(chunk.choices[0].delta.content or "", end="")
  ```
</CodeGroup>

## Parameters

| Parameter    | Type           | Required | Description                            |
| ------------ | -------------- | -------- | -------------------------------------- |
| `model`      | string         | Yes      | Must be `claude-opus-4-8`              |
| `messages`   | array          | Yes      | List of `{ role, content }` objects    |
| `max_tokens` | integer        | No       | Maximum tokens to generate             |
| `stream`     | boolean        | No       | Enable SSE streaming. Default: `false` |
| `stop`       | string / array | No       | Sequences that stop generation         |

<Note>
  `temperature`, `top_p`, and `top_k` are not supported on Claude Opus 4.8. Setting them to non-default values returns a 400 error. Use prompting to guide the model's behavior.
</Note>

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

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