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

# ![LLMTR logo](https://models.dev/logos/llmtr.svg)LLMTR

Access 32 LLMTR models through Mastra's model router. Authentication is handled automatically using the `LLMTR_API_KEY` environment variable.

Learn more in the [LLMTR documentation](https://llmtr.com/docs).

```bash
LLMTR_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: "llmtr/gemma-4"
});

// 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 [LLMTR documentation](https://llmtr.com/docs) for details.

## Models

| Model                                   | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
| --------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
| `llmtr/gemma-4`                         | 131K    |       |           |       |       |       | $2         | $5          |
| `llmtr/google/gemini-2.5-flash-lite`    | 1.0M    |       |           |       |       |       | $0.10      | $0.10       |
| `llmtr/magibu-11b-v8`                   | 8K      |       |           |       |       |       | $0.10      | $0.50       |
| `llmtr/meta/muse-spark-1.2-contributor` | 1.0M    |       |           |       |       |       | $0.10      | $0.20       |
| `llmtr/mimo/mimo-v2.5`                  | 1.0M    |       |           |       |       |       | $0.14      | $0.28       |
| `llmtr/mimo/mimo-v2.5-pro`              | 1.0M    |       |           |       |       |       | $0.43      | $0.87       |
| `llmtr/mistral/voxtral-small-latest`    | 32K     |       |           |       |       |       | $0.10      | $0.30       |
| `llmtr/muse-glimmer-30b-tr`             | 131K    |       |           |       |       |       | $2         | $5          |
| `llmtr/perplexity/sonar-deep-research`  | 128K    |       |           |       |       |       | $2         | $8          |
| `llmtr/poolside/laguna-xs-2.1`          | 262K    |       |           |       |       |       | —          | —           |
| `llmtr/publicai/apertus-70b-instruct`   | 66K     |       |           |       |       |       | $0.82      | $3          |
| `llmtr/publicai/apertus-8b-instruct`    | 66K     |       |           |       |       |       | $0.10      | $0.20       |
| `llmtr/qwen/qwen-flash`                 | 1.0M    |       |           |       |       |       | $0.05      | $0.40       |
| `llmtr/qwen/qwen-plus`                  | 1.0M    |       |           |       |       |       | $0.40      | $1          |
| `llmtr/qwen/qwen3-coder-flash`          | 1.0M    |       |           |       |       |       | $0.30      | $2          |
| `llmtr/qwen/qwen3-coder-plus`           | 1.0M    |       |           |       |       |       | $1         | $5          |
| `llmtr/qwen/qwen3-max`                  | 256K    |       |           |       |       |       | $1         | $6          |
| `llmtr/qwen/qwen3-vl-plus`              | 256K    |       |           |       |       |       | $0.20      | $2          |
| `llmtr/qwen/qwen3.5-397b-a17b`          | 256K    |       |           |       |       |       | $0.60      | $4          |
| `llmtr/qwen/qwen3.5-plus`               | 1.0M    |       |           |       |       |       | $0.40      | $2          |
| `llmtr/qwen/qwen3.6-flash`              | 1.0M    |       |           |       |       |       | $0.25      | $2          |
| `llmtr/qwen/qwen3.6-plus`               | 1.0M    |       |           |       |       |       | $0.50      | $3          |
| `llmtr/qwen/qwen3.7-plus`               | 1.0M    |       |           |       |       |       | $0.40      | $2          |
| `llmtr/qwen3-6-35b`                     | 16K     |       |           |       |       |       | $5         | $10         |
| `llmtr/sakana/fugu-ultra`               | 1.0M    |       |           |       |       |       | $5         | $30         |
| `llmtr/thinkingmachines/inkling`        | 262K    |       |           |       |       |       | $2         | $5          |
| `llmtr/thinkingmachines/inkling-small`  | 262K    |       |           |       |       |       | $0.58      | $1          |
| `llmtr/trendyol-asure-12b`              | 41K     |       |           |       |       |       | $0.10      | $0.50       |
| `llmtr/upstage/solar-pro2`              | 66K     |       |           |       |       |       | $0.15      | $0.60       |
| `llmtr/upstage/solar-pro3`              | 131K    |       |           |       |       |       | $0.15      | $0.60       |
| `llmtr/upstage/solar-pro4`              | 524K    |       |           |       |       |       | $0.03      | $0.12       |

## Advanced configuration

### Custom headers

```typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://llmtr.com/v1",
    id: "llmtr/gemma-4",
    apiKey: process.env.LLMTR_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
      ? "llmtr/upstage/solar-pro4"
      : "llmtr/gemma-4";
  }
});
```