# ![Kiro logo](https://models.dev/logos/kiro.svg)Kiro

Access 12 Kiro models through Mastra's model router. Authentication is handled automatically using the `KIRO_API_KEY` environment variable.

Learn more in the [Kiro documentation](https://kiro.dev).

```bash
KIRO_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: "kiro/auto"
});

// 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 [Kiro documentation](https://kiro.dev) for details.

## Models

| Model                    | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
| ------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
| `kiro/auto`              | 1.0M    |       |           |       |       |       | —          | —           |
| `kiro/claude-haiku-4.5`  | 200K    |       |           |       |       |       | —          | —           |
| `kiro/claude-opus-4.5`   | 200K    |       |           |       |       |       | —          | —           |
| `kiro/claude-opus-4.6`   | 1.0M    |       |           |       |       |       | —          | —           |
| `kiro/claude-opus-4.7`   | 1.0M    |       |           |       |       |       | —          | —           |
| `kiro/claude-sonnet-4`   | 200K    |       |           |       |       |       | —          | —           |
| `kiro/claude-sonnet-4.5` | 200K    |       |           |       |       |       | —          | —           |
| `kiro/claude-sonnet-4.6` | 1.0M    |       |           |       |       |       | —          | —           |
| `kiro/deepseek-3.2`      | 164K    |       |           |       |       |       | —          | —           |
| `kiro/minimax-m2.1`      | 196K    |       |           |       |       |       | —          | —           |
| `kiro/minimax-m2.5`      | 196K    |       |           |       |       |       | —          | —           |
| `kiro/qwen3-coder-next`  | 256K    |       |           |       |       |       | —          | —           |

## Advanced configuration

### Custom headers

```typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://q.us-east-1.amazonaws.com",
    id: "kiro/auto",
    apiKey: process.env.KIRO_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
      ? "kiro/qwen3-coder-next"
      : "kiro/auto";
  }
});
```

## Direct provider installation

This provider can also be installed directly as a standalone package, which can be used instead of the Mastra model router string. View the [package documentation](https://www.npmjs.com/package/kiro-acp-ai-provider) for more details.

**npm**:

```bash
npm install kiro-acp-ai-provider
```

**pnpm**:

```bash
pnpm add kiro-acp-ai-provider
```

**Yarn**:

```bash
yarn add kiro-acp-ai-provider
```

**Bun**:

```bash
bun add kiro-acp-ai-provider
```