@mastra/mcp-docs-server 1.1.26-alpha.8 → 1.1.27-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.docs/docs/agents/structured-output.md +22 -0
  2. package/.docs/docs/agents/supervisor-agents.md +18 -0
  3. package/.docs/docs/editor/overview.md +69 -0
  4. package/.docs/docs/memory/storage.md +1 -0
  5. package/.docs/docs/observability/tracing/exporters/langfuse.md +31 -0
  6. package/.docs/guides/deployment/netlify.md +16 -1
  7. package/.docs/guides/getting-started/next-js.md +0 -4
  8. package/.docs/guides/migrations/mastra-cloud.md +2 -2
  9. package/.docs/models/gateways/netlify.md +2 -3
  10. package/.docs/models/gateways/openrouter.md +3 -1
  11. package/.docs/models/index.md +1 -1
  12. package/.docs/models/providers/302ai.md +32 -1
  13. package/.docs/models/providers/berget.md +9 -12
  14. package/.docs/models/providers/cloudflare-workers-ai.md +2 -1
  15. package/.docs/models/providers/cortecs.md +2 -1
  16. package/.docs/models/providers/deepinfra.md +4 -1
  17. package/.docs/models/providers/digitalocean.md +116 -0
  18. package/.docs/models/providers/fireworks-ai.md +2 -1
  19. package/.docs/models/providers/helicone.md +1 -2
  20. package/.docs/models/providers/huggingface.md +2 -1
  21. package/.docs/models/providers/kilo.md +2 -1
  22. package/.docs/models/providers/kimi-for-coding.md +2 -1
  23. package/.docs/models/providers/llmgateway.md +59 -77
  24. package/.docs/models/providers/moonshotai-cn.md +3 -2
  25. package/.docs/models/providers/moonshotai.md +3 -2
  26. package/.docs/models/providers/nano-gpt.md +8 -1
  27. package/.docs/models/providers/nvidia.md +2 -1
  28. package/.docs/models/providers/ollama-cloud.md +2 -1
  29. package/.docs/models/providers/openai.md +1 -2
  30. package/.docs/models/providers/opencode-go.md +2 -1
  31. package/.docs/models/providers/opencode.md +4 -1
  32. package/.docs/models/providers/ovhcloud.md +4 -7
  33. package/.docs/models/providers/poe.md +2 -1
  34. package/.docs/models/providers/tencent-token-plan.md +71 -0
  35. package/.docs/models/providers/tencent-tokenhub.md +71 -0
  36. package/.docs/models/providers/wafer.ai.md +72 -0
  37. package/.docs/models/providers/zenmux.md +2 -1
  38. package/.docs/models/providers.md +4 -0
  39. package/.docs/reference/agents/generate.md +8 -0
  40. package/.docs/reference/client-js/workflows.md +12 -0
  41. package/.docs/reference/core/mastra-class.md +9 -1
  42. package/.docs/reference/deployer/cloudflare.md +14 -1
  43. package/.docs/reference/deployer/netlify.md +50 -2
  44. package/.docs/reference/harness/harness-class.md +72 -49
  45. package/.docs/reference/index.md +2 -0
  46. package/.docs/reference/observability/tracing/exporters/langfuse.md +2 -0
  47. package/.docs/reference/processors/prefill-error-handler.md +5 -5
  48. package/.docs/reference/storage/cloudflare-d1.md +42 -42
  49. package/.docs/reference/storage/redis.md +266 -0
  50. package/.docs/reference/streaming/agents/stream.md +8 -0
  51. package/.docs/reference/streaming/workflows/resumeStream.md +2 -0
  52. package/.docs/reference/tools/tavily.md +307 -0
  53. package/.docs/reference/workflows/run-methods/resume.md +24 -0
  54. package/.docs/reference/workflows/workflow-methods/foreach.md +14 -1
  55. package/CHANGELOG.md +71 -0
  56. package/package.json +10 -10
@@ -210,6 +210,28 @@ const response = await testAgent.generate('Tell me about TypeScript.', {
210
210
  })
211
211
  ```
212
212
 
213
+ If you want that structuring model to also see the current conversation history, set `useAgent: true` alongside `model`. Mastra will reuse the parent agent with the separate structuring model and attach read-only memory context when a thread is available.
214
+
215
+ ```typescript
216
+ const response = await testAgent.generate('Return my profile as structured data.', {
217
+ memory: {
218
+ thread: 'thread-123',
219
+ resource: 'user-123',
220
+ },
221
+ structuredOutput: {
222
+ schema: z.object({
223
+ favoriteColor: z.string(),
224
+ hometown: z.string(),
225
+ petName: z.string(),
226
+ }),
227
+ model: 'openai/gpt-5.4',
228
+ useAgent: true,
229
+ },
230
+ })
231
+ ```
232
+
233
+ Leave `useAgent` unset if you want the separate structuring model to work only from the current response and not inherit prior conversation memory.
234
+
213
235
  ### Multi-step approach with `prepareStep`
214
236
 
215
237
  For models that don't support tools and structured outputs together, you can use `prepareStep` to handle them in separate steps.
@@ -300,8 +300,26 @@ Success criteria:
300
300
  })
301
301
  ```
302
302
 
303
+ ## Sub-agent versioning
304
+
305
+ When using the [editor](https://mastra.ai/docs/editor/overview), you can control which stored version of each sub-agent the supervisor uses at runtime. Set version overrides on the Mastra instance or per invocation:
306
+
307
+ ```typescript
308
+ const result = await supervisor.generate('Research and write about AI safety', {
309
+ versions: {
310
+ agents: {
311
+ 'research-agent': { status: 'published' },
312
+ 'writing-agent': { versionId: 'draft-456' },
313
+ },
314
+ },
315
+ })
316
+ ```
317
+
318
+ Version overrides propagate automatically through delegation. See [Sub-agent versioning](https://mastra.ai/docs/editor/overview) for details on resolution order and server API usage.
319
+
303
320
  ## Related
304
321
 
322
+ - [Sub-agent versioning](https://mastra.ai/docs/editor/overview)
305
323
  - [Guide: Research coordinator](https://mastra.ai/guides/guide/research-coordinator)
306
324
  - [Agent.stream() reference](https://mastra.ai/reference/streaming/agents/stream)
307
325
  - [Agent.generate() reference](https://mastra.ai/reference/agents/generate)
@@ -214,6 +214,75 @@ curl http://localhost:4111/agents/support-agent?versionId=abc-123
214
214
 
215
215
  See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agents) for API methods.
216
216
 
217
+ ### Sub-agent versioning
218
+
219
+ When a [supervisor agent](https://mastra.ai/docs/agents/supervisor-agents) delegates to sub-agents, version overrides determine which stored version of each sub-agent to use instead of the code-defined default. This lets you iterate on sub-agent prompts and tools through the editor without redeploying the supervisor.
220
+
221
+ Set version overrides at three levels, with later levels taking priority:
222
+
223
+ 1. **Mastra instance config** — global defaults that apply to every `generate()` and `stream()` call.
224
+ 2. **Per-invocation options** — overrides passed directly to `generate()` or `stream()`.
225
+ 3. **Server request body** — overrides sent in the `versions` field of an API request.
226
+
227
+ Resolution order: **per-invocation > request body > Mastra instance defaults > code-defined agent**.
228
+
229
+ #### Mastra instance config
230
+
231
+ Set global defaults when creating the `Mastra` instance. Every supervisor call inherits these overrides:
232
+
233
+ ```typescript
234
+ import { Mastra } from '@mastra/core'
235
+ import { MastraEditor } from '@mastra/editor'
236
+
237
+ export const mastra = new Mastra({
238
+ agents: { supervisor, researchAgent, writerAgent },
239
+ editor: new MastraEditor(),
240
+ versions: {
241
+ agents: {
242
+ 'research-agent': { status: 'published' },
243
+ 'writer-agent': { versionId: 'abc-123' },
244
+ },
245
+ },
246
+ })
247
+ ```
248
+
249
+ #### Per-invocation overrides
250
+
251
+ Override versions for a single call to `generate()` or `stream()`. These take priority over Mastra instance defaults:
252
+
253
+ ```typescript
254
+ const result = await supervisor.generate('Research and write an article about AI safety', {
255
+ versions: {
256
+ agents: {
257
+ 'research-agent': { versionId: 'draft-456' },
258
+ },
259
+ },
260
+ })
261
+ ```
262
+
263
+ #### Server request body
264
+
265
+ When calling agents through the Mastra server, pass version overrides in the request body:
266
+
267
+ ```bash
268
+ curl -X POST http://localhost:4111/agents/supervisor/generate \
269
+ -H "Content-Type: application/json" \
270
+ -d '{
271
+ "messages": [{ "role": "user", "content": "Research AI safety" }],
272
+ "versions": {
273
+ "agents": {
274
+ "research-agent": { "versionId": "draft-456" }
275
+ }
276
+ }
277
+ }'
278
+ ```
279
+
280
+ #### How propagation works
281
+
282
+ Version overrides propagate automatically through sub-agent delegation via `requestContext`. When a supervisor delegates to a sub-agent, the framework checks if a version override exists for that sub-agent's ID. If one is found, it resolves the stored version from the editor and uses it instead of the code-defined default.
283
+
284
+ If version resolution fails (for example, when the editor is not configured or the version ID doesn't exist), the framework logs a warning and falls back to the code-defined agent.
285
+
217
286
  ## Next steps
218
287
 
219
288
  - Set up [prompts](https://mastra.ai/docs/editor/prompts) to build reusable instruction templates.
@@ -34,6 +34,7 @@ Each provider page includes installation instructions, configuration parameters,
34
34
  - [PostgreSQL](https://mastra.ai/reference/storage/postgresql)
35
35
  - [MongoDB](https://mastra.ai/reference/storage/mongodb)
36
36
  - [Upstash](https://mastra.ai/reference/storage/upstash)
37
+ - [Redis](https://mastra.ai/reference/storage/redis)
37
38
  - [Cloudflare D1](https://mastra.ai/reference/storage/cloudflare-d1)
38
39
  - [Cloudflare KV & Durable Objects](https://mastra.ai/reference/storage/cloudflare)
39
40
  - [Convex](https://mastra.ai/reference/storage/convex)
@@ -122,6 +122,35 @@ new LangfuseExporter({
122
122
  })
123
123
  ```
124
124
 
125
+ #### Batch Tuning for High-Volume Traces
126
+
127
+ For self-hosted Langfuse deployments or streamed runs that produce many spans per second, you can tune the OTEL batch size and flush interval to reduce request pressure on the Langfuse ingestion endpoint:
128
+
129
+ ```typescript
130
+ new LangfuseExporter({
131
+ publicKey: process.env.LANGFUSE_PUBLIC_KEY!,
132
+ secretKey: process.env.LANGFUSE_SECRET_KEY!,
133
+ flushAt: 500, // Maximum spans per OTEL export batch
134
+ flushInterval: 20, // Maximum seconds between flushes
135
+ })
136
+ ```
137
+
138
+ To suppress high-volume span types entirely (for example `MODEL_CHUNK` spans from streamed responses), use the observability-level [`excludeSpanTypes` option](https://mastra.ai/reference/observability/tracing/span-filtering) rather than configuring the exporter:
139
+
140
+ ```typescript
141
+ import { SpanType } from '@mastra/core/observability'
142
+
143
+ new Observability({
144
+ configs: {
145
+ langfuse: {
146
+ serviceName: 'my-service',
147
+ exporters: [new LangfuseExporter()],
148
+ excludeSpanTypes: [SpanType.MODEL_CHUNK],
149
+ },
150
+ },
151
+ })
152
+ ```
153
+
125
154
  ### Complete Configuration
126
155
 
127
156
  ```typescript
@@ -133,6 +162,8 @@ new LangfuseExporter({
133
162
  // Optional settings
134
163
  baseUrl: process.env.LANGFUSE_BASE_URL, // Default: https://cloud.langfuse.com
135
164
  realtime: process.env.NODE_ENV === 'development', // Dynamic mode selection
165
+ flushAt: 500, // Maximum spans per OTEL export batch
166
+ flushInterval: 20, // Maximum seconds between flushes
136
167
  logLevel: 'info', // Diagnostic logging: debug | info | warn | error
137
168
 
138
169
  // Langfuse-specific settings
@@ -1,6 +1,6 @@
1
1
  # Deploy Mastra to Netlify
2
2
 
3
- Use `@mastra/deployer-netlify` to deploy your Mastra server as serverless functions on Netlify. The deployer bundles your code and generates a `.netlify` directory conforming to Netlify's [frameworks API](https://docs.netlify.com/build/frameworks/frameworks-api/#netlifyv1functions), ready to deploy.
3
+ Use `@mastra/deployer-netlify` to deploy your Mastra server on Netlify. The deployer bundles your code and generates a `.netlify` directory conforming to Netlify's [Frameworks API](https://docs.netlify.com/build/frameworks/frameworks-api/), ready to deploy. You can deploy as serverless functions (default) or as [edge functions](https://docs.netlify.com/build/edge-functions/overview/) for lower latency and longer execution times.
4
4
 
5
5
  > **Info:** This guide covers deploying the [Mastra server](https://mastra.ai/docs/server/mastra-server). If you're using a [server adapter](https://mastra.ai/docs/server/server-adapters) or [web framework](https://mastra.ai/docs/deployment/web-framework), deploy the way you normally would for that framework.
6
6
 
@@ -49,6 +49,21 @@ export const mastra = new Mastra({
49
49
  })
50
50
  ```
51
51
 
52
+ To deploy as edge functions instead, pass `{ target: 'edge' }`:
53
+
54
+ ```typescript
55
+ import { Mastra } from '@mastra/core'
56
+ import { NetlifyDeployer } from '@mastra/deployer-netlify'
57
+
58
+ export const mastra = new Mastra({
59
+ deployer: new NetlifyDeployer({
60
+ target: 'edge',
61
+ }),
62
+ })
63
+ ```
64
+
65
+ Edge functions run on Deno at the edge closest to your users. They have no hard execution timeout (only a CPU time limit), making them a better fit for longer-running AI workflows. See the [constructor options](https://mastra.ai/reference/deployer/netlify) for details.
66
+
52
67
  Create a `netlify.toml` file with the following contents in your project root:
53
68
 
54
69
  ```toml
@@ -4,10 +4,6 @@ In this guide, you'll build a tool-calling AI agent using Mastra, then connect i
4
4
 
5
5
  You'll use [AI SDK UI](https://ai-sdk.dev/docs/ai-sdk-ui/overview) and [AI Elements](https://ai-sdk.dev/elements) to create a beautiful, interactive chat experience.
6
6
 
7
- ![Screenshot of a chat-style web app displaying a completed \"weatherTool\" tool call, answering \"What is the weather in London?\" with a JSON result. A message suggests offering activity ideas, and a text input field is at the bottom.](/assets/images/nextjs-quickstart-11fce4f78d172367bb97a14f132d701f.png)
8
-
9
- What you'll build: an agent that can call a weather tool, display the JSON result, stream a weather summary in the chat UI, and persist conversation history across reloads.
10
-
11
7
  ## Before you begin
12
8
 
13
9
  - You'll need an API key from a supported [model provider](https://mastra.ai/models). If you don't have a preference, use [OpenAI](https://mastra.ai/models/providers/openai).
@@ -109,10 +109,10 @@ If you prefer to work from the command line, or need to script the export, you c
109
109
 
110
110
  3. Export the database to a SQL dump.
111
111
 
112
- Set the credentials provided by support (or use the dashboard values if you already copied them earlier) as environment variables, then dump the database to a local file:
112
+ Set the credentials provided by support (or use the dashboard values if you already copied them earlier) as environment variables, then dump the database to a local file. If you copied the URL from the dashboard, swap the `libsql://` scheme for `https://` — the Turso CLI expects the HTTPS form when passing the URL with an auth token.
113
113
 
114
114
  ```bash
115
- export MASTRA_STORAGE_URL="libsql://<db-name>-<org>.turso.io"
115
+ export MASTRA_STORAGE_URL="https://<db-name>-<org>.turso.io"
116
116
  export MASTRA_STORAGE_AUTH_TOKEN="<token-from-dashboard-or-support>"
117
117
 
118
118
  turso db shell "$MASTRA_STORAGE_URL?authToken=$MASTRA_STORAGE_AUTH_TOKEN" ".dump" > mastra-cloud-dump.sql
@@ -1,6 +1,6 @@
1
1
  # Netlify
2
2
 
3
- Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 63 models through Mastra's model router.
3
+ Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 62 models through Mastra's model router.
4
4
 
5
5
  Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
6
6
 
@@ -13,7 +13,7 @@ const agent = new Agent({
13
13
  id: "my-agent",
14
14
  name: "My Agent",
15
15
  instructions: "You are a helpful assistant",
16
- model: "netlify/anthropic/claude-3-haiku-20240307"
16
+ model: "netlify/anthropic/claude-haiku-4-5"
17
17
  });
18
18
  ```
19
19
 
@@ -35,7 +35,6 @@ ANTHROPIC_API_KEY=ant-...
35
35
 
36
36
  | Model |
37
37
  | ------------------------------------------- |
38
- | `anthropic/claude-3-haiku-20240307` |
39
38
  | `anthropic/claude-haiku-4-5` |
40
39
  | `anthropic/claude-haiku-4-5-20251001` |
41
40
  | `anthropic/claude-opus-4-1-20250805` |
@@ -1,6 +1,6 @@
1
1
  # ![OpenRouter logo](https://models.dev/logos/openrouter.svg)OpenRouter
2
2
 
3
- OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 170 models through Mastra's model router.
3
+ OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 172 models through Mastra's model router.
4
4
 
5
5
  Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
6
6
 
@@ -41,6 +41,7 @@ ANTHROPIC_API_KEY=ant-...
41
41
  | `anthropic/claude-opus-4.1` |
42
42
  | `anthropic/claude-opus-4.5` |
43
43
  | `anthropic/claude-opus-4.6` |
44
+ | `anthropic/claude-opus-4.7` |
44
45
  | `anthropic/claude-sonnet-4` |
45
46
  | `anthropic/claude-sonnet-4.5` |
46
47
  | `anthropic/claude-sonnet-4.6` |
@@ -116,6 +117,7 @@ ANTHROPIC_API_KEY=ant-...
116
117
  | `moonshotai/kimi-k2-0905:exacto` |
117
118
  | `moonshotai/kimi-k2-thinking` |
118
119
  | `moonshotai/kimi-k2.5` |
120
+ | `moonshotai/kimi-k2.6` |
119
121
  | `nousresearch/hermes-3-llama-3.1-405b:free` |
120
122
  | `nousresearch/hermes-4-405b` |
121
123
  | `nousresearch/hermes-4-70b` |
@@ -1,6 +1,6 @@
1
1
  # Model Providers
2
2
 
3
- Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3608 models from 100 providers through a single API.
3
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3690 models from 104 providers through a single API.
4
4
 
5
5
  ## Features
6
6
 
@@ -1,6 +1,6 @@
1
1
  # ![302.AI logo](https://models.dev/logos/302ai.svg)302.AI
2
2
 
3
- Access 64 302.AI models through Mastra's model router. Authentication is handled automatically using the `302AI_API_KEY` environment variable.
3
+ Access 95 302.AI models through Mastra's model router. Authentication is handled automatically using the `302AI_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [302.AI documentation](https://doc.302.ai).
6
6
 
@@ -35,13 +35,25 @@ for await (const chunk of stream) {
35
35
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
36
36
  | --------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
37
37
  | `302ai/chatgpt-4o-latest` | 128K | | | | | | $5 | $15 |
38
+ | `302ai/claude-3-5-haiku-20241022` | 200K | | | | | | $0.80 | $4 |
39
+ | `302ai/claude-3-5-haiku-latest` | 200K | | | | | | $0.80 | $4 |
40
+ | `302ai/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
38
41
  | `302ai/claude-haiku-4-5-20251001` | 200K | | | | | | $1 | $5 |
39
42
  | `302ai/claude-opus-4-1-20250805` | 200K | | | | | | $15 | $75 |
40
43
  | `302ai/claude-opus-4-1-20250805-thinking` | 200K | | | | | | $15 | $75 |
44
+ | `302ai/claude-opus-4-20250514` | 200K | | | | | | $15 | $75 |
45
+ | `302ai/claude-opus-4-5` | 200K | | | | | | $5 | $25 |
41
46
  | `302ai/claude-opus-4-5-20251101` | 200K | | | | | | $5 | $25 |
42
47
  | `302ai/claude-opus-4-5-20251101-thinking` | 200K | | | | | | $5 | $25 |
48
+ | `302ai/claude-opus-4-6` | 1.0M | | | | | | $5 | $25 |
49
+ | `302ai/claude-opus-4-6-thinking` | 1.0M | | | | | | $5 | $25 |
50
+ | `302ai/claude-opus-4-7` | 200K | | | | | | $5 | $25 |
51
+ | `302ai/claude-sonnet-4-20250514` | 200K | | | | | | $3 | $15 |
52
+ | `302ai/claude-sonnet-4-5` | 200K | | | | | | $3 | $15 |
43
53
  | `302ai/claude-sonnet-4-5-20250929` | 200K | | | | | | $3 | $15 |
44
54
  | `302ai/claude-sonnet-4-5-20250929-thinking` | 200K | | | | | | $3 | $15 |
55
+ | `302ai/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 |
56
+ | `302ai/claude-sonnet-4-6-thinking` | 1.0M | | | | | | $3 | $15 |
45
57
  | `302ai/deepseek-chat` | 128K | | | | | | $0.29 | $0.43 |
46
58
  | `302ai/deepseek-reasoner` | 128K | | | | | | $0.29 | $0.43 |
47
59
  | `302ai/deepseek-v3.2` | 128K | | | | | | $0.29 | $0.43 |
@@ -60,11 +72,21 @@ for await (const chunk of stream) {
60
72
  | `302ai/gemini-3-flash-preview` | 1.0M | | | | | | $0.50 | $3 |
61
73
  | `302ai/gemini-3-pro-image-preview` | 33K | | | | | | $2 | $120 |
62
74
  | `302ai/gemini-3-pro-preview` | 1.0M | | | | | | $2 | $12 |
75
+ | `302ai/gemini-3.1-flash-image-preview` | 131K | | | | | | $0.50 | $60 |
63
76
  | `302ai/glm-4.5` | 128K | | | | | | $0.29 | $1 |
77
+ | `302ai/glm-4.5-air` | 128K | | | | | | $0.11 | $0.29 |
78
+ | `302ai/glm-4.5-airx` | 128K | | | | | | $0.57 | $2 |
79
+ | `302ai/glm-4.5-x` | 128K | | | | | | $1 | $2 |
64
80
  | `302ai/glm-4.5v` | 64K | | | | | | $0.29 | $0.86 |
65
81
  | `302ai/glm-4.6` | 200K | | | | | | $0.29 | $1 |
66
82
  | `302ai/glm-4.6v` | 128K | | | | | | $0.14 | $0.43 |
67
83
  | `302ai/glm-4.7` | 200K | | | | | | $0.29 | $1 |
84
+ | `302ai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.43 |
85
+ | `302ai/glm-5` | 200K | | | | | | $0.60 | $3 |
86
+ | `302ai/glm-5-turbo` | 200K | | | | | | $0.72 | $3 |
87
+ | `302ai/glm-5.1` | 200K | | | | | | $0.86 | $4 |
88
+ | `302ai/glm-5v-turbo` | 200K | | | | | | $0.72 | $3 |
89
+ | `302ai/glm-for-coding` | 200K | | | | | | $0.09 | $0.34 |
68
90
  | `302ai/gpt-4.1` | 1.0M | | | | | | $2 | $8 |
69
91
  | `302ai/gpt-4.1-mini` | 1.0M | | | | | | $0.40 | $2 |
70
92
  | `302ai/gpt-4.1-nano` | 1.0M | | | | | | $0.10 | $0.40 |
@@ -77,17 +99,26 @@ for await (const chunk of stream) {
77
99
  | `302ai/gpt-5.1-chat-latest` | 128K | | | | | | $1 | $10 |
78
100
  | `302ai/gpt-5.2` | 400K | | | | | | $2 | $14 |
79
101
  | `302ai/gpt-5.2-chat-latest` | 128K | | | | | | $2 | $14 |
102
+ | `302ai/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
103
+ | `302ai/gpt-5.4-mini-2026-03-17` | 400K | | | | | | $0.75 | $5 |
104
+ | `302ai/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
105
+ | `302ai/gpt-5.4-nano-2026-03-17` | 400K | | | | | | $0.20 | $1 |
80
106
  | `302ai/grok-4-1-fast-non-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
81
107
  | `302ai/grok-4-1-fast-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
82
108
  | `302ai/grok-4-fast-non-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
83
109
  | `302ai/grok-4-fast-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
84
110
  | `302ai/grok-4.1` | 200K | | | | | | $2 | $10 |
111
+ | `302ai/grok-4.20-beta-0309-non-reasoning` | 2.0M | | | | | | $2 | $6 |
112
+ | `302ai/grok-4.20-beta-0309-reasoning` | 2.0M | | | | | | $2 | $6 |
113
+ | `302ai/grok-4.20-multi-agent-beta-0309` | 2.0M | | | | | | $2 | $6 |
85
114
  | `302ai/kimi-k2-0905-preview` | 262K | | | | | | $0.63 | $3 |
86
115
  | `302ai/kimi-k2-thinking` | 262K | | | | | | $0.57 | $2 |
87
116
  | `302ai/kimi-k2-thinking-turbo` | 262K | | | | | | $1 | $9 |
88
117
  | `302ai/MiniMax-M1` | 1.0M | | | | | | $0.13 | $1 |
89
118
  | `302ai/MiniMax-M2` | 1.0M | | | | | | $0.33 | $1 |
90
119
  | `302ai/MiniMax-M2.1` | 1.0M | | | | | | $0.30 | $1 |
120
+ | `302ai/MiniMax-M2.7` | 205K | | | | | | $0.30 | $1 |
121
+ | `302ai/MiniMax-M2.7-highspeed` | 205K | | | | | | $0.60 | $5 |
91
122
  | `302ai/ministral-14b-2512` | 128K | | | | | | $0.33 | $0.33 |
92
123
  | `302ai/mistral-large-2512` | 128K | | | | | | $1 | $3 |
93
124
  | `302ai/qwen-flash` | 1.0M | | | | | | $0.02 | $0.22 |
@@ -1,6 +1,6 @@
1
1
  # ![Berget.AI logo](https://models.dev/logos/berget.svg)Berget.AI
2
2
 
3
- Access 8 Berget.AI models through Mastra's model router. Authentication is handled automatically using the `BERGET_API_KEY` environment variable.
3
+ Access 5 Berget.AI models through Mastra's model router. Authentication is handled automatically using the `BERGET_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Berget.AI documentation](https://api.berget.ai).
6
6
 
@@ -15,7 +15,7 @@ const agent = new Agent({
15
15
  id: "my-agent",
16
16
  name: "My Agent",
17
17
  instructions: "You are a helpful assistant",
18
- model: "berget/BAAI/bge-reranker-v2-m3"
18
+ model: "berget/google/gemma-4-31B-it"
19
19
  });
20
20
 
21
21
  // Generate a response
@@ -34,14 +34,11 @@ for await (const chunk of stream) {
34
34
 
35
35
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
36
36
  | ------------------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
37
- | `berget/BAAI/bge-reranker-v2-m3` | 512 | | | | | | $0.10 | $0.10 |
38
- | `berget/intfloat/multilingual-e5-large` | 512 | | | | | | $0.02 | |
39
- | `berget/intfloat/multilingual-e5-large-instruct` | 512 | | | | | | $0.02 | |
40
- | `berget/KBLab/kb-whisper-large` | 480K | | | | | | $3 | $3 |
41
- | `berget/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.90 | $0.90 |
42
- | `berget/mistralai/Mistral-Small-3.2-24B-Instruct-2506` | 32K | | | | | | $0.30 | $0.30 |
43
- | `berget/openai/gpt-oss-120b` | 128K | | | | | | $0.30 | $0.90 |
44
- | `berget/zai-org/GLM-4.7` | 128K | | | | | | $0.70 | $2 |
37
+ | `berget/google/gemma-4-31B-it` | 128K | | | | | | $0.28 | $0.55 |
38
+ | `berget/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.99 | $0.99 |
39
+ | `berget/mistralai/Mistral-Small-3.2-24B-Instruct-2506` | 32K | | | | | | $0.33 | $0.33 |
40
+ | `berget/openai/gpt-oss-120b` | 128K | | | | | | $0.44 | $0.99 |
41
+ | `berget/zai-org/GLM-4.7` | 128K | | | | | | $0.77 | $3 |
45
42
 
46
43
  ## Advanced configuration
47
44
 
@@ -53,7 +50,7 @@ const agent = new Agent({
53
50
  name: "custom-agent",
54
51
  model: {
55
52
  url: "https://api.berget.ai/v1",
56
- id: "berget/BAAI/bge-reranker-v2-m3",
53
+ id: "berget/google/gemma-4-31B-it",
57
54
  apiKey: process.env.BERGET_API_KEY,
58
55
  headers: {
59
56
  "X-Custom-Header": "value"
@@ -72,7 +69,7 @@ const agent = new Agent({
72
69
  const useAdvanced = requestContext.task === "complex";
73
70
  return useAdvanced
74
71
  ? "berget/zai-org/GLM-4.7"
75
- : "berget/BAAI/bge-reranker-v2-m3";
72
+ : "berget/google/gemma-4-31B-it";
76
73
  }
77
74
  });
78
75
  ```
@@ -1,6 +1,6 @@
1
1
  # ![Cloudflare Workers AI logo](https://models.dev/logos/cloudflare-workers-ai.svg)Cloudflare Workers AI
2
2
 
3
- Access 7 Cloudflare Workers AI models through Mastra's model router. Authentication is handled automatically using the `CLOUDFLARE_API_KEY` environment variable. Configure `CLOUDFLARE_ACCOUNT_ID` as well.
3
+ Access 8 Cloudflare Workers AI models through Mastra's model router. Authentication is handled automatically using the `CLOUDFLARE_API_KEY` environment variable. Configure `CLOUDFLARE_ACCOUNT_ID` as well.
4
4
 
5
5
  Learn more in the [Cloudflare Workers AI documentation](https://developers.cloudflare.com/workers-ai/models/).
6
6
 
@@ -38,6 +38,7 @@ for await (const chunk of stream) {
38
38
  | `cloudflare-workers-ai/@cf/google/gemma-4-26b-a4b-it` | 256K | | | | | | $0.10 | $0.30 |
39
39
  | `cloudflare-workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct` | 128K | | | | | | $0.27 | $0.85 |
40
40
  | `cloudflare-workers-ai/@cf/moonshotai/kimi-k2.5` | 256K | | | | | | $0.60 | $3 |
41
+ | `cloudflare-workers-ai/@cf/moonshotai/kimi-k2.6` | 256K | | | | | | $0.95 | $4 |
41
42
  | `cloudflare-workers-ai/@cf/nvidia/nemotron-3-120b-a12b` | 256K | | | | | | $0.50 | $2 |
42
43
  | `cloudflare-workers-ai/@cf/openai/gpt-oss-120b` | 128K | | | | | | $0.35 | $0.75 |
43
44
  | `cloudflare-workers-ai/@cf/openai/gpt-oss-20b` | 128K | | | | | | $0.20 | $0.30 |
@@ -1,6 +1,6 @@
1
1
  # ![Cortecs logo](https://models.dev/logos/cortecs.svg)Cortecs
2
2
 
3
- Access 32 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.
3
+ Access 33 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Cortecs documentation](https://cortecs.ai).
6
6
 
@@ -39,6 +39,7 @@ for await (const chunk of stream) {
39
39
  | `cortecs/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
40
40
  | `cortecs/claude-opus4-5` | 200K | | | | | | $6 | $30 |
41
41
  | `cortecs/claude-opus4-6` | 1.0M | | | | | | $6 | $30 |
42
+ | `cortecs/claude-opus4-7` | 1.0M | | | | | | $6 | $28 |
42
43
  | `cortecs/claude-sonnet-4` | 200K | | | | | | $3 | $17 |
43
44
  | `cortecs/deepseek-v3-0324` | 128K | | | | | | $0.55 | $2 |
44
45
  | `cortecs/devstral-2512` | 262K | | | | | | — | — |
@@ -1,6 +1,6 @@
1
1
  # ![Deep Infra logo](https://models.dev/logos/deepinfra.svg)Deep Infra
2
2
 
3
- Access 28 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
3
+ Access 31 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Deep Infra documentation](https://deepinfra.com/models).
6
6
 
@@ -54,6 +54,9 @@ for await (const chunk of stream) {
54
54
  | `deepinfra/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.14 |
55
55
  | `deepinfra/Qwen/Qwen3-Coder-480B-A35B-Instruct` | 262K | | | | | | $0.40 | $2 |
56
56
  | `deepinfra/Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo` | 262K | | | | | | $0.30 | $1 |
57
+ | `deepinfra/Qwen/Qwen3.5-35B-A3B` | 262K | | | | | | $0.20 | $0.95 |
58
+ | `deepinfra/Qwen/Qwen3.5-397B-A17B` | 262K | | | | | | $0.54 | $3 |
59
+ | `deepinfra/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.20 | $1 |
57
60
  | `deepinfra/zai-org/GLM-4.6` | 205K | | | | | | $0.43 | $2 |
58
61
  | `deepinfra/zai-org/GLM-4.6V` | 205K | | | | | | $0.30 | $0.90 |
59
62
  | `deepinfra/zai-org/GLM-4.7` | 203K | | | | | | $0.43 | $2 |
@@ -0,0 +1,116 @@
1
+ # ![DigitalOcean logo](https://models.dev/logos/digitalocean.svg)DigitalOcean
2
+
3
+ Access 46 DigitalOcean models through Mastra's model router. Authentication is handled automatically using the `DIGITALOCEAN_ACCESS_TOKEN` environment variable.
4
+
5
+ Learn more in the [DigitalOcean documentation](https://docs.digitalocean.com/products/gradient-ai-platform/details/models/).
6
+
7
+ ```bash
8
+ DIGITALOCEAN_ACCESS_TOKEN=your-api-token
9
+ ```
10
+
11
+ ```typescript
12
+ import { Agent } from "@mastra/core/agent";
13
+
14
+ const agent = new Agent({
15
+ id: "my-agent",
16
+ name: "My Agent",
17
+ instructions: "You are a helpful assistant",
18
+ model: "digitalocean/alibaba-qwen3-32b"
19
+ });
20
+
21
+ // Generate a response
22
+ const response = await agent.generate("Hello!");
23
+
24
+ // Stream a response
25
+ const stream = await agent.stream("Tell me a story");
26
+ for await (const chunk of stream) {
27
+ console.log(chunk);
28
+ }
29
+ ```
30
+
31
+ > **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.
32
+
33
+ ## Models
34
+
35
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
36
+ | ---------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
37
+ | `digitalocean/alibaba-qwen3-32b` | 131K | | | | | | $0.25 | $0.55 |
38
+ | `digitalocean/all-mini-lm-l6-v2` | 256 | | | | | | $0.01 | — |
39
+ | `digitalocean/anthropic-claude-4.1-opus` | 200K | | | | | | $15 | $75 |
40
+ | `digitalocean/anthropic-claude-4.5-sonnet` | 1.0M | | | | | | $3 | $15 |
41
+ | `digitalocean/anthropic-claude-4.6-sonnet` | 1.0M | | | | | | $3 | $15 |
42
+ | `digitalocean/anthropic-claude-haiku-4.5` | 200K | | | | | | $1 | $5 |
43
+ | `digitalocean/anthropic-claude-opus-4` | 200K | | | | | | $15 | $75 |
44
+ | `digitalocean/anthropic-claude-opus-4.5` | 200K | | | | | | $5 | $25 |
45
+ | `digitalocean/anthropic-claude-opus-4.6` | 1.0M | | | | | | $5 | $25 |
46
+ | `digitalocean/anthropic-claude-opus-4.7` | 1.0M | | | | | | $5 | $25 |
47
+ | `digitalocean/anthropic-claude-sonnet-4` | 1.0M | | | | | | $3 | $15 |
48
+ | `digitalocean/arcee-trinity-large-thinking` | 256K | | | | | | $0.25 | $0.90 |
49
+ | `digitalocean/deepseek-r1-distill-llama-70b` | 131K | | | | | | $0.99 | $0.99 |
50
+ | `digitalocean/fal-ai/elevenlabs/tts/multilingual-v2` | — | | | | | | — | — |
51
+ | `digitalocean/fal-ai/fast-sdxl` | — | | | | | | — | — |
52
+ | `digitalocean/fal-ai/flux/schnell` | — | | | | | | — | — |
53
+ | `digitalocean/fal-ai/stable-audio-25/text-to-audio` | — | | | | | | — | — |
54
+ | `digitalocean/glm-5` | 203K | | | | | | $1 | $3 |
55
+ | `digitalocean/gte-large-en-v1.5` | 8K | | | | | | $0.09 | — |
56
+ | `digitalocean/kimi-k2.5` | 262K | | | | | | $0.50 | $3 |
57
+ | `digitalocean/llama3.3-70b-instruct` | 128K | | | | | | $0.65 | $0.65 |
58
+ | `digitalocean/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
59
+ | `digitalocean/multi-qa-mpnet-base-dot-v1` | 512 | | | | | | $0.01 | — |
60
+ | `digitalocean/nvidia-nemotron-3-super-120b` | 256K | | | | | | $0.30 | $0.65 |
61
+ | `digitalocean/openai-gpt-4.1` | 1.0M | | | | | | $2 | $8 |
62
+ | `digitalocean/openai-gpt-4o` | 128K | | | | | | $3 | $10 |
63
+ | `digitalocean/openai-gpt-4o-mini` | 128K | | | | | | $0.15 | $0.60 |
64
+ | `digitalocean/openai-gpt-5` | 400K | | | | | | $1 | $10 |
65
+ | `digitalocean/openai-gpt-5-2-pro` | 400K | | | | | | $21 | $168 |
66
+ | `digitalocean/openai-gpt-5-mini` | 400K | | | | | | $0.25 | $2 |
67
+ | `digitalocean/openai-gpt-5-nano` | 400K | | | | | | $0.05 | $0.40 |
68
+ | `digitalocean/openai-gpt-5.1-codex-max` | 400K | | | | | | $1 | $10 |
69
+ | `digitalocean/openai-gpt-5.2` | 400K | | | | | | $2 | $14 |
70
+ | `digitalocean/openai-gpt-5.3-codex` | 400K | | | | | | $2 | $14 |
71
+ | `digitalocean/openai-gpt-5.4` | 1.0M | | | | | | $3 | $15 |
72
+ | `digitalocean/openai-gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
73
+ | `digitalocean/openai-gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
74
+ | `digitalocean/openai-gpt-5.4-pro` | 400K | | | | | | $30 | $180 |
75
+ | `digitalocean/openai-gpt-image-1` | — | | | | | | $5 | $40 |
76
+ | `digitalocean/openai-gpt-image-1.5` | — | | | | | | $5 | $10 |
77
+ | `digitalocean/openai-gpt-oss-120b` | 131K | | | | | | $0.10 | $0.70 |
78
+ | `digitalocean/openai-gpt-oss-20b` | 131K | | | | | | $0.05 | $0.45 |
79
+ | `digitalocean/openai-o1` | 200K | | | | | | $15 | $60 |
80
+ | `digitalocean/openai-o3` | 200K | | | | | | $2 | $8 |
81
+ | `digitalocean/openai-o3-mini` | 200K | | | | | | $1 | $4 |
82
+ | `digitalocean/qwen3-embedding-0.6b` | 8K | | | | | | $0.04 | — |
83
+
84
+ ## Advanced configuration
85
+
86
+ ### Custom headers
87
+
88
+ ```typescript
89
+ const agent = new Agent({
90
+ id: "custom-agent",
91
+ name: "custom-agent",
92
+ model: {
93
+ url: "https://inference.do-ai.run/v1",
94
+ id: "digitalocean/alibaba-qwen3-32b",
95
+ apiKey: process.env.DIGITALOCEAN_ACCESS_TOKEN,
96
+ headers: {
97
+ "X-Custom-Header": "value"
98
+ }
99
+ }
100
+ });
101
+ ```
102
+
103
+ ### Dynamic model selection
104
+
105
+ ```typescript
106
+ const agent = new Agent({
107
+ id: "dynamic-agent",
108
+ name: "Dynamic Agent",
109
+ model: ({ requestContext }) => {
110
+ const useAdvanced = requestContext.task === "complex";
111
+ return useAdvanced
112
+ ? "digitalocean/qwen3-embedding-0.6b"
113
+ : "digitalocean/alibaba-qwen3-32b";
114
+ }
115
+ });
116
+ ```