# ![Firmware logo](https://models.dev/logos/firmware.svg)Firmware

Access 25 Firmware models through Mastra's model router. Authentication is handled automatically using the `FIRMWARE_API_KEY` environment variable.

Learn more in the [Firmware documentation](https://docs.frogbot.ai).

```bash
FIRMWARE_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: "firmware/claude-haiku-4-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);
}
```

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

## Models

| Model                                  | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
| -------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
| `firmware/claude-haiku-4-5`            | 200K    |       |           |       |       |       | $1         | $5          |
| `firmware/claude-opus-4-6`             | 200K    |       |           |       |       |       | $5         | $25         |
| `firmware/claude-opus-4-7`             | 200K    |       |           |       |       |       | $5         | $25         |
| `firmware/claude-sonnet-4-6`           | 200K    |       |           |       |       |       | $3         | $15         |
| `firmware/deepseek-v3-2`               | 128K    |       |           |       |       |       | $0.58      | $2          |
| `firmware/gemini-2.5-flash`            | 1.0M    |       |           |       |       |       | $0.30      | $3          |
| `firmware/gemini-2.5-pro`              | 1.0M    |       |           |       |       |       | $1         | $10         |
| `firmware/gemini-3-1-pro-preview`      | 1.0M    |       |           |       |       |       | $2         | $12         |
| `firmware/gemini-3-flash-preview`      | 1.0M    |       |           |       |       |       | $0.50      | $3          |
| `firmware/gemini-3-pro-preview`        | 1.0M    |       |           |       |       |       | $2         | $12         |
| `firmware/gpt-4o`                      | 128K    |       |           |       |       |       | $3         | $10         |
| `firmware/gpt-5-3-codex`               | 400K    |       |           |       |       |       | $2         | $14         |
| `firmware/gpt-5-4`                     | 272K    |       |           |       |       |       | $3         | $15         |
| `firmware/gpt-5-mini`                  | 400K    |       |           |       |       |       | $0.25      | $2          |
| `firmware/gpt-5-nano`                  | 400K    |       |           |       |       |       | $0.05      | $0.40       |
| `firmware/gpt-oss-120b`                | 131K    |       |           |       |       |       | $0.15      | $0.60       |
| `firmware/gpt-oss-20b`                 | 131K    |       |           |       |       |       | $0.07      | $0.20       |
| `firmware/grok-4-1-fast-non-reasoning` | 2.0M    |       |           |       |       |       | $0.20      | $0.50       |
| `firmware/grok-4-1-fast-reasoning`     | 2.0M    |       |           |       |       |       | $0.20      | $0.50       |
| `firmware/grok-code-fast-1`            | 256K    |       |           |       |       |       | $0.20      | $2          |
| `firmware/kimi-k2-6`                   | 256K    |       |           |       |       |       | $0.95      | $4          |
| `firmware/kimi-k2.5`                   | 256K    |       |           |       |       |       | $0.60      | $3          |
| `firmware/minimax-m2-5`                | 192K    |       |           |       |       |       | $0.30      | $1          |
| `firmware/qwen-3-6-plus`               | 1.0M    |       |           |       |       |       | $0.50      | $3          |
| `firmware/zai-glm-5-1`                 | 198K    |       |           |       |       |       | $1         | $4          |

## Advanced configuration

### Custom headers

```typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://app.frogbot.ai/api/v1",
    id: "firmware/claude-haiku-4-5",
    apiKey: process.env.FIRMWARE_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
      ? "firmware/zai-glm-5-1"
      : "firmware/claude-haiku-4-5";
  }
});
```