@mastra/mcp-docs-server 1.1.17-alpha.7 → 1.1.17

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 (39) hide show
  1. package/.docs/docs/evals/built-in-scorers.md +1 -0
  2. package/.docs/docs/memory/observational-memory.md +49 -4
  3. package/.docs/docs/server/mastra-client.md +17 -0
  4. package/.docs/docs/server/server-adapters.md +15 -1
  5. package/.docs/models/gateways/openrouter.md +1 -1
  6. package/.docs/models/index.md +1 -1
  7. package/.docs/models/providers/bailing.md +1 -1
  8. package/.docs/models/providers/cloudflare-workers-ai.md +4 -3
  9. package/.docs/models/providers/firmware.md +2 -2
  10. package/.docs/models/providers/friendli.md +1 -1
  11. package/.docs/models/providers/github-models.md +1 -1
  12. package/.docs/models/providers/google.md +7 -2
  13. package/.docs/models/providers/groq.md +24 -16
  14. package/.docs/models/providers/huggingface.md +1 -1
  15. package/.docs/models/providers/llmgateway.md +269 -0
  16. package/.docs/models/providers/mistral.md +3 -2
  17. package/.docs/models/providers/nano-gpt.md +3 -1
  18. package/.docs/models/providers/openai.md +2 -1
  19. package/.docs/models/providers/poe.md +3 -1
  20. package/.docs/models/providers/zai-coding-plan.md +3 -2
  21. package/.docs/models/providers/zhipuai-coding-plan.md +3 -2
  22. package/.docs/models/providers.md +1 -0
  23. package/.docs/reference/ai-sdk/handle-chat-stream.md +2 -0
  24. package/.docs/reference/client-js/agents.md +11 -6
  25. package/.docs/reference/client-js/mastra-client.md +1 -1
  26. package/.docs/reference/client-js/memory.md +1 -1
  27. package/.docs/reference/configuration.md +24 -0
  28. package/.docs/reference/core/mastra-model-gateway.md +2 -0
  29. package/.docs/reference/deployer/cloudflare.md +31 -1
  30. package/.docs/reference/evals/run-evals.md +78 -3
  31. package/.docs/reference/evals/scorer-utils.md +188 -0
  32. package/.docs/reference/evals/trajectory-accuracy.md +627 -0
  33. package/.docs/reference/index.md +1 -2
  34. package/.docs/reference/logging/pino-logger.md +58 -0
  35. package/.docs/reference/memory/observational-memory.md +32 -6
  36. package/CHANGELOG.md +44 -0
  37. package/package.json +6 -6
  38. package/.docs/reference/core/getStoredAgentById.md +0 -87
  39. package/.docs/reference/core/listStoredAgents.md +0 -91
@@ -0,0 +1,269 @@
1
+ # ![LLM Gateway logo](https://models.dev/logos/llmgateway.svg)LLM Gateway
2
+
3
+ Access 199 LLM Gateway models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
4
+
5
+ Learn more in the [LLM Gateway documentation](https://llmgateway.io/docs).
6
+
7
+ ```bash
8
+ LLMGATEWAY_API_KEY=your-api-key
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: "llmgateway/auto"
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 [LLM Gateway documentation](https://llmgateway.io/docs) for details.
32
+
33
+ ## Models
34
+
35
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
36
+ | -------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
37
+ | `llmgateway/auto` | 128K | | | | | | — | — |
38
+ | `llmgateway/claude-3-5-sonnet` | 200K | | | | | | $3 | $15 |
39
+ | `llmgateway/claude-3-7-sonnet` | 200K | | | | | | $3 | $15 |
40
+ | `llmgateway/claude-3-7-sonnet-20250219` | 200K | | | | | | $3 | $15 |
41
+ | `llmgateway/claude-3-haiku` | 200K | | | | | | $0.25 | $1 |
42
+ | `llmgateway/claude-3-haiku-20240307` | 200K | | | | | | $0.25 | $1 |
43
+ | `llmgateway/claude-3-opus` | 200K | | | | | | $15 | $75 |
44
+ | `llmgateway/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
45
+ | `llmgateway/claude-haiku-4-5-20251001` | 200K | | | | | | $1 | $5 |
46
+ | `llmgateway/claude-opus-4-1-20250805` | 200K | | | | | | $15 | $75 |
47
+ | `llmgateway/claude-opus-4-20250514` | 200K | | | | | | $15 | $75 |
48
+ | `llmgateway/claude-opus-4-5-20251101` | 200K | | | | | | $5 | $25 |
49
+ | `llmgateway/claude-opus-4-6` | 1.0M | | | | | | $5 | $25 |
50
+ | `llmgateway/claude-sonnet-4-20250514` | 200K | | | | | | $3 | $15 |
51
+ | `llmgateway/claude-sonnet-4-5` | 200K | | | | | | $3 | $15 |
52
+ | `llmgateway/claude-sonnet-4-5-20250929` | 200K | | | | | | $3 | $15 |
53
+ | `llmgateway/claude-sonnet-4-6` | 200K | | | | | | $3 | $15 |
54
+ | `llmgateway/codestral-2508` | 256K | | | | | | $0.30 | $0.90 |
55
+ | `llmgateway/cogview-4` | 2K | | | | | | — | — |
56
+ | `llmgateway/custom` | 128K | | | | | | — | — |
57
+ | `llmgateway/deepseek-r1-0528` | 64K | | | | | | $0.80 | $2 |
58
+ | `llmgateway/deepseek-v3.1` | 128K | | | | | | $0.56 | $2 |
59
+ | `llmgateway/deepseek-v3.2` | 164K | | | | | | $0.28 | $0.42 |
60
+ | `llmgateway/devstral-2512` | 262K | | | | | | $0.40 | $2 |
61
+ | `llmgateway/devstral-small-2507` | 131K | | | | | | $0.10 | $0.30 |
62
+ | `llmgateway/gemini-2.5-flash` | 1.0M | | | | | | $0.30 | $3 |
63
+ | `llmgateway/gemini-2.5-flash-image` | 33K | | | | | | $0.30 | $30 |
64
+ | `llmgateway/gemini-2.5-flash-image-preview` | 33K | | | | | | $0.30 | $3 |
65
+ | `llmgateway/gemini-2.5-flash-lite` | 1.0M | | | | | | $0.10 | $0.40 |
66
+ | `llmgateway/gemini-2.5-flash-lite-preview-09-2025` | 1.0M | | | | | | $0.10 | $0.40 |
67
+ | `llmgateway/gemini-2.5-pro` | 1.0M | | | | | | $1 | $10 |
68
+ | `llmgateway/gemini-3-flash-preview` | 1.0M | | | | | | $0.50 | $3 |
69
+ | `llmgateway/gemini-3-pro-image-preview` | 66K | | | | | | $2 | $12 |
70
+ | `llmgateway/gemini-3.1-flash-image-preview` | 66K | | | | | | $0.25 | $2 |
71
+ | `llmgateway/gemini-3.1-flash-lite-preview` | 1.0M | | | | | | $0.25 | $2 |
72
+ | `llmgateway/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
73
+ | `llmgateway/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
74
+ | `llmgateway/gemma-2-27b-it-together` | 8K | | | | | | $0.08 | $0.08 |
75
+ | `llmgateway/gemma-3-12b-it` | 1.0M | | | | | | $0.08 | $0.30 |
76
+ | `llmgateway/gemma-3-1b-it` | 1.0M | | | | | | $0.08 | $0.30 |
77
+ | `llmgateway/gemma-3-27b` | 128K | | | | | | $0.27 | $0.27 |
78
+ | `llmgateway/gemma-3-4b-it` | 1.0M | | | | | | $0.08 | $0.30 |
79
+ | `llmgateway/gemma-3n-e2b-it` | 1.0M | | | | | | $0.08 | $0.30 |
80
+ | `llmgateway/gemma-3n-e4b-it` | 1.0M | | | | | | $0.08 | $0.30 |
81
+ | `llmgateway/glm-4-32b-0414-128k` | 128K | | | | | | $0.10 | $0.10 |
82
+ | `llmgateway/glm-4.5` | 128K | | | | | | $0.60 | $2 |
83
+ | `llmgateway/glm-4.5-air` | 128K | | | | | | $0.20 | $1 |
84
+ | `llmgateway/glm-4.5-airx` | 128K | | | | | | $1 | $5 |
85
+ | `llmgateway/glm-4.5-flash` | 128K | | | | | | — | — |
86
+ | `llmgateway/glm-4.5-x` | 128K | | | | | | $2 | $9 |
87
+ | `llmgateway/glm-4.5v` | 128K | | | | | | $0.60 | $2 |
88
+ | `llmgateway/glm-4.6` | 200K | | | | | | $0.60 | $2 |
89
+ | `llmgateway/glm-4.6v` | 128K | | | | | | $0.30 | $0.90 |
90
+ | `llmgateway/glm-4.6v-flash` | 128K | | | | | | — | — |
91
+ | `llmgateway/glm-4.6v-flashx` | 128K | | | | | | $0.04 | $0.40 |
92
+ | `llmgateway/glm-4.7` | 200K | | | | | | $0.60 | $2 |
93
+ | `llmgateway/glm-4.7-flash` | 200K | | | | | | — | — |
94
+ | `llmgateway/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
95
+ | `llmgateway/glm-5` | 203K | | | | | | $1 | $3 |
96
+ | `llmgateway/glm-image` | 2K | | | | | | — | — |
97
+ | `llmgateway/gpt-3.5-turbo` | 16K | | | | | | $0.50 | $2 |
98
+ | `llmgateway/gpt-4` | 8K | | | | | | $30 | $60 |
99
+ | `llmgateway/gpt-4-turbo` | 128K | | | | | | $10 | $30 |
100
+ | `llmgateway/gpt-4.1` | 1.0M | | | | | | $2 | $8 |
101
+ | `llmgateway/gpt-4.1-mini` | 1.0M | | | | | | $0.40 | $2 |
102
+ | `llmgateway/gpt-4.1-nano` | 1.0M | | | | | | $0.10 | $0.40 |
103
+ | `llmgateway/gpt-4o` | 128K | | | | | | $3 | $10 |
104
+ | `llmgateway/gpt-4o-mini` | 128K | | | | | | $0.15 | $0.60 |
105
+ | `llmgateway/gpt-4o-mini-search-preview` | 128K | | | | | | $0.15 | $0.60 |
106
+ | `llmgateway/gpt-4o-search-preview` | 128K | | | | | | $3 | $10 |
107
+ | `llmgateway/gpt-5` | 400K | | | | | | $1 | $10 |
108
+ | `llmgateway/gpt-5-chat-latest` | 400K | | | | | | $1 | $10 |
109
+ | `llmgateway/gpt-5-mini` | 400K | | | | | | $0.25 | $2 |
110
+ | `llmgateway/gpt-5-nano` | 400K | | | | | | $0.05 | $0.40 |
111
+ | `llmgateway/gpt-5-pro` | 400K | | | | | | $15 | $120 |
112
+ | `llmgateway/gpt-5.1` | 400K | | | | | | $1 | $10 |
113
+ | `llmgateway/gpt-5.1-codex` | 400K | | | | | | $1 | $10 |
114
+ | `llmgateway/gpt-5.1-codex-mini` | 400K | | | | | | $0.25 | $2 |
115
+ | `llmgateway/gpt-5.2` | 400K | | | | | | $2 | $14 |
116
+ | `llmgateway/gpt-5.2-chat-latest` | 128K | | | | | | $2 | $14 |
117
+ | `llmgateway/gpt-5.2-codex` | 400K | | | | | | $2 | $14 |
118
+ | `llmgateway/gpt-5.2-pro` | 400K | | | | | | $21 | $168 |
119
+ | `llmgateway/gpt-5.3-chat-latest` | 128K | | | | | | $2 | $14 |
120
+ | `llmgateway/gpt-5.3-codex` | 400K | | | | | | $2 | $14 |
121
+ | `llmgateway/gpt-5.4` | 1.1M | | | | | | $3 | $15 |
122
+ | `llmgateway/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
123
+ | `llmgateway/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
124
+ | `llmgateway/gpt-5.4-pro` | 1.1M | | | | | | $30 | $180 |
125
+ | `llmgateway/gpt-oss-120b` | 131K | | | | | | $0.15 | $0.75 |
126
+ | `llmgateway/gpt-oss-20b` | 131K | | | | | | $0.10 | $0.50 |
127
+ | `llmgateway/grok-3` | 131K | | | | | | $3 | $15 |
128
+ | `llmgateway/grok-4` | 256K | | | | | | $3 | $15 |
129
+ | `llmgateway/grok-4-0709` | 256K | | | | | | $3 | $15 |
130
+ | `llmgateway/grok-4-1-fast` | 2.0M | | | | | | $0.20 | $0.50 |
131
+ | `llmgateway/grok-4-1-fast-non-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
132
+ | `llmgateway/grok-4-1-fast-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
133
+ | `llmgateway/grok-4-20-beta-0309-non-reasoning` | 2.0M | | | | | | $2 | $6 |
134
+ | `llmgateway/grok-4-20-beta-0309-reasoning` | 2.0M | | | | | | $2 | $6 |
135
+ | `llmgateway/grok-4-20-multi-agent-beta-0309` | 2.0M | | | | | | $2 | $6 |
136
+ | `llmgateway/grok-4-fast` | 2.0M | | | | | | $0.20 | $0.50 |
137
+ | `llmgateway/grok-4-fast-non-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
138
+ | `llmgateway/grok-4-fast-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
139
+ | `llmgateway/grok-code-fast-1` | 256K | | | | | | $0.20 | $2 |
140
+ | `llmgateway/grok-imagine-image` | 2K | | | | | | — | — |
141
+ | `llmgateway/grok-imagine-image-pro` | 2K | | | | | | — | — |
142
+ | `llmgateway/hermes-2-pro-llama-3-8b` | 8K | | | | | | $0.14 | $0.14 |
143
+ | `llmgateway/kimi-k2` | 131K | | | | | | $1 | $3 |
144
+ | `llmgateway/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
145
+ | `llmgateway/kimi-k2-thinking-turbo` | 262K | | | | | | $1 | $8 |
146
+ | `llmgateway/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
147
+ | `llmgateway/llama-3-70b-instruct` | 8K | | | | | | $0.51 | $0.74 |
148
+ | `llmgateway/llama-3-8b-instruct` | 8K | | | | | | $0.04 | $0.04 |
149
+ | `llmgateway/llama-3.1-70b-instruct` | 128K | | | | | | $0.72 | $0.72 |
150
+ | `llmgateway/llama-3.1-8b-instruct` | 128K | | | | | | $0.22 | $0.22 |
151
+ | `llmgateway/llama-3.1-nemotron-ultra-253b` | 128K | | | | | | $0.60 | $2 |
152
+ | `llmgateway/llama-3.2-11b-instruct` | 128K | | | | | | $0.07 | $0.33 |
153
+ | `llmgateway/llama-3.2-3b-instruct` | 33K | | | | | | $0.03 | $0.05 |
154
+ | `llmgateway/llama-3.3-70b-instruct` | 128K | | | | | | $0.13 | $0.40 |
155
+ | `llmgateway/llama-4-maverick-17b-instruct` | 8K | | | | | | $0.24 | $0.97 |
156
+ | `llmgateway/llama-4-scout` | 33K | | | | | | $0.18 | $0.59 |
157
+ | `llmgateway/llama-4-scout-17b-instruct` | 8K | | | | | | $0.17 | $0.66 |
158
+ | `llmgateway/llama-guard-4-12b` | 131K | | | | | | $0.20 | $0.20 |
159
+ | `llmgateway/minimax-m2` | 197K | | | | | | $0.20 | $1 |
160
+ | `llmgateway/minimax-m2.1` | 197K | | | | | | $0.27 | $1 |
161
+ | `llmgateway/minimax-m2.1-lightning` | 197K | | | | | | $0.12 | $0.48 |
162
+ | `llmgateway/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
163
+ | `llmgateway/minimax-m2.5-highspeed` | 205K | | | | | | $0.60 | $2 |
164
+ | `llmgateway/minimax-m2.7` | 205K | | | | | | $0.30 | $1 |
165
+ | `llmgateway/minimax-m2.7-highspeed` | 205K | | | | | | $0.60 | $2 |
166
+ | `llmgateway/minimax-text-01` | 1.0M | | | | | | $0.20 | $1 |
167
+ | `llmgateway/ministral-14b-2512` | 262K | | | | | | $0.20 | $0.20 |
168
+ | `llmgateway/ministral-3b-2512` | 131K | | | | | | $0.10 | $0.10 |
169
+ | `llmgateway/ministral-8b-2512` | 262K | | | | | | $0.15 | $0.15 |
170
+ | `llmgateway/mistral-large-2512` | 262K | | | | | | $0.50 | $2 |
171
+ | `llmgateway/mistral-large-latest` | 128K | | | | | | $4 | $12 |
172
+ | `llmgateway/mistral-small-2506` | 128K | | | | | | $0.10 | $0.30 |
173
+ | `llmgateway/mixtral-8x7b-instruct-together` | 33K | | | | | | $0.06 | $0.06 |
174
+ | `llmgateway/o1` | 200K | | | | | | $15 | $60 |
175
+ | `llmgateway/o3` | 200K | | | | | | $2 | $8 |
176
+ | `llmgateway/o3-mini` | 200K | | | | | | $1 | $4 |
177
+ | `llmgateway/o4-mini` | 200K | | | | | | $1 | $4 |
178
+ | `llmgateway/pixtral-large-latest` | 128K | | | | | | $4 | $12 |
179
+ | `llmgateway/qwen-coder-plus` | 131K | | | | | | $1 | $5 |
180
+ | `llmgateway/qwen-flash` | 1.0M | | | | | | $0.05 | $0.40 |
181
+ | `llmgateway/qwen-image` | 2K | | | | | | — | — |
182
+ | `llmgateway/qwen-image-edit-max` | 2K | | | | | | — | — |
183
+ | `llmgateway/qwen-image-edit-plus` | 2K | | | | | | — | — |
184
+ | `llmgateway/qwen-image-max` | 2K | | | | | | — | — |
185
+ | `llmgateway/qwen-image-max-2025-12-30` | 2K | | | | | | — | — |
186
+ | `llmgateway/qwen-image-plus` | 2K | | | | | | — | — |
187
+ | `llmgateway/qwen-max` | 131K | | | | | | $2 | $6 |
188
+ | `llmgateway/qwen-max-latest` | 131K | | | | | | $2 | $6 |
189
+ | `llmgateway/qwen-omni-turbo` | 33K | | | | | | $0.20 | $0.80 |
190
+ | `llmgateway/qwen-plus` | 131K | | | | | | $0.40 | $1 |
191
+ | `llmgateway/qwen-plus-latest` | 1.0M | | | | | | $0.40 | $1 |
192
+ | `llmgateway/qwen-turbo` | 1.0M | | | | | | $0.05 | $0.20 |
193
+ | `llmgateway/qwen-vl-max` | 131K | | | | | | $0.80 | $3 |
194
+ | `llmgateway/qwen-vl-plus` | 131K | | | | | | $0.21 | $0.64 |
195
+ | `llmgateway/qwen2-5-vl-32b-instruct` | 131K | | | | | | $1 | $4 |
196
+ | `llmgateway/qwen2-5-vl-72b-instruct` | 33K | | | | | | $0.13 | $0.40 |
197
+ | `llmgateway/qwen25-coder-7b` | 33K | | | | | | $0.01 | $0.03 |
198
+ | `llmgateway/qwen3-235b-a22b-fp8` | 41K | | | | | | $0.20 | $0.80 |
199
+ | `llmgateway/qwen3-235b-a22b-instruct-2507` | 262K | | | | | | $0.20 | $0.60 |
200
+ | `llmgateway/qwen3-235b-a22b-thinking-2507` | 262K | | | | | | $0.20 | $0.60 |
201
+ | `llmgateway/qwen3-30b-a3b-fp8` | 41K | | | | | | $0.09 | $0.45 |
202
+ | `llmgateway/qwen3-30b-a3b-instruct-2507` | 262K | | | | | | $0.10 | $0.30 |
203
+ | `llmgateway/qwen3-30b-a3b-thinking-2507` | 262K | | | | | | $0.10 | $0.30 |
204
+ | `llmgateway/qwen3-32b` | 33K | | | | | | $0.10 | $0.30 |
205
+ | `llmgateway/qwen3-32b-fp8` | 41K | | | | | | $0.10 | $0.45 |
206
+ | `llmgateway/qwen3-4b-fp8` | 128K | | | | | | $0.03 | $0.03 |
207
+ | `llmgateway/qwen3-coder-30b-a3b-instruct` | 262K | | | | | | $0.10 | $0.30 |
208
+ | `llmgateway/qwen3-coder-480b-a35b-instruct` | 262K | | | | | | $0.40 | $2 |
209
+ | `llmgateway/qwen3-coder-flash` | 1.0M | | | | | | $0.30 | $2 |
210
+ | `llmgateway/qwen3-coder-next` | 262K | | | | | | $0.11 | $0.68 |
211
+ | `llmgateway/qwen3-coder-plus` | 1.0M | | | | | | $6 | $60 |
212
+ | `llmgateway/qwen3-max` | 256K | | | | | | $3 | $15 |
213
+ | `llmgateway/qwen3-max-2026-01-23` | 262K | | | | | | $1 | $6 |
214
+ | `llmgateway/qwen3-next-80b-a3b-instruct` | 129K | | | | | | $0.50 | $2 |
215
+ | `llmgateway/qwen3-next-80b-a3b-thinking` | 131K | | | | | | $0.50 | $6 |
216
+ | `llmgateway/qwen3-vl-235b-a22b-instruct` | 131K | | | | | | $0.50 | $2 |
217
+ | `llmgateway/qwen3-vl-235b-a22b-thinking` | 131K | | | | | | $0.50 | $2 |
218
+ | `llmgateway/qwen3-vl-30b-a3b-instruct` | 131K | | | | | | $0.20 | $0.70 |
219
+ | `llmgateway/qwen3-vl-30b-a3b-thinking` | 131K | | | | | | $0.20 | $1 |
220
+ | `llmgateway/qwen3-vl-8b-instruct` | 131K | | | | | | $0.08 | $0.50 |
221
+ | `llmgateway/qwen3-vl-flash` | 262K | | | | | | $0.05 | $0.40 |
222
+ | `llmgateway/qwen3-vl-plus` | 262K | | | | | | $0.20 | $2 |
223
+ | `llmgateway/qwen35-397b-a17b` | 262K | | | | | | $0.60 | $4 |
224
+ | `llmgateway/qwq-plus` | 131K | | | | | | $0.80 | $2 |
225
+ | `llmgateway/seed-1-6-250615` | 256K | | | | | | $0.25 | $2 |
226
+ | `llmgateway/seed-1-6-250915` | 256K | | | | | | $0.25 | $2 |
227
+ | `llmgateway/seed-1-6-flash-250715` | 256K | | | | | | $0.07 | $0.30 |
228
+ | `llmgateway/seed-1-8-251228` | 256K | | | | | | $0.25 | $2 |
229
+ | `llmgateway/seedream-4-0` | 2K | | | | | | — | — |
230
+ | `llmgateway/seedream-4-5` | 2K | | | | | | — | — |
231
+ | `llmgateway/sonar` | 130K | | | | | | $1 | $1 |
232
+ | `llmgateway/sonar-pro` | 200K | | | | | | $3 | $15 |
233
+ | `llmgateway/sonar-reasoning-pro` | 128K | | | | | | $2 | $8 |
234
+ | `llmgateway/veo-3.1-fast-generate-preview` | 33K | | | | | | — | — |
235
+ | `llmgateway/veo-3.1-generate-preview` | 33K | | | | | | — | — |
236
+
237
+ ## Advanced configuration
238
+
239
+ ### Custom headers
240
+
241
+ ```typescript
242
+ const agent = new Agent({
243
+ id: "custom-agent",
244
+ name: "custom-agent",
245
+ model: {
246
+ url: "https://api.llmgateway.io/v1",
247
+ id: "llmgateway/auto",
248
+ apiKey: process.env.LLMGATEWAY_API_KEY,
249
+ headers: {
250
+ "X-Custom-Header": "value"
251
+ }
252
+ }
253
+ });
254
+ ```
255
+
256
+ ### Dynamic model selection
257
+
258
+ ```typescript
259
+ const agent = new Agent({
260
+ id: "dynamic-agent",
261
+ name: "Dynamic Agent",
262
+ model: ({ requestContext }) => {
263
+ const useAdvanced = requestContext.task === "complex";
264
+ return useAdvanced
265
+ ? "llmgateway/veo-3.1-generate-preview"
266
+ : "llmgateway/auto";
267
+ }
268
+ });
269
+ ```
@@ -1,6 +1,6 @@
1
1
  # ![Mistral logo](https://models.dev/logos/mistral.svg)Mistral
2
2
 
3
- Access 26 Mistral models through Mastra's model router. Authentication is handled automatically using the `MISTRAL_API_KEY` environment variable.
3
+ Access 27 Mistral models through Mastra's model router. Authentication is handled automatically using the `MISTRAL_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Mistral documentation](https://docs.mistral.ai/getting-started/models/).
6
6
 
@@ -52,7 +52,8 @@ for await (const chunk of stream) {
52
52
  | `mistral/mistral-medium-latest` | 128K | | | | | | $0.40 | $2 |
53
53
  | `mistral/mistral-nemo` | 128K | | | | | | $0.15 | $0.15 |
54
54
  | `mistral/mistral-small-2506` | 128K | | | | | | $0.10 | $0.30 |
55
- | `mistral/mistral-small-latest` | 128K | | | | | | $0.10 | $0.30 |
55
+ | `mistral/mistral-small-2603` | 256K | | | | | | $0.15 | $0.60 |
56
+ | `mistral/mistral-small-latest` | 256K | | | | | | $0.15 | $0.60 |
56
57
  | `mistral/open-mistral-7b` | 8K | | | | | | $0.25 | $0.25 |
57
58
  | `mistral/open-mixtral-8x22b` | 64K | | | | | | $2 | $6 |
58
59
  | `mistral/open-mixtral-8x7b` | 32K | | | | | | $0.70 | $0.70 |
@@ -1,6 +1,6 @@
1
1
  # ![NanoGPT logo](https://models.dev/logos/nano-gpt.svg)NanoGPT
2
2
 
3
- Access 517 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
3
+ Access 519 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [NanoGPT documentation](https://docs.nano-gpt.com).
6
6
 
@@ -551,6 +551,8 @@ for await (const chunk of stream) {
551
551
  | `nano-gpt/zai-org/glm-4.7-flash` | 200K | | | | | | $0.07 | $0.40 |
552
552
  | `nano-gpt/zai-org/glm-5` | 200K | | | | | | $0.30 | $3 |
553
553
  | `nano-gpt/zai-org/glm-5:thinking` | 200K | | | | | | $0.30 | $3 |
554
+ | `nano-gpt/zai-org/glm-5.1` | 200K | | | | | | $0.30 | $3 |
555
+ | `nano-gpt/zai-org/glm-5.1:thinking` | 200K | | | | | | $0.30 | $3 |
554
556
 
555
557
  ## Advanced configuration
556
558
 
@@ -1,6 +1,6 @@
1
1
  # ![OpenAI logo](https://models.dev/logos/openai.svg)OpenAI
2
2
 
3
- Access 46 OpenAI models through Mastra's model router. Authentication is handled automatically using the `OPENAI_API_KEY` environment variable.
3
+ Access 47 OpenAI models through Mastra's model router. Authentication is handled automatically using the `OPENAI_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [OpenAI documentation](https://platform.openai.com/docs/models).
6
6
 
@@ -59,6 +59,7 @@ for await (const chunk of stream) {
59
59
  | `openai/gpt-5.2-chat-latest` | 128K | | | | | | $2 | $14 |
60
60
  | `openai/gpt-5.2-codex` | 400K | | | | | | $2 | $14 |
61
61
  | `openai/gpt-5.2-pro` | 400K | | | | | | $21 | $168 |
62
+ | `openai/gpt-5.3-chat-latest` | 128K | | | | | | $2 | $14 |
62
63
  | `openai/gpt-5.3-codex` | 400K | | | | | | $2 | $14 |
63
64
  | `openai/gpt-5.3-codex-spark` | 128K | | | | | | $2 | $14 |
64
65
  | `openai/gpt-5.4` | 1.1M | | | | | | $3 | $15 |
@@ -1,6 +1,6 @@
1
1
  # ![Poe logo](https://models.dev/logos/poe.svg)Poe
2
2
 
3
- Access 122 Poe models through Mastra's model router. Authentication is handled automatically using the `POE_API_KEY` environment variable.
3
+ Access 124 Poe models through Mastra's model router. Authentication is handled automatically using the `POE_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Poe documentation](https://creator.poe.com/docs/external-applications/openai-compatible-api).
6
6
 
@@ -83,6 +83,7 @@ for await (const chunk of stream) {
83
83
  | `poe/ideogramai/ideogram-v2a` | 150 | | | | | | — | — |
84
84
  | `poe/ideogramai/ideogram-v2a-turbo` | 150 | | | | | | — | — |
85
85
  | `poe/lumalabs/ray2` | 5K | | | | | | — | — |
86
+ | `poe/novita/deepseek-v3.2` | 128K | | | | | | $0.27 | $0.40 |
86
87
  | `poe/novita/glm-4.6` | — | | | | | | — | — |
87
88
  | `poe/novita/glm-4.6v` | 131K | | | | | | — | — |
88
89
  | `poe/novita/glm-4.7` | 205K | | | | | | — | — |
@@ -155,6 +156,7 @@ for await (const chunk of stream) {
155
156
  | `poe/xai/grok-4-fast-reasoning` | 2.0M | | | | | | $0.20 | $0.50 |
156
157
  | `poe/xai/grok-4.1-fast-non-reasoning` | 2.0M | | | | | | — | — |
157
158
  | `poe/xai/grok-4.1-fast-reasoning` | 2.0M | | | | | | — | — |
159
+ | `poe/xai/grok-4.20-multi-agent` | 128K | | | | | | $2 | $6 |
158
160
  | `poe/xai/grok-code-fast-1` | 256K | | | | | | $0.20 | $2 |
159
161
 
160
162
  ## Advanced configuration
@@ -1,6 +1,6 @@
1
1
  # ![Z.AI Coding Plan logo](https://models.dev/logos/zai-coding-plan.svg)Z.AI Coding Plan
2
2
 
3
- Access 11 Z.AI Coding Plan models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
3
+ Access 12 Z.AI Coding Plan models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Z.AI Coding Plan documentation](https://docs.z.ai/devpack/overview).
6
6
 
@@ -45,6 +45,7 @@ for await (const chunk of stream) {
45
45
  | `zai-coding-plan/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
46
46
  | `zai-coding-plan/glm-5` | 205K | | | | | | — | — |
47
47
  | `zai-coding-plan/glm-5-turbo` | 200K | | | | | | — | — |
48
+ | `zai-coding-plan/glm-5.1` | 200K | | | | | | — | — |
48
49
 
49
50
  ## Advanced configuration
50
51
 
@@ -74,7 +75,7 @@ const agent = new Agent({
74
75
  model: ({ requestContext }) => {
75
76
  const useAdvanced = requestContext.task === "complex";
76
77
  return useAdvanced
77
- ? "zai-coding-plan/glm-5-turbo"
78
+ ? "zai-coding-plan/glm-5.1"
78
79
  : "zai-coding-plan/glm-4.5";
79
80
  }
80
81
  });
@@ -1,6 +1,6 @@
1
1
  # ![Zhipu AI Coding Plan logo](https://models.dev/logos/zhipuai-coding-plan.svg)Zhipu AI Coding Plan
2
2
 
3
- Access 12 Zhipu AI Coding Plan models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
3
+ Access 13 Zhipu AI Coding Plan models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Zhipu AI Coding Plan documentation](https://docs.bigmodel.cn/cn/coding-plan/overview).
6
6
 
@@ -46,6 +46,7 @@ for await (const chunk of stream) {
46
46
  | `zhipuai-coding-plan/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
47
47
  | `zhipuai-coding-plan/glm-5` | 205K | | | | | | — | — |
48
48
  | `zhipuai-coding-plan/glm-5-turbo` | 200K | | | | | | — | — |
49
+ | `zhipuai-coding-plan/glm-5.1` | 200K | | | | | | — | — |
49
50
 
50
51
  ## Advanced configuration
51
52
 
@@ -75,7 +76,7 @@ const agent = new Agent({
75
76
  model: ({ requestContext }) => {
76
77
  const useAdvanced = requestContext.task === "complex";
77
78
  return useAdvanced
78
- ? "zhipuai-coding-plan/glm-5-turbo"
79
+ ? "zhipuai-coding-plan/glm-5.1"
79
80
  : "zhipuai-coding-plan/glm-4.5";
80
81
  }
81
82
  });
@@ -45,6 +45,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
45
45
  - [Kimi For Coding](https://mastra.ai/models/providers/kimi-for-coding)
46
46
  - [KUAE Cloud Coding Plan](https://mastra.ai/models/providers/kuae-cloud-coding-plan)
47
47
  - [Llama](https://mastra.ai/models/providers/llama)
48
+ - [LLM Gateway](https://mastra.ai/models/providers/llmgateway)
48
49
  - [LMStudio](https://mastra.ai/models/providers/lmstudio)
49
50
  - [LucidQuery AI](https://mastra.ai/models/providers/lucidquery)
50
51
  - [Meganova](https://mastra.ai/models/providers/meganova)
@@ -59,4 +59,6 @@ export async function POST(req: Request) {
59
59
 
60
60
  **sendSources** (`boolean`): Whether to include source citations in the stream. (Default: `false`)
61
61
 
62
+ **onError** (`(error: unknown) => string`): Called when the stream encounters an error. Return the string that will be sent to the client as the error message. Use this to sanitize errors before they reach the client — for example, to prevent internal infrastructure details from leaking to end users.
63
+
62
64
  **messageMetadata** (`(options: { part: UIMessageStreamPart }) => Record<string, unknown> | undefined`): A function that receives the current stream part and returns metadata to attach to start and finish chunks. See the \[AI SDK message metadata docs]\(https\://ai-sdk.dev/docs/ai-sdk-ui/message-metadata) for details.
@@ -308,7 +308,7 @@ response.processDataStream({
308
308
 
309
309
  ## Stored agents
310
310
 
311
- Stored agents are agent configurations stored in a database that can be created, updated, and deleted at runtime. They reference primitives (tools, workflows, other agents, memory, scorers) by key, which are resolved from the Mastra registry when the agent is instantiated.
311
+ Stored agents are agent configurations stored in a database that can be created, updated, and deleted at runtime. They reference primitives (tools, workflows, other agents, scorers) by key, which are resolved from the Mastra registry when the agent is instantiated. Memory is configured inline as a `SerializedMemoryConfig` object with options such as `lastMessages` and `semanticRecall`.
312
312
 
313
313
  ### `listStoredAgents()`
314
314
 
@@ -361,10 +361,15 @@ const agent = await mastraClient.createStoredAgent({
361
361
  provider: 'openai',
362
362
  name: 'gpt-5.4',
363
363
  },
364
- tools: ['calculator', 'weather'],
365
- workflows: ['data-processing'],
366
- agents: ['subagent-1'],
367
- memory: 'my-memory',
364
+ tools: { calculator: {}, weather: {} },
365
+ workflows: { 'data-processing': {} },
366
+ agents: { 'subagent-1': {} },
367
+ memory: {
368
+ options: {
369
+ lastMessages: 20,
370
+ semanticRecall: false,
371
+ },
372
+ },
368
373
  scorers: {
369
374
  'quality-scorer': {
370
375
  sampling: { type: 'ratio', rate: 0.1 },
@@ -415,7 +420,7 @@ const updated = await storedAgent.update({
415
420
  ```typescript
416
421
  // Update just the tools
417
422
  await storedAgent.update({
418
- tools: ['new-tool-1', 'new-tool-2'],
423
+ tools: { 'new-tool-1': {}, 'new-tool-2': {} },
419
424
  })
420
425
 
421
426
  // Update metadata
@@ -32,7 +32,7 @@ export const mastraClient = new MastraClient({
32
32
 
33
33
  **getAgent(agentId)** (`Agent`): Retrieves a specific agent instance by ID.
34
34
 
35
- **getMemoryThreads(params)** (`Promise<StorageThreadType[]>`): Retrieves memory threads for the specified resource and agent. Requires a \`resourceId\` and an \`agentId\`.
35
+ **listMemoryThreads(params)** (`Promise<StorageThreadType[]>`): Retrieves memory threads for the specified resource and agent. Requires a \`resourceId\` and an \`agentId\`.
36
36
 
37
37
  **createMemoryThread(params)** (`Promise<MemoryThread>`): Creates a new memory thread with the given parameters.
38
38
 
@@ -7,7 +7,7 @@ The Memory API provides methods to manage conversation threads and message histo
7
7
  Retrieve all memory threads for a specific resource:
8
8
 
9
9
  ```typescript
10
- const threads = await mastraClient.getMemoryThreads({
10
+ const threads = await mastraClient.listMemoryThreads({
11
11
  resourceId: 'resource-1',
12
12
  agentId: 'agent-1', // Optional - can be omitted if storage is configured
13
13
  })
@@ -566,6 +566,30 @@ export const mastra = new Mastra({
566
566
  })
567
567
  ```
568
568
 
569
+ ### server.mcpOptions
570
+
571
+ **Type:** `object`\
572
+ **Default:** `undefined`
573
+
574
+ MCP transport options applied to all MCP HTTP and SSE routes. Use this to enable stateless mode for serverless environments (Cloudflare Workers, Vercel Edge, AWS Lambda, etc.) where persistent connections and in-memory session state are not available.
575
+
576
+ | Property | Type | Default | Description |
577
+ | -------------------- | -------------- | ----------- | ---------------------------------------------------- |
578
+ | `serverless` | `boolean` | `false` | Run MCP in stateless mode without session management |
579
+ | `sessionIdGenerator` | `() => string` | `undefined` | Custom session ID generator function |
580
+
581
+ ```typescript
582
+ import { Mastra } from '@mastra/core'
583
+
584
+ export const mastra = new Mastra({
585
+ server: {
586
+ mcpOptions: {
587
+ serverless: true,
588
+ },
589
+ },
590
+ })
591
+ ```
592
+
569
593
  ### server.build
570
594
 
571
595
  Build-time configuration for server features. These options control development tools like Swagger UI and request logging, which are enabled during local development but disabled in production by default.
@@ -87,6 +87,8 @@ Fetches provider configurations from the gateway.
87
87
 
88
88
  Builds the API URL for a specific model/provider combination.
89
89
 
90
+ If your provider URL contains placeholders such as `${ACCOUNT_ID}`, resolve them inside `buildUrl()` from `envVars` or `process.env` before returning the final URL.
91
+
90
92
  **Parameters:**
91
93
 
92
94
  **modelId** (`string`): Full model ID (e.g., "custom/my-provider/model-1")
@@ -87,4 +87,34 @@ Use `vars` in the `CloudflareDeployer` constructor only for non-sensitive config
87
87
 
88
88
  ## Build output
89
89
 
90
- After running `mastra build`, the deployer generates a `wrangler.jsonc` file conforming to Cloudflare's [wrangler configuration](https://developers.cloudflare.com/workers/wrangler/configuration/). It points to files inside `.mastra/output` so you need to run `mastra build` before deploying with Wrangler.
90
+ After running `mastra build`, the deployer generates a `wrangler.jsonc` file conforming to Cloudflare's [wrangler configuration](https://developers.cloudflare.com/workers/wrangler/configuration/). It points to files inside `.mastra/output` so you need to run `mastra build` before deploying with Wrangler.
91
+
92
+ ## Cloudflare bindings
93
+
94
+ When you use the Cloudflare deployer, you can import runtime bindings from `cloudflare:workers` in your Mastra config file. Mastra automatically preserves protocol-based runtime imports like `cloudflare:workers` during `mastra build` without trying to install them as npm dependencies.
95
+
96
+ ```typescript
97
+ import { env } from 'cloudflare:workers'
98
+ import { Mastra } from '@mastra/core'
99
+ import { registerApiRoute } from '@mastra/core/server'
100
+ import { CloudflareDeployer } from '@mastra/deployer-cloudflare'
101
+
102
+ export const mastra = new Mastra({
103
+ deployer: new CloudflareDeployer({
104
+ name: 'my-worker',
105
+ kv_namespaces: [{ binding: 'CACHE', id: 'your-kv-namespace-id' }],
106
+ }),
107
+ server: {
108
+ apiRoutes: [
109
+ registerApiRoute('/bindings', {
110
+ method: 'GET',
111
+ requiresAuth: false,
112
+ handler: async c => {
113
+ await env.CACHE.put('status', 'ok')
114
+ return c.json({ status: await env.CACHE.get('status') })
115
+ },
116
+ }),
117
+ ],
118
+ },
119
+ })
120
+ ```