# ![NovitaAI logo](https://models.dev/logos/novita-ai.svg)NovitaAI

Access 99 NovitaAI models through Mastra's model router. Authentication is handled automatically using the `NOVITA_API_KEY` environment variable.

Learn more in the [NovitaAI documentation](https://novita.ai/docs/guides/introduction).

```bash
NOVITA_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: "novita-ai/baichuan/baichuan-m2-32b"
});

// 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 [NovitaAI documentation](https://novita.ai/docs/guides/introduction) for details.

## Models

| Model                                                         | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
| ------------------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
| `novita-ai/baichuan/baichuan-m2-32b`                          | 131K    |       |           |       |       |       | $0.07      | $0.07       |
| `novita-ai/baidu/ernie-4.5-21B-a3b`                           | 120K    |       |           |       |       |       | $0.07      | $0.28       |
| `novita-ai/baidu/ernie-4.5-21B-a3b-thinking`                  | 131K    |       |           |       |       |       | $0.07      | $0.28       |
| `novita-ai/baidu/ernie-4.5-300b-a47b-paddle`                  | 123K    |       |           |       |       |       | $0.28      | $1          |
| `novita-ai/baidu/ernie-4.5-vl-28b-a3b`                        | 30K     |       |           |       |       |       | $1         | $6          |
| `novita-ai/baidu/ernie-4.5-vl-28b-a3b-thinking`               | 131K    |       |           |       |       |       | $0.39      | $0.39       |
| `novita-ai/baidu/ernie-4.5-vl-424b-a47b`                      | 123K    |       |           |       |       |       | $0.42      | $1          |
| `novita-ai/deepseek/deepseek-ocr`                             | 8K      |       |           |       |       |       | $0.03      | $0.03       |
| `novita-ai/deepseek/deepseek-ocr-2`                           | 8K      |       |           |       |       |       | $0.03      | $0.03       |
| `novita-ai/deepseek/deepseek-prover-v2-671b`                  | 160K    |       |           |       |       |       | $0.70      | $3          |
| `novita-ai/deepseek/deepseek-r1-0528`                         | 164K    |       |           |       |       |       | $0.70      | $3          |
| `novita-ai/deepseek/deepseek-r1-0528-qwen3-8b`                | 128K    |       |           |       |       |       | $0.06      | $0.09       |
| `novita-ai/deepseek/deepseek-r1-distill-llama-70b`            | 8K      |       |           |       |       |       | $0.80      | $0.80       |
| `novita-ai/deepseek/deepseek-r1-distill-qwen-14b`             | 33K     |       |           |       |       |       | $0.15      | $0.15       |
| `novita-ai/deepseek/deepseek-r1-distill-qwen-32b`             | 64K     |       |           |       |       |       | $0.30      | $0.30       |
| `novita-ai/deepseek/deepseek-r1-turbo`                        | 64K     |       |           |       |       |       | $0.70      | $3          |
| `novita-ai/deepseek/deepseek-v3-0324`                         | 164K    |       |           |       |       |       | $0.27      | $1          |
| `novita-ai/deepseek/deepseek-v3-turbo`                        | 64K     |       |           |       |       |       | $0.40      | $1          |
| `novita-ai/deepseek/deepseek-v3.1`                            | 131K    |       |           |       |       |       | $0.27      | $1          |
| `novita-ai/deepseek/deepseek-v3.1-terminus`                   | 131K    |       |           |       |       |       | $0.27      | $1          |
| `novita-ai/deepseek/deepseek-v3.2`                            | 164K    |       |           |       |       |       | $0.27      | $0.40       |
| `novita-ai/deepseek/deepseek-v3.2-exp`                        | 164K    |       |           |       |       |       | $0.27      | $0.41       |
| `novita-ai/deepseek/deepseek-v4-flash`                        | 1.0M    |       |           |       |       |       | $0.14      | $0.28       |
| `novita-ai/deepseek/deepseek-v4-pro`                          | 1.0M    |       |           |       |       |       | $2         | $3          |
| `novita-ai/google/gemma-3-12b-it`                             | 131K    |       |           |       |       |       | $0.05      | $0.10       |
| `novita-ai/google/gemma-3-27b-it`                             | 98K     |       |           |       |       |       | $0.12      | $0.20       |
| `novita-ai/google/gemma-4-26b-a4b-it`                         | 262K    |       |           |       |       |       | $0.13      | $0.40       |
| `novita-ai/google/gemma-4-31b-it`                             | 262K    |       |           |       |       |       | $0.14      | $0.40       |
| `novita-ai/gryphe/mythomax-l2-13b`                            | 4K      |       |           |       |       |       | $0.09      | $0.09       |
| `novita-ai/inclusionai/ling-2.6-1t`                           | 262K    |       |           |       |       |       | —          | —           |
| `novita-ai/kwaipilot/kat-coder-pro`                           | 256K    |       |           |       |       |       | $0.30      | $1          |
| `novita-ai/meta-llama/llama-3-70b-instruct`                   | 8K      |       |           |       |       |       | $0.51      | $0.74       |
| `novita-ai/meta-llama/llama-3-8b-instruct`                    | 8K      |       |           |       |       |       | $0.04      | $0.04       |
| `novita-ai/meta-llama/llama-3.1-8b-instruct`                  | 16K     |       |           |       |       |       | $0.02      | $0.05       |
| `novita-ai/meta-llama/llama-3.2-3b-instruct`                  | 33K     |       |           |       |       |       | $0.03      | $0.05       |
| `novita-ai/meta-llama/llama-3.3-70b-instruct`                 | 131K    |       |           |       |       |       | $0.14      | $0.40       |
| `novita-ai/meta-llama/llama-4-maverick-17b-128e-instruct-fp8` | 1.0M    |       |           |       |       |       | $0.27      | $0.85       |
| `novita-ai/meta-llama/llama-4-scout-17b-16e-instruct`         | 131K    |       |           |       |       |       | $0.18      | $0.59       |
| `novita-ai/microsoft/wizardlm-2-8x22b`                        | 66K     |       |           |       |       |       | $0.62      | $0.62       |
| `novita-ai/minimax/minimax-m2`                                | 205K    |       |           |       |       |       | $0.30      | $1          |
| `novita-ai/minimax/minimax-m2.1`                              | 205K    |       |           |       |       |       | $0.30      | $1          |
| `novita-ai/minimax/minimax-m2.5`                              | 205K    |       |           |       |       |       | $0.30      | $1          |
| `novita-ai/minimax/minimax-m2.5-highspeed`                    | 205K    |       |           |       |       |       | $0.60      | $2          |
| `novita-ai/minimax/minimax-m2.7`                              | 205K    |       |           |       |       |       | $0.30      | $1          |
| `novita-ai/minimaxai/minimax-m1-80k`                          | 1.0M    |       |           |       |       |       | $0.55      | $2          |
| `novita-ai/mistralai/mistral-nemo`                            | 60K     |       |           |       |       |       | $0.04      | $0.17       |
| `novita-ai/moonshotai/kimi-k2-0905`                           | 262K    |       |           |       |       |       | $0.60      | $3          |
| `novita-ai/moonshotai/kimi-k2-instruct`                       | 131K    |       |           |       |       |       | $0.57      | $2          |
| `novita-ai/moonshotai/kimi-k2-thinking`                       | 262K    |       |           |       |       |       | $0.60      | $3          |
| `novita-ai/moonshotai/kimi-k2.5`                              | 262K    |       |           |       |       |       | $0.60      | $3          |
| `novita-ai/moonshotai/kimi-k2.6`                              | 262K    |       |           |       |       |       | $0.95      | $4          |
| `novita-ai/nousresearch/hermes-2-pro-llama-3-8b`              | 8K      |       |           |       |       |       | $0.14      | $0.14       |
| `novita-ai/openai/gpt-oss-120b`                               | 131K    |       |           |       |       |       | $0.05      | $0.25       |
| `novita-ai/openai/gpt-oss-20b`                                | 131K    |       |           |       |       |       | $0.04      | $0.15       |
| `novita-ai/paddlepaddle/paddleocr-vl`                         | 16K     |       |           |       |       |       | $0.02      | $0.02       |
| `novita-ai/qwen/qwen-2.5-72b-instruct`                        | 32K     |       |           |       |       |       | $0.38      | $0.40       |
| `novita-ai/qwen/qwen-mt-plus`                                 | 16K     |       |           |       |       |       | $0.25      | $0.75       |
| `novita-ai/qwen/qwen2.5-7b-instruct`                          | 32K     |       |           |       |       |       | $0.07      | $0.07       |
| `novita-ai/qwen/qwen2.5-vl-72b-instruct`                      | 33K     |       |           |       |       |       | $0.80      | $0.80       |
| `novita-ai/qwen/qwen3-235b-a22b-fp8`                          | 41K     |       |           |       |       |       | $0.20      | $0.80       |
| `novita-ai/qwen/qwen3-235b-a22b-instruct-2507`                | 131K    |       |           |       |       |       | $0.09      | $0.58       |
| `novita-ai/qwen/qwen3-235b-a22b-thinking-2507`                | 131K    |       |           |       |       |       | $0.30      | $3          |
| `novita-ai/qwen/qwen3-30b-a3b-fp8`                            | 41K     |       |           |       |       |       | $0.09      | $0.45       |
| `novita-ai/qwen/qwen3-32b-fp8`                                | 41K     |       |           |       |       |       | $0.10      | $0.45       |
| `novita-ai/qwen/qwen3-4b-fp8`                                 | 128K    |       |           |       |       |       | $0.03      | $0.03       |
| `novita-ai/qwen/qwen3-8b-fp8`                                 | 128K    |       |           |       |       |       | $0.04      | $0.14       |
| `novita-ai/qwen/qwen3-coder-30b-a3b-instruct`                 | 160K    |       |           |       |       |       | $0.07      | $0.27       |
| `novita-ai/qwen/qwen3-coder-480b-a35b-instruct`               | 262K    |       |           |       |       |       | $0.30      | $1          |
| `novita-ai/qwen/qwen3-coder-next`                             | 262K    |       |           |       |       |       | $0.20      | $2          |
| `novita-ai/qwen/qwen3-max`                                    | 262K    |       |           |       |       |       | $2         | $8          |
| `novita-ai/qwen/qwen3-next-80b-a3b-instruct`                  | 131K    |       |           |       |       |       | $0.15      | $2          |
| `novita-ai/qwen/qwen3-next-80b-a3b-thinking`                  | 131K    |       |           |       |       |       | $0.15      | $2          |
| `novita-ai/qwen/qwen3-omni-30b-a3b-instruct`                  | 66K     |       |           |       |       |       | $0.25      | $0.97       |
| `novita-ai/qwen/qwen3-omni-30b-a3b-thinking`                  | 66K     |       |           |       |       |       | $0.25      | $0.97       |
| `novita-ai/qwen/qwen3-vl-235b-a22b-instruct`                  | 131K    |       |           |       |       |       | $0.30      | $2          |
| `novita-ai/qwen/qwen3-vl-235b-a22b-thinking`                  | 131K    |       |           |       |       |       | $0.98      | $4          |
| `novita-ai/qwen/qwen3-vl-30b-a3b-instruct`                    | 131K    |       |           |       |       |       | $0.20      | $0.70       |
| `novita-ai/qwen/qwen3-vl-30b-a3b-thinking`                    | 131K    |       |           |       |       |       | $0.20      | $1          |
| `novita-ai/qwen/qwen3-vl-8b-instruct`                         | 131K    |       |           |       |       |       | $0.08      | $0.50       |
| `novita-ai/qwen/qwen3.5-122b-a10b`                            | 262K    |       |           |       |       |       | $0.40      | $3          |
| `novita-ai/qwen/qwen3.5-27b`                                  | 262K    |       |           |       |       |       | $0.30      | $2          |
| `novita-ai/qwen/qwen3.5-35b-a3b`                              | 262K    |       |           |       |       |       | $0.25      | $2          |
| `novita-ai/qwen/qwen3.5-397b-a17b`                            | 262K    |       |           |       |       |       | $0.60      | $4          |
| `novita-ai/qwen/qwen3.6-27b`                                  | 262K    |       |           |       |       |       | $0.60      | $4          |
| `novita-ai/sao10k/l3-70b-euryale-v2.1`                        | 8K      |       |           |       |       |       | $1         | $1          |
| `novita-ai/sao10k/l3-8b-lunaris`                              | 8K      |       |           |       |       |       | $0.05      | $0.05       |
| `novita-ai/sao10k/L3-8B-Stheno-v3.2`                          | 8K      |       |           |       |       |       | $0.05      | $0.05       |
| `novita-ai/sao10k/l31-70b-euryale-v2.2`                       | 8K      |       |           |       |       |       | $1         | $1          |
| `novita-ai/xiaomimimo/mimo-v2-flash`                          | 262K    |       |           |       |       |       | $0.10      | $0.30       |
| `novita-ai/zai-org/autoglm-phone-9b-multilingual`             | 66K     |       |           |       |       |       | $0.04      | $0.14       |
| `novita-ai/zai-org/glm-4.5`                                   | 131K    |       |           |       |       |       | $0.60      | $2          |
| `novita-ai/zai-org/glm-4.5-air`                               | 131K    |       |           |       |       |       | $0.13      | $0.85       |
| `novita-ai/zai-org/glm-4.5v`                                  | 66K     |       |           |       |       |       | $0.60      | $2          |
| `novita-ai/zai-org/glm-4.6`                                   | 205K    |       |           |       |       |       | $0.55      | $2          |
| `novita-ai/zai-org/glm-4.6v`                                  | 131K    |       |           |       |       |       | $0.30      | $0.90       |
| `novita-ai/zai-org/glm-4.7`                                   | 205K    |       |           |       |       |       | $0.60      | $2          |
| `novita-ai/zai-org/glm-4.7-flash`                             | 200K    |       |           |       |       |       | $0.07      | $0.40       |
| `novita-ai/zai-org/glm-5`                                     | 203K    |       |           |       |       |       | $1         | $3          |
| `novita-ai/zai-org/glm-5.1`                                   | 205K    |       |           |       |       |       | $1         | $4          |

## Advanced configuration

### Custom headers

```typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://api.novita.ai/openai",
    id: "novita-ai/baichuan/baichuan-m2-32b",
    apiKey: process.env.NOVITA_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
      ? "novita-ai/zai-org/glm-5.1"
      : "novita-ai/baichuan/baichuan-m2-32b";
  }
});
```