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

# Claude Opus 4.8

> Claude Opus 4.8: model for advanced coding, agents, and complex analysis. Request examples and parameters for MixRoute.

Claude Opus 4.8 is a model for advanced coding, agents, and complex analysis from Anthropic.

Call `claude-opus-4-8` through MixRoute's Anthropic-compatible Messages API; the OpenAI-compatible Chat Completions API is also supported.

## Key capabilities

* Messages API - Native Anthropic request and response format
* OpenAI-compatible - Also works through Chat Completions
* Streaming - Incremental output through SSE
* System prompts - Top-level system instructions
* Tool use - Supports Anthropic tool definitions

## Quick example

### Messages API

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.mixroute.ai/v1/messages" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "claude-opus-4-8",
      "max_tokens": 256,
      "messages": [
        {
          "role": "user",
          "content": "Explain quantum entanglement in simple terms."
        }
      ]
    }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    from anthropic import Anthropic

    client = Anthropic(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai")

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

    print(message.content[0].text)
    ```
  </Tab>

  <Tab title="Streaming">
    ```python theme={null}
    from anthropic import Anthropic

    client = Anthropic(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai")

    with client.messages.stream(
        model="claude-opus-4-8",
        max_tokens=256,
        messages=[{"role": "user", "content": "Write a short poem about the sea."}],
    ) as stream:
        for text in stream.text_stream:
            print(text, end="")
    ```
  </Tab>
</Tabs>

### OpenAI-compatible API

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.mixroute.ai/v1/chat/completions" \
      -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."
        }
      ],
      "max_tokens": 256
    }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI

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

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

    print(response.choices[0].message.content)
    ```
  </Tab>

  <Tab title="Streaming">
    ```python theme={null}
    from openai import OpenAI

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

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

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

## Parameters

### Messages API

| Parameter    | Type            | Required | Description                                     |
| ------------ | --------------- | -------- | ----------------------------------------------- |
| `model`      | string          | Yes      | Must be `claude-opus-4-8`.                      |
| `messages`   | array           | Yes      | Input messages with role and content.           |
| `max_tokens` | integer         | Yes      | Maximum tokens to generate.                     |
| `system`     | string \| array | No       | Top-level system instruction.                   |
| `stream`     | boolean         | No       | Enable SSE streaming.                           |
| `tools`      | array           | No       | Anthropic tool definitions.                     |
| `thinking`   | object          | No       | Extended-thinking configuration when supported. |

### OpenAI-compatible API

| Parameter     | Type            | Required | Description                                       |
| ------------- | --------------- | -------- | ------------------------------------------------- |
| `model`       | string          | Yes      | Must be `claude-opus-4-8`.                        |
| `messages`    | array           | Yes      | Conversation messages with role and content.      |
| `max_tokens`  | integer         | No       | Maximum generated tokens.                         |
| `stream`      | boolean         | No       | Enable SSE streaming. Default: false.             |
| `temperature` | number          | No       | Sampling temperature when supported by the model. |
| `top_p`       | number          | No       | Nucleus sampling threshold when supported.        |
| `stop`        | string \| array | No       | Sequences that stop generation.                   |
| `tools`       | array           | No       | OpenAI-compatible tool definitions.               |
