> Discover all available pages from the documentation index: https://mastra.ai/llms.txt

# ![CrossModel logo](https://models.dev/logos/crossmodel.svg)CrossModel

Access 53 CrossModel models through Mastra's model router. Authentication is handled automatically using the `CROSSMODEL_API_KEY` environment variable.

Learn more in the [CrossModel documentation](https://www.crossmodel.ai/docs).

```bash
CROSSMODEL_API_KEY=your-api-key
```

```typescript
import { Agent } from "@mastra/core/agent";

const agent = new Agent({
  id: "my-agent",
  name: "My Agent",
  instructions: "You are a helpful assistant",
  model: "crossmodel/anthropic/claude-fable-5"
});

// Generate a response
const response = await agent.generate("Hello!");

// Stream a response
const stream = await agent.stream("Tell me a story");
for await (const chunk of stream) {
  console.log(chunk);
}
```

> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [CrossModel documentation](https://www.crossmodel.ai/docs) for details.

## Models

| Model                                              | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
| -------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
| `crossmodel/anthropic/claude-fable-5`              | 1.0M    |       |           |       |       |       | $10        | $50         |
| `crossmodel/anthropic/claude-haiku-4-5`            | 200K    |       |           |       |       |       | $1         | $5          |
| `crossmodel/anthropic/claude-opus-4-7`             | 1.0M    |       |           |       |       |       | $5         | $25         |
| `crossmodel/anthropic/claude-opus-4-8`             | 1.0M    |       |           |       |       |       | $5         | $25         |
| `crossmodel/anthropic/claude-opus-5`               | 1.0M    |       |           |       |       |       | $5         | $25         |
| `crossmodel/anthropic/claude-sonnet-4-6`           | 1.0M    |       |           |       |       |       | $3         | $15         |
| `crossmodel/anthropic/claude-sonnet-5`             | 1.0M    |       |           |       |       |       | $2         | $10         |
| `crossmodel/deepseek/deepseek-v4-flash`            | 1.0M    |       |           |       |       |       | $0.41      | $1          |
| `crossmodel/deepseek/deepseek-v4-flash-vision-exp` | 1.0M    |       |           |       |       |       | $0.41      | $1          |
| `crossmodel/deepseek/deepseek-v4-pro`              | 1.0M    |       |           |       |       |       | $1         | $4          |
| `crossmodel/gemini/gemini-2.5-flash`               | 1.0M    |       |           |       |       |       | $0.30      | $3          |
| `crossmodel/gemini/gemini-2.5-flash-lite`          | 1.0M    |       |           |       |       |       | $0.10      | $0.40       |
| `crossmodel/gemini/gemini-2.5-pro`                 | 1.0M    |       |           |       |       |       | $1         | $10         |
| `crossmodel/gemini/gemini-3-flash-preview`         | 1.0M    |       |           |       |       |       | $0.50      | $3          |
| `crossmodel/gemini/gemini-3.1-pro-preview`         | 1.0M    |       |           |       |       |       | $2         | $12         |
| `crossmodel/gemini/gemini-3.5-flash`               | 1.0M    |       |           |       |       |       | $2         | $9          |
| `crossmodel/gemini/gemini-3.5-flash-lite`          | 1.0M    |       |           |       |       |       | $0.30      | $3          |
| `crossmodel/gemini/gemini-3.6-flash`               | 1.0M    |       |           |       |       |       | $2         | $8          |
| `crossmodel/gemini/gemini-3.7-flash`               | 1.0M    |       |           |       |       |       | $0.75      | $4          |
| `crossmodel/minimax/minimax-m2.7`                  | 205K    |       |           |       |       |       | $0.33      | $1          |
| `crossmodel/minimax/minimax-m3`                    | 1.0M    |       |           |       |       |       | $0.33      | $1          |
| `crossmodel/moonshot/kimi-k2.5`                    | 262K    |       |           |       |       |       | $0.62      | $3          |
| `crossmodel/moonshot/kimi-k2.6`                    | 262K    |       |           |       |       |       | $1         | $4          |
| `crossmodel/moonshot/kimi-k2.7-code`               | 262K    |       |           |       |       |       | $1         | $4          |
| `crossmodel/moonshot/kimi-k3`                      | 1.0M    |       |           |       |       |       | $3         | $15         |
| `crossmodel/openai/gpt-4o-mini`                    | 128K    |       |           |       |       |       | $0.15      | $0.60       |
| `crossmodel/openai/gpt-5.4`                        | 1.1M    |       |           |       |       |       | $3         | $15         |
| `crossmodel/openai/gpt-5.4-mini`                   | 400K    |       |           |       |       |       | $0.75      | $5          |
| `crossmodel/openai/gpt-5.4-nano`                   | 400K    |       |           |       |       |       | $0.20      | $1          |
| `crossmodel/openai/gpt-5.5`                        | 1.1M    |       |           |       |       |       | $5         | $30         |
| `crossmodel/openai/gpt-5.5-pro`                    | 1.1M    |       |           |       |       |       | $30        | $180        |
| `crossmodel/openai/gpt-5.6-luna`                   | 1.1M    |       |           |       |       |       | $0.20      | $1          |
| `crossmodel/openai/gpt-5.6-sol`                    | 1.1M    |       |           |       |       |       | $5         | $30         |
| `crossmodel/openai/gpt-5.6-terra`                  | 1.1M    |       |           |       |       |       | $2         | $12         |
| `crossmodel/qwen/qwen3.6-flash`                    | 1.0M    |       |           |       |       |       | $0.19      | $1          |
| `crossmodel/qwen/qwen3.6-plus`                     | 1.0M    |       |           |       |       |       | $0.32      | $2          |
| `crossmodel/qwen/qwen3.7-flash`                    | 1.0M    |       |           |       |       |       | $0.04      | $0.13       |
| `crossmodel/qwen/qwen3.7-max`                      | 1.0M    |       |           |       |       |       | $2         | $5          |
| `crossmodel/qwen/qwen3.7-plus`                     | 1.0M    |       |           |       |       |       | $0.29      | $1          |
| `crossmodel/qwen/qwen3.8-max`                      | 1.0M    |       |           |       |       |       | $2         | $6          |
| `crossmodel/tencent/hy3`                           | 262K    |       |           |       |       |       | $0.16      | $0.64       |
| `crossmodel/x-ai/grok-4.3`                         | 1.0M    |       |           |       |       |       | $1         | $3          |
| `crossmodel/x-ai/grok-4.5`                         | 500K    |       |           |       |       |       | $2         | $6          |
| `crossmodel/x-ai/grok-4.6`                         | 500K    |       |           |       |       |       | $2         | $6          |
| `crossmodel/x-ai/grok-build-0.1`                   | 256K    |       |           |       |       |       | $1         | $2          |
| `crossmodel/xiaomi/mimo-v2.5`                      | 1.0M    |       |           |       |       |       | $0.16      | $0.32       |
| `crossmodel/xiaomi/mimo-v2.5-pro`                  | 1.0M    |       |           |       |       |       | $0.47      | $0.94       |
| `crossmodel/z-ai/glm-4.7`                          | 200K    |       |           |       |       |       | $0.47      | $2          |
| `crossmodel/z-ai/glm-5`                            | 200K    |       |           |       |       |       | $0.60      | $3          |
| `crossmodel/z-ai/glm-5-turbo`                      | 200K    |       |           |       |       |       | $0.90      | $4          |
| `crossmodel/z-ai/glm-5.1`                          | 200K    |       |           |       |       |       | $1         | $4          |
| `crossmodel/z-ai/glm-5.2`                          | 1.0M    |       |           |       |       |       | $1         | $4          |
| `crossmodel/z-ai/glm-5.3`                          | 1.0M    |       |           |       |       |       | $1         | $4          |

## Advanced configuration

### Custom headers

```typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://api.crossmodel.ai/v1",
    id: "crossmodel/anthropic/claude-fable-5",
    apiKey: process.env.CROSSMODEL_API_KEY,
    headers: {
      "X-Custom-Header": "value"
    }
  }
});
```

### Dynamic model selection

```typescript
const agent = new Agent({
  id: "dynamic-agent",
  name: "Dynamic Agent",
  model: ({ requestContext }) => {
    const useAdvanced = requestContext.task === "complex";
    return useAdvanced
      ? "crossmodel/z-ai/glm-5.3"
      : "crossmodel/anthropic/claude-fable-5";
  }
});
```