# ![DigitalOcean logo](https://models.dev/logos/digitalocean.svg)DigitalOcean

Access 71 DigitalOcean models through Mastra's model router. Authentication is handled automatically using the `DIGITALOCEAN_ACCESS_TOKEN` environment variable.

Learn more in the [DigitalOcean documentation](https://docs.digitalocean.com/products/gradient-ai-platform/details/models/).

```bash
DIGITALOCEAN_ACCESS_TOKEN=your-api-token
```

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

const agent = new Agent({
  id: "my-agent",
  name: "My Agent",
  instructions: "You are a helpful assistant",
  model: "digitalocean/alibaba-qwen3-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 [DigitalOcean documentation](https://docs.digitalocean.com/products/gradient-ai-platform/details/models/) for details.

## Models

| Model                                                | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
| ---------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
| `digitalocean/alibaba-qwen3-32b`                     | 131K    |       |           |       |       |       | $0.25      | $0.55       |
| `digitalocean/all-mini-lm-l6-v2`                     | 256     |       |           |       |       |       | $0.01      | —           |
| `digitalocean/anthropic-claude-4.1-opus`             | 200K    |       |           |       |       |       | $15        | $75         |
| `digitalocean/anthropic-claude-4.5-haiku`            | 200K    |       |           |       |       |       | $1         | $5          |
| `digitalocean/anthropic-claude-4.5-sonnet`           | 1.0M    |       |           |       |       |       | $3         | $15         |
| `digitalocean/anthropic-claude-4.6-sonnet`           | 1.0M    |       |           |       |       |       | $3         | $15         |
| `digitalocean/anthropic-claude-haiku-4.5`            | 200K    |       |           |       |       |       | $1         | $5          |
| `digitalocean/anthropic-claude-opus-4`               | 200K    |       |           |       |       |       | $15        | $75         |
| `digitalocean/anthropic-claude-opus-4.5`             | 200K    |       |           |       |       |       | $5         | $25         |
| `digitalocean/anthropic-claude-opus-4.6`             | 1.0M    |       |           |       |       |       | $5         | $25         |
| `digitalocean/anthropic-claude-opus-4.7`             | 1.0M    |       |           |       |       |       | $5         | $25         |
| `digitalocean/anthropic-claude-sonnet-4`             | 1.0M    |       |           |       |       |       | $3         | $15         |
| `digitalocean/arcee-trinity-large-thinking`          | 256K    |       |           |       |       |       | $0.25      | $0.90       |
| `digitalocean/bge-m3`                                | 8K      |       |           |       |       |       | $0.02      | —           |
| `digitalocean/bge-reranker-v2-m3`                    | 8K      |       |           |       |       |       | $0.01      | —           |
| `digitalocean/deepseek-3.2`                          | 128K    |       |           |       |       |       | $0.50      | $2          |
| `digitalocean/deepseek-r1-distill-llama-70b`         | 131K    |       |           |       |       |       | $0.99      | $0.99       |
| `digitalocean/deepseek-v3`                           | 164K    |       |           |       |       |       | —          | —           |
| `digitalocean/deepseek-v4-pro`                       | 1.0M    |       |           |       |       |       | $2         | $3          |
| `digitalocean/e5-large-v2`                           | 512     |       |           |       |       |       | $0.02      | —           |
| `digitalocean/fal-ai/elevenlabs/tts/multilingual-v2` | —       |       |           |       |       |       | —          | —           |
| `digitalocean/fal-ai/fast-sdxl`                      | —       |       |           |       |       |       | —          | —           |
| `digitalocean/fal-ai/flux/schnell`                   | —       |       |           |       |       |       | —          | —           |
| `digitalocean/fal-ai/stable-audio-25/text-to-audio`  | —       |       |           |       |       |       | —          | —           |
| `digitalocean/gemma-4-31B-it`                        | 256K    |       |           |       |       |       | $0.18      | $0.50       |
| `digitalocean/glm-5`                                 | 203K    |       |           |       |       |       | $1         | $3          |
| `digitalocean/gte-large-en-v1.5`                     | 8K      |       |           |       |       |       | $0.09      | —           |
| `digitalocean/kimi-k2.5`                             | 262K    |       |           |       |       |       | $0.50      | $3          |
| `digitalocean/kimi-k2.6`                             | 262K    |       |           |       |       |       | $0.95      | $4          |
| `digitalocean/llama-4-maverick`                      | 1.0M    |       |           |       |       |       | $0.25      | $0.87       |
| `digitalocean/llama3-8b-instruct`                    | 131K    |       |           |       |       |       | $0.20      | $0.20       |
| `digitalocean/llama3.3-70b-instruct`                 | 128K    |       |           |       |       |       | $0.65      | $0.65       |
| `digitalocean/minimax-m2.5`                          | 205K    |       |           |       |       |       | $0.30      | $1          |
| `digitalocean/ministral-3-8b-instruct-2512`          | 262K    |       |           |       |       |       | —          | —           |
| `digitalocean/mistral-3-14B`                         | 262K    |       |           |       |       |       | $0.20      | $0.20       |
| `digitalocean/mistral-7b-instruct-v0.3`              | 33K     |       |           |       |       |       | —          | —           |
| `digitalocean/multi-qa-mpnet-base-dot-v1`            | 512     |       |           |       |       |       | $0.01      | —           |
| `digitalocean/nemotron-3-nano-30b`                   | 262K    |       |           |       |       |       | —          | —           |
| `digitalocean/nemotron-3-nano-omni`                  | 66K     |       |           |       |       |       | $0.50      | $0.90       |
| `digitalocean/nemotron-nano-12b-v2-vl`               | 128K    |       |           |       |       |       | $0.20      | $0.60       |
| `digitalocean/nvidia-nemotron-3-super-120b`          | 256K    |       |           |       |       |       | $0.30      | $0.65       |
| `digitalocean/openai-gpt-4.1`                        | 1.0M    |       |           |       |       |       | $2         | $8          |
| `digitalocean/openai-gpt-4o`                         | 128K    |       |           |       |       |       | $3         | $10         |
| `digitalocean/openai-gpt-4o-mini`                    | 128K    |       |           |       |       |       | $0.15      | $0.60       |
| `digitalocean/openai-gpt-5`                          | 400K    |       |           |       |       |       | $1         | $10         |
| `digitalocean/openai-gpt-5-mini`                     | 400K    |       |           |       |       |       | $0.25      | $2          |
| `digitalocean/openai-gpt-5-nano`                     | 400K    |       |           |       |       |       | $0.05      | $0.40       |
| `digitalocean/openai-gpt-5.1-codex-max`              | 400K    |       |           |       |       |       | $1         | $10         |
| `digitalocean/openai-gpt-5.2`                        | 400K    |       |           |       |       |       | $2         | $14         |
| `digitalocean/openai-gpt-5.2-pro`                    | 400K    |       |           |       |       |       | $21        | $168        |
| `digitalocean/openai-gpt-5.3-codex`                  | 400K    |       |           |       |       |       | $2         | $14         |
| `digitalocean/openai-gpt-5.4`                        | 1.0M    |       |           |       |       |       | $3         | $15         |
| `digitalocean/openai-gpt-5.4-mini`                   | 400K    |       |           |       |       |       | $0.75      | $5          |
| `digitalocean/openai-gpt-5.4-nano`                   | 400K    |       |           |       |       |       | $0.20      | $1          |
| `digitalocean/openai-gpt-5.4-pro`                    | 400K    |       |           |       |       |       | $30        | $180        |
| `digitalocean/openai-gpt-5.5`                        | 1.0M    |       |           |       |       |       | $5         | $30         |
| `digitalocean/openai-gpt-image-1`                    | —       |       |           |       |       |       | $5         | $40         |
| `digitalocean/openai-gpt-image-1.5`                  | —       |       |           |       |       |       | $5         | $10         |
| `digitalocean/openai-gpt-image-2`                    | —       |       |           |       |       |       | —          | —           |
| `digitalocean/openai-gpt-oss-120b`                   | 131K    |       |           |       |       |       | $0.10      | $0.70       |
| `digitalocean/openai-gpt-oss-20b`                    | 131K    |       |           |       |       |       | $0.05      | $0.45       |
| `digitalocean/openai-o1`                             | 200K    |       |           |       |       |       | $15        | $60         |
| `digitalocean/openai-o3`                             | 200K    |       |           |       |       |       | $2         | $8          |
| `digitalocean/openai-o3-mini`                        | 200K    |       |           |       |       |       | $1         | $4          |
| `digitalocean/qwen-2.5-14b-instruct`                 | 131K    |       |           |       |       |       | —          | —           |
| `digitalocean/qwen3-coder-flash`                     | 262K    |       |           |       |       |       | $0.45      | $2          |
| `digitalocean/qwen3-embedding-0.6b`                  | 8K      |       |           |       |       |       | $0.04      | —           |
| `digitalocean/qwen3-tts-voicedesign`                 | 33K     |       |           |       |       |       | —          | —           |
| `digitalocean/qwen3.5-397b-a17b`                     | 262K    |       |           |       |       |       | $0.55      | $4          |
| `digitalocean/stable-diffusion-3.5-large`            | 256     |       |           |       |       |       | $0.08      | —           |
| `digitalocean/wan2-2-t2v-a14b`                       | 100     |       |           |       |       |       | $0.60      | —           |

## Advanced configuration

### Custom headers

```typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://inference.do-ai.run/v1",
    id: "digitalocean/alibaba-qwen3-32b",
    apiKey: process.env.DIGITALOCEAN_ACCESS_TOKEN,
    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
      ? "digitalocean/wan2-2-t2v-a14b"
      : "digitalocean/alibaba-qwen3-32b";
  }
});
```