@mastra/mcp-docs-server 1.3.12-alpha.1 → 1.3.12-alpha.3

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 (31) hide show
  1. package/.docs/docs/browser.md +14 -11
  2. package/.docs/docs/harness/background-tasks.md +71 -2
  3. package/.docs/docs/studio/editor.md +12 -9
  4. package/.docs/docs/workflows/control-flow.md +2 -2
  5. package/.docs/docs/workflows/error-handling.md +3 -3
  6. package/.docs/integrations/deploy/temporal.md +1 -0
  7. package/.docs/models/gateways/netlify.md +1 -3
  8. package/.docs/models/gateways/openrouter.md +2 -3
  9. package/.docs/models/gateways/vercel.md +3 -4
  10. package/.docs/models/providers/inceptron.md +3 -3
  11. package/.docs/models/providers/kilo.md +11 -7
  12. package/.docs/models/providers/llmgateway-providers.md +2 -2
  13. package/.docs/models/providers/llmgateway.md +1 -1
  14. package/.docs/models/providers/nano-gpt.md +23 -28
  15. package/.docs/models/providers/ollama-cloud.md +3 -1
  16. package/.docs/models/providers/opencode.md +2 -1
  17. package/.docs/models/providers/prime.md +3 -3
  18. package/.docs/models/providers/siliconflow-cn.md +7 -2
  19. package/.docs/models/providers/wandb.md +1 -1
  20. package/.docs/models/providers/xai.md +1 -1
  21. package/.docs/reference/agents/agent.md +3 -3
  22. package/.docs/reference/client-js/mastra-client.md +2 -0
  23. package/.docs/reference/client-js/observability.md +2 -0
  24. package/.docs/reference/configuration.md +4 -0
  25. package/.docs/reference/observability/tracing/advanced-queries.md +89 -25
  26. package/.docs/reference/rag/chunk.md +1 -1
  27. package/.docs/reference/workflows/run-methods/cancel.md +3 -1
  28. package/.docs/reference/workflows/step.md +3 -1
  29. package/.docs/reference/workflows/workflow-methods/map.md +6 -4
  30. package/.docs/reference/workspace/platform-sandbox.md +26 -0
  31. package/package.json +5 -5
@@ -4,24 +4,27 @@
4
4
 
5
5
  # Browser
6
6
 
7
- Browser support enables agents to move through websites, interact with page elements, fill forms, and extract data. Mastra provides browser capabilities through SDK providers that wrap browser automation libraries and a CLI provider for agents that drive browsers through command-line tools.
7
+ Browser support lets agents navigate websites, interact with page elements, fill out forms, and extract data. Mastra offers two kinds of browser providers:
8
8
 
9
- Mastra supports three SDK providers and one CLI provider:
9
+ - **SDK providers** wrap a browser automation library and give the agent browser tools directly.
10
+ - **CLI providers** launch a browser that the agent controls through command-line tools.
10
11
 
11
- - [**AgentBrowser**](https://mastra.ai/integrations/browsers/agent-browser): A Playwright-based provider with accessibility-first element targeting. Best for general web automation and scraping.
12
- - [**Stagehand**](https://mastra.ai/integrations/browsers/stagehand): A Browserbase provider with AI-powered element detection. Best for complex interactions that benefit from natural language selectors.
13
- - [**FirecrawlBrowser**](https://mastra.ai/integrations/browsers/firecrawl): A Firecrawl Browser Sandbox provider that runs AgentBrowser tools against hosted browser sessions. Best for running automation on hosted browser sessions without managing local browser infrastructure.
14
- - [**BrowserViewer**](https://mastra.ai/integrations/browsers/browser-viewer): A CLI provider that launches Chrome and injects CDP URLs into CLI tools like agent-browser, browser-use, and browse. Best for workspace agents that drive browsers through shell commands.
12
+ Mastra includes three SDK providers and one CLI provider:
15
13
 
16
- ## When to use browser
14
+ - [**AgentBrowser**](https://mastra.ai/integrations/browsers/agent-browser): An SDK provider built on Playwright that finds page elements through accessibility information. Use it for general web automation and scraping.
15
+ - [**Stagehand**](https://mastra.ai/integrations/browsers/stagehand): An SDK provider built on the Stagehand library from Browserbase. It uses AI to find page elements. Use it for complex interactions where describing an element in natural language works better than a fixed selector.
16
+ - [**FirecrawlBrowser**](https://mastra.ai/integrations/browsers/firecrawl): An SDK provider that runs AgentBrowser tools in hosted Firecrawl Browser Sandbox sessions. Use it to avoid running browsers on your own infrastructure.
17
+ - [**BrowserViewer**](https://mastra.ai/integrations/browsers/browser-viewer): A CLI provider that launches Chrome and passes its Chrome DevTools Protocol (CDP) URL to CLI tools such as agent-browser, browser-use, and browse. Use it for workspace agents that control browsers through shell commands.
17
18
 
18
- Use browser when your agent needs to:
19
+ ## When to use a browser
20
+
21
+ Give your agent a browser when it needs to:
19
22
 
20
23
  - Navigate websites and interact with page elements
21
- - Fill out forms and submit data
24
+ - Fill out and submit forms
22
25
  - Extract structured data from web pages
23
- - Automate multi-step web workflows
24
- - Take actions that require a real browser (JavaScript rendering, authentication flows)
26
+ - Automate web tasks that take several steps
27
+ - Work with pages that only function in a real browser, such as pages that render content with JavaScript or require a login
25
28
 
26
29
  ## How it works
27
30
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  **Added in:** `@mastra/core@1.29.0`
8
8
 
9
- Background tasks let an agent dispatch a long-running tool call without blocking the agentic loop. The tool returns an immediate acknowledgement while the LLM continues responding. The task then runs to completion in the background. When it finishes, its result is written to memory and if you use `stream()` with the [`untilIdle`](https://mastra.ai/reference/streaming/agents/stream) option the agent is re-invoked automatically so the result is processed in the same call.
9
+ Background tasks let an agent dispatch a long-running tool call without blocking the agentic loop. The tool returns an immediate acknowledgement while the LLM continues responding. The task then runs to completion in the background. When it finishes, its result is written to memory and the agent runs a follow-up turn to report it. With the [`untilIdle`](https://mastra.ai/reference/streaming/agents/stream) option, that turn streams on the same call; otherwise the agent is notified on the thread, as described in [Report a result after the stream ends](#report-a-result-after-the-stream-ends).
10
10
 
11
11
  ## When to use background tasks
12
12
 
@@ -187,6 +187,50 @@ export const mastra = new Mastra({
187
187
  })
188
188
  ```
189
189
 
190
+ ### Report a result after the stream ends
191
+
192
+ When a deferred task finishes and no `untilIdle` stream is open for its thread, Mastra sends the agent a `notification` signal with the tag `background-task`. The signal names the tool call and task, and tells the agent the result is now on the tool call. It doesn't copy the result into the prompt. This covers a `stream()` call without `untilIdle`, a client that disconnected, and a task resumed after it [suspended](#suspending-and-resuming).
193
+
194
+ - If the thread is idle, the signal wakes the agent, which runs a turn on the thread to report the outcome.
195
+ - If a run is already active on the thread, including the run that dispatched the task, the signal is delivered to that run's next model request. If that run ends without making another request, the signal runs as its own turn.
196
+ - If an `untilIdle` stream is open for the thread, no signal is sent, because that stream runs its own follow-up turn.
197
+ - If the caller cancelled or aborted the `untilIdle` stream that was waiting for the task, no signal is sent either: stopping the stream means the caller doesn't want a reply for that work. A task that suspended and is answered later isn't covered by this, because the stream stopped waiting for it when it suspended.
198
+
199
+ A run that a signal starts on an idle thread, such as a message sent with `agent.sendSignal()`, stays open until the tasks it dispatched finish, and reports them itself. To end woken runs after their own turn instead, set the temporary `wokenRunsEndAfterTurn` option. Their tasks then report back with this signal when they finish:
200
+
201
+ ```typescript
202
+ import { Mastra } from '@mastra/core'
203
+
204
+ export const mastra = new Mastra({
205
+ backgroundTasks: {
206
+ enabled: true,
207
+ wokenRunsEndAfterTurn: true,
208
+ },
209
+ })
210
+ ```
211
+
212
+ A signal's own `ifIdle.streamOptions.untilIdle` takes precedence over the option in both directions. In the next major release, ending after the turn becomes the only behavior and `wokenRunsEndAfterTurn` is removed. To keep a woken run open after that, pass `untilIdle: true` in `ifIdle.streamOptions`. Agent controller sessions and channels already pass it.
213
+
214
+ If you combine `wokenRunsEndAfterTurn` with `notifyAgentOnFinish: false`, nothing reports the tasks of a woken run, so your app has to send the completion itself.
215
+
216
+ If your app sends its own completion signal, for example from `onTaskComplete`, set `notifyAgentOnFinish: false` on the Mastra `backgroundTasks` config so the agent isn't told twice:
217
+
218
+ ```typescript
219
+ import { Mastra } from '@mastra/core'
220
+
221
+ export const mastra = new Mastra({
222
+ backgroundTasks: {
223
+ enabled: true,
224
+ notifyAgentOnFinish: false,
225
+ onTaskComplete: async task => {
226
+ // Send your own notification to task.threadId
227
+ },
228
+ },
229
+ })
230
+ ```
231
+
232
+ The signal needs memory with a thread and resource. A task dispatched without them only writes its result to the task record. Awaited tasks don't send the signal, because the run that dispatched them waits for the result.
233
+
190
234
  ### Aggregate properties
191
235
 
192
236
  `stream()` with `untilIdle` returns a `MastraModelOutput` that looks like the one from a regular `stream()` call, but `fullStream` alone spans the initial turn and any auto-continuations. Aggregate properties (`text`, `toolCalls`, `toolResults`, `finishReason`, `messageList`, `getFullOutput()`) still resolve against the **first turn's** internal buffer. If you need an aggregate view across continuations, consume `fullStream` yourself and accumulate.
@@ -292,6 +336,31 @@ await mastra.backgroundTaskManager?.resume(taskId, {
292
336
  })
293
337
  ```
294
338
 
339
+ On the resumed run, `context.agent.suspendPayload` holds the `data` the tool suspended with. Use it to tell which request an answer belongs to without encoding that in `resumeData`.
340
+
341
+ ### Answer a suspended task from a client
342
+
343
+ While an agent's background tool call is suspended, the assistant message that holds the call records the open request under `metadata.suspendedTools[toolCallId]`. The entry carries `toolName`, `args`, `suspendPayload`, `taskId`, `runId`, and `suspendedAt`, so a chat that reloads the thread can still show the request. The entry is removed when the task resumes or is cancelled.
344
+
345
+ The entry is written by the process that dispatched the tool call, the same process that writes the task's result into the thread. A task that a worker picks up after a restart has no such process, so neither the open request nor the result reaches the thread.
346
+
347
+ To answer the request over HTTP, call `POST /api/background-tasks/:backgroundTaskId/resume` with the answer in `resumeData`. The [client SDK](https://mastra.ai/reference/client-js/mastra-client) wraps the route as `resumeBackgroundTask()`:
348
+
349
+ ```typescript
350
+ import { MastraClient } from '@mastra/client-js'
351
+
352
+ const client = new MastraClient({ baseUrl: 'http://localhost:4111' })
353
+
354
+ const task = await client.getBackgroundTask(taskId)
355
+ await client.resumeBackgroundTask(
356
+ taskId,
357
+ { reviewer: 'alice@example.com' },
358
+ { suspendedAt: task.suspendedAt },
359
+ )
360
+ ```
361
+
362
+ Pass the `suspendedAt` you read from the task or the `suspendedTools` entry. When the task has resumed or suspended again since, the server returns `409 Conflict` instead of delivering a stale answer. The route also returns `409` when the task isn't suspended or no concurrency slot is free, and `404` when the task doesn't exist or belongs to another resource. Calling it requires the `background-tasks:execute` permission.
363
+
295
364
  ### Resume when no slot is free
296
365
 
297
366
  By default, `resume()` throws `Concurrency limit reached` when every concurrency slot is in use. Pass `{ onNoSlot: 'queue' }` to queue the resume instead:
@@ -307,7 +376,7 @@ The queue lives in the memory of the process that called `resume()`. If that pro
307
376
 
308
377
  ### What happens to the agent loop
309
378
 
310
- When a task suspends mid-`stream()` with `untilIdle`, the wrapper treats it as terminal for the current iteration and closes. Once the resume payload is available, call `agent.resumeStream(resumeData, { runId, toolCallId, memory, untilIdle: true })` to continue immediately. The resumed background task completes and adds its result to the message list before the agent runs a follow-up turn on the same SSE connection. To drive the resume out of band, call `mastra.backgroundTaskManager.resume(taskId, resumeData)` directly. Its result is still written into the thread for the next user turn.
379
+ When a task suspends mid-`stream()` with `untilIdle`, the wrapper treats it as terminal for the current iteration and closes. Once the resume payload is available, call `agent.resumeStream(resumeData, { runId, toolCallId, memory, untilIdle: true })` to continue immediately. The resumed background task completes and adds its result to the message list before the agent runs a follow-up turn on the same SSE connection. To drive the resume out of band, call `mastra.backgroundTaskManager.resume(taskId, resumeData)` directly, or use the [resume route](#answer-a-suspended-task-from-a-client). When the task finishes, its result is written into the thread and the agent [wakes to report it](#report-a-result-after-the-stream-ends).
311
380
 
312
381
  ### Re-registering the executor on resume
313
382
 
@@ -169,7 +169,7 @@ See the [Editor tools reference](https://mastra.ai/reference/editor/tools) for M
169
169
 
170
170
  ## Decide what collaborators can edit
171
171
 
172
- The `editor` field decides which fields Studio owns. When omitted, collaborators can change an agent's instructions and manage its tools, including their descriptions, starting from the values in code. The agent's `id`, `name`, and `model` always come from code.
172
+ The `editor` field decides which fields Studio owns. When omitted, collaborators can change an agent's instructions and manage its tools, including their descriptions, starting from the values in code. The agent's `id`, `name`, and model configuration come from code unless you explicitly enable model editing.
173
173
 
174
174
  ```typescript
175
175
  import { Agent } from '@mastra/core/agent'
@@ -206,15 +206,18 @@ export const supportAgent = new Agent({
206
206
 
207
207
  Here Studio owns the instructions, while tool membership stays in code: collaborators can only improve the descriptions of `searchOrders`.
208
208
 
209
- | `editor` value | What collaborators can change | What code must provide |
210
- | ---------------------------------- | ------------------------------------------- | ------------------------------------- |
211
- | Omitted | Instructions, tools, and tool descriptions | `instructions`; tools are optional |
212
- | `false` | Nothing | `instructions` |
213
- | `{ instructions: true }` | Instructions | No `instructions`; tools are optional |
214
- | `{ tools: true }` | Tools and tool descriptions | `instructions`; no `tools` |
215
- | `{ tools: { description: true } }` | Descriptions of tools already added in code | `instructions`; the tools to describe |
209
+ | `editor` value | What collaborators can change | What code must provide |
210
+ | ---------------------------------- | ------------------------------------------- | ------------------------------------------------ |
211
+ | Omitted | Instructions, tools, and tool descriptions | `instructions`; tools are optional |
212
+ | `false` | Nothing | `instructions` |
213
+ | `{ instructions: true }` | Instructions | No `instructions`; tools are optional |
214
+ | `{ tools: true }` | Tools and tool descriptions | `instructions`; no `tools` |
215
+ | `{ tools: { description: true } }` | Descriptions of tools already added in code | `instructions`; the tools to describe |
216
+ | `{ model: true }` | A static model fallback list | A static fallback array with immutable entry IDs |
216
217
 
217
- Studio shows everything else as read-only. See [editor overrides](https://mastra.ai/reference/agents/agent) for the complete configuration.
218
+ To edit models in Studio, set `editor: { model: true }` and define `model` as a static array in code. Give every entry a stable `id` so Editor can match saved values to the corresponding code-defined model settings. Studio can reorder entries, change their provider and model, and enable or disable them.
219
+
220
+ Function-valued model configuration remains code-owned and can't be edited in Studio. See [editor overrides](https://mastra.ai/reference/agents/agent) for the complete configuration.
218
221
 
219
222
  ## Choose where changes are stored
220
223
 
@@ -419,7 +419,7 @@ The `.map()` method provides additional helper functions for more complex mappin
419
419
 
420
420
  **Available helper functions:**
421
421
 
422
- - [`getStepResult()`](https://mastra.ai/reference/workflows/workflow-methods/map): Access a specific step's full output
422
+ - [`getStepResultAsync()`](https://mastra.ai/reference/workflows/workflow-methods/map): Access a specific step's full output
423
423
  - [`getInitData<any>()`](https://mastra.ai/reference/workflows/workflow-methods/map): Access the workflow's initial input data
424
424
  - [`mapVariable()`](https://mastra.ai/reference/workflows/workflow-methods/map): Use declarative object syntax to extract and rename fields
425
425
 
@@ -494,7 +494,7 @@ The parallel output has this shape before `.map()`:
494
494
  }
495
495
  ```
496
496
 
497
- The mapped `{ riskScore, inStock }` object is passed to every branch condition and branch step, so their `inputSchema` values must match `routingSchema`. A `.map()` placed after `.branch()` works the same way. Read branch output with `inputData['manual-review']` or `getStepResult(manualReview)`.
497
+ The mapped `{ riskScore, inStock }` object is passed to every branch condition and branch step, so their `inputSchema` values must match `routingSchema`. A `.map()` placed after `.branch()` works the same way. Read branch output with `inputData['manual-review']` or `await getStepResultAsync(manualReview)`.
498
498
 
499
499
  ## Looping steps
500
500
 
@@ -273,7 +273,7 @@ export const testWorkflow = createWorkflow({})
273
273
 
274
274
  ## Check previous step results
275
275
 
276
- Use `getStepResult()` to inspect a previous step’s results.
276
+ Use `getStepResultAsync()` to inspect a previous step’s results. It resolves to `null` if the step hasn't completed successfully.
277
277
 
278
278
  ```typescript
279
279
  import { createStep } from "@mastra/core/workflows";
@@ -282,8 +282,8 @@ import { z } from "zod";
282
282
  const step1 = createStep({...});
283
283
 
284
284
  const step2 = createStep({
285
- execute: async ({ getStepResult }) => {
286
- const step1Result = getStepResult(step1);
285
+ execute: async ({ getStepResultAsync }) => {
286
+ const step1Result = await getStepResultAsync(step1);
287
287
 
288
288
  return {
289
289
  value: ""
@@ -249,6 +249,7 @@ export const { createWorkflow, createStep } = init({
249
249
  - Set [`validateInputs`](https://mastra.ai/reference/workflows/workflow) to `false` in `createWorkflow()` to skip these checks. This also skips the workflow input checks in `run.start()`.
250
250
  - The build-time transformer reads `validateInputs` from the `createWorkflow()` call. When it can't, for example with `options: sharedOptions`, it prints a warning. Runs started with `run.start()` or `run.startAsync()` still use the workflow's setting, and runs started another way, such as from a Temporal Schedule, check step input.
251
251
  - Step input and request context pass through Temporal's [data converter](https://docs.temporal.io/dataconversion), which turns a `Date` into a string. Use `z.coerce.date()` instead of `z.date()` in a step's `inputSchema` and `requestContextSchema`.
252
+ - [Lifecycle callbacks](https://mastra.ai/docs/workflows/error-handling) (`onStart`, `onFinish`, `onError`) run in the process that calls `run.start()` or `run.startAsync()`, not in the worker. After `run.startAsync()`, that process must keep running until the workflow finishes for `onFinish` and `onError` to run. Runs started another way, such as from a Temporal Schedule, don't run them.
252
253
  - After a `.parallel()` that contains a nested workflow, the next step receives the nested workflow's output under its Temporal workflow type, for example `innerWorkflow` for id `inner`. The default workflow engine uses the id instead.
253
254
 
254
255
  ## Related
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Netlify
6
6
 
7
- Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 283 models through Mastra's model router.
7
+ Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 281 models through Mastra's model router.
8
8
 
9
9
  Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
10
10
 
@@ -219,8 +219,6 @@ ANTHROPIC_API_KEY=ant-...
219
219
  | `openrouter/moonshotai/kimi-k3` |
220
220
  | `openrouter/morph/morph-v3-fast` |
221
221
  | `openrouter/morph/morph-v3-large` |
222
- | `openrouter/nousresearch/hermes-3-llama-3.1-405b` |
223
- | `openrouter/nousresearch/hermes-3-llama-3.1-70b` |
224
222
  | `openrouter/nousresearch/hermes-4-405b` |
225
223
  | `openrouter/nvidia/nemotron-3-nano-30b-a3b` |
226
224
  | `openrouter/nvidia/nemotron-3-super-120b-a12b` |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![OpenRouter logo](https://models.dev/logos/openrouter.svg)OpenRouter
6
6
 
7
- OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 377 models through Mastra's model router.
7
+ OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 376 models through Mastra's model router.
8
8
 
9
9
  Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
10
10
 
@@ -222,8 +222,6 @@ ANTHROPIC_API_KEY=ant-...
222
222
  | `morph/morph-v3-large` |
223
223
  | `nex-agi/nex-n2.5-mini` |
224
224
  | `nex-agi/nex-n2.5-pro` |
225
- | `nousresearch/hermes-3-llama-3.1-405b` |
226
- | `nousresearch/hermes-3-llama-3.1-70b` |
227
225
  | `nousresearch/hermes-4-405b` |
228
226
  | `nvidia/nemotron-3-nano-30b-a3b` |
229
227
  | `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free` |
@@ -413,5 +411,6 @@ ANTHROPIC_API_KEY=ant-...
413
411
  | `z-ai/glm-5.3` |
414
412
  | `z-ai/glm-5.3-flash` |
415
413
  | `z-ai/glm-5.3-flashx` |
414
+ | `z-ai/glm-5.3-flashx-legal` |
416
415
  | `z-ai/glm-5.3-prime` |
417
416
  | `z-ai/glm-5v-turbo` |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Vercel logo](https://models.dev/logos/vercel.svg)Vercel
6
6
 
7
- Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 417 models through Mastra's model router.
7
+ Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 416 models through Mastra's model router.
8
8
 
9
9
  Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
10
10
 
@@ -214,7 +214,7 @@ ANTHROPIC_API_KEY=ant-...
214
214
  | `klingai/kling-v3.0-motion-control` |
215
215
  | `klingai/kling-v3.0-t2v` |
216
216
  | `liquid/lfm2.5-24b-a2b` |
217
- | `meituan/longcat-2.5-preview` |
217
+ | `meituan/longcat-2.5` |
218
218
  | `meta/llama-3.1-70b` |
219
219
  | `meta/llama-3.1-8b` |
220
220
  | `meta/llama-3.3-70b` |
@@ -433,8 +433,6 @@ ANTHROPIC_API_KEY=ant-...
433
433
  | `voyage/voyage-code-3` |
434
434
  | `voyage/voyage-finance-2` |
435
435
  | `voyage/voyage-law-2` |
436
- | `xiaomi/mimo-v2.5` |
437
- | `xiaomi/mimo-v2.5-pro` |
438
436
  | `xiaomi/mimo-v2.6-flash` |
439
437
  | `xiaomi/mimo-v2.6-pro` |
440
438
  | `xiaomi/mimo-v2.6-pro-ultraspeed` |
@@ -454,4 +452,5 @@ ANTHROPIC_API_KEY=ant-...
454
452
  | `zai/glm-5.3-fast` |
455
453
  | `zai/glm-5.3-flash` |
456
454
  | `zai/glm-5.3-flashx` |
455
+ | `zai/glm-5.3-flashx-legal` |
457
456
  | `zai/glm-5v-turbo` |
@@ -39,11 +39,11 @@ for await (const chunk of stream) {
39
39
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
40
  | ---------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
41
  | `inceptron/deepseek-ai/DeepSeek-V4-Flash-0731` | 1.0M | | | | | | $0.13 | $0.49 |
42
- | `inceptron/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.68 | $4 |
42
+ | `inceptron/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.78 | $4 |
43
43
  | `inceptron/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.60 | $4 |
44
44
  | `inceptron/zai-org/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
45
- | `inceptron/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $3 |
46
- | `inceptron/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.19 | $0.60 |
45
+ | `inceptron/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $4 |
46
+ | `inceptron/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.16 | $0.60 |
47
47
 
48
48
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
49
49
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Kilo Gateway logo](https://models.dev/logos/kilo.svg)Kilo Gateway
6
6
 
7
- Access 380 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
7
+ Access 382 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Kilo Gateway documentation](https://kilo.ai).
10
10
 
@@ -42,7 +42,7 @@ for await (const chunk of stream) {
42
42
  | `kilo/~anthropic/claude-haiku-latest` | 1.0M | | | | | | $0.10 | $0.50 |
43
43
  | `kilo/~anthropic/claude-opus-latest` | 1.0M | | | | | | $4 | $20 |
44
44
  | `kilo/~anthropic/claude-sonnet-latest` | 1.0M | | | | | | $2 | $10 |
45
- | `kilo/~deepseek/deepseek-flash-latest` | 1.0M | | | | | | $0.01 | $0.10 |
45
+ | `kilo/~deepseek/deepseek-flash-latest` | 1.0M | | | | | | $0.04 | $0.50 |
46
46
  | `kilo/~deepseek/deepseek-pro-latest` | 1.0M | | | | | | $0.10 | $8 |
47
47
  | `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.04 | $0.30 |
48
48
  | `kilo/~google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
@@ -55,7 +55,7 @@ for await (const chunk of stream) {
55
55
  | `kilo/~openai/gpt-terra-latest` | 1.1M | | | | | | $1 | $5 |
56
56
  | `kilo/~unbiased/pareto-latest` | 1.0M | | | | | | $0.80 | $3 |
57
57
  | `kilo/~x-ai/grok-latest` | 500K | | | | | | $2 | $6 |
58
- | `kilo/~z-ai/glm-flash-latest` | 1.0M | | | | | | $0.01 | $0.15 |
58
+ | `kilo/~z-ai/glm-flash-latest` | 1.0M | | | | | | $0.03 | $0.09 |
59
59
  | `kilo/~z-ai/glm-latest` | 1.0M | | | | | | $0.07 | $1 |
60
60
  | `kilo/aion-labs/aion-2.0` | 131K | | | | | | $0.80 | $2 |
61
61
  | `kilo/aion-labs/aion-3.0` | 131K | | | | | | $3 | $6 |
@@ -134,8 +134,9 @@ for await (const chunk of stream) {
134
134
  | `kilo/google/gemma-3-12b-it` | 131K | | | | | | $0.04 | $0.12 |
135
135
  | `kilo/google/gemma-3-27b-it` | 131K | | | | | | $0.08 | $0.16 |
136
136
  | `kilo/google/gemma-3-4b-it` | 131K | | | | | | $0.04 | $0.05 |
137
- | `kilo/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.01 | $0.04 |
137
+ | `kilo/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.04 | $0.15 |
138
138
  | `kilo/google/gemma-4-31b-it` | 262K | | | | | | $0.10 | $0.34 |
139
+ | `kilo/google/gemma-4-31b-it:free` | 262K | | | | | | — | — |
139
140
  | `kilo/google/lyria-3-clip-preview` | 1.0M | | | | | | — | — |
140
141
  | `kilo/google/lyria-3-pro-preview` | 1.0M | | | | | | — | — |
141
142
  | `kilo/gryphe/mythomax-l2-13b` | 4K | | | | | | $0.08 | $0.11 |
@@ -162,7 +163,7 @@ for await (const chunk of stream) {
162
163
  | `kilo/meta-llama/llama-3.1-70b-instruct` | 131K | | | | | | $0.40 | $0.40 |
163
164
  | `kilo/meta-llama/llama-3.1-8b-instruct` | 131K | | | | | | $0.02 | $0.04 |
164
165
  | `kilo/meta-llama/llama-3.2-1b-instruct` | 60K | | | | | | $0.03 | $0.20 |
165
- | `kilo/meta-llama/llama-3.2-3b-instruct` | 131K | | | | | | $0.05 | $0.33 |
166
+ | `kilo/meta-llama/llama-3.2-3b-instruct` | 80K | | | | | | $0.05 | $0.33 |
166
167
  | `kilo/meta-llama/llama-3.3-70b-instruct` | 131K | | | | | | $0.10 | $0.32 |
167
168
  | `kilo/meta-llama/llama-4-maverick` | 128K | | | | | | $0.19 | $0.65 |
168
169
  | `kilo/meta-llama/llama-4-scout` | 328K | | | | | | $0.08 | $0.24 |
@@ -284,7 +285,7 @@ for await (const chunk of stream) {
284
285
  | `kilo/openai/gpt-audio-mini` | 128K | | | | | | $0.60 | $2 |
285
286
  | `kilo/openai/gpt-chat-latest` | 400K | | | | | | $5 | $30 |
286
287
  | `kilo/openai/gpt-oss-120b` | 131K | | | | | | $0.03 | $0.15 |
287
- | `kilo/openai/gpt-oss-20b` | 131K | | | | | | $0.02 | $0.09 |
288
+ | `kilo/openai/gpt-oss-20b` | 131K | | | | | | $0.01 | $0.02 |
288
289
  | `kilo/openai/gpt-oss-safeguard-20b` | 131K | | | | | | $0.07 | $0.30 |
289
290
  | `kilo/openai/o3` | 200K | | | | | | $2 | $8 |
290
291
  | `kilo/openai/o3-pro` | 200K | | | | | | $20 | $80 |
@@ -373,6 +374,8 @@ for await (const chunk of stream) {
373
374
  | `kilo/thedrummer/unslopnemo-12b` | 1.0M | | | | | | $0.40 | $0.40 |
374
375
  | `kilo/thinkingmachines/inkling` | 524K | | | | | | $1 | $4 |
375
376
  | `kilo/thinkingmachines/inkling-small` | 524K | | | | | | $0.45 | $1 |
377
+ | `kilo/thinkingmachines/inkling-small:free` | 1.0M | | | | | | — | — |
378
+ | `kilo/thinkingmachines/inkling:free` | 1.0M | | | | | | — | — |
376
379
  | `kilo/unbiased/pareto-26.10` | 1.0M | | | | | | $0.80 | $3 |
377
380
  | `kilo/unbiased/pareto-26.9` | 262K | | | | | | $3 | $8 |
378
381
  | `kilo/undi95/remm-slerp-l2-13b` | 6K | | | | | | $0.35 | $0.65 |
@@ -386,7 +389,7 @@ for await (const chunk of stream) {
386
389
  | `kilo/x-ai/grok-4.6` | 500K | | | | | | $2 | $6 |
387
390
  | `kilo/x-ai/grok-4.7` | 500K | | | | | | $2 | $6 |
388
391
  | `kilo/x-ai/grok-build-0.1` | 256K | | | | | | $1 | $2 |
389
- | `kilo/xiaomi/mimo-v2.6-flash` | 1.0M | | | | | | $0.09 | $0.19 |
392
+ | `kilo/xiaomi/mimo-v2.6-flash` | 1.0M | | | | | | $0.10 | $0.28 |
390
393
  | `kilo/xiaomi/mimo-v2.6-pro` | 1.0M | | | | | | $0.43 | $0.87 |
391
394
  | `kilo/xiaomi/mimo-v2.6-pro-ultraspeed` | 1.0M | | | | | | $4 | $9 |
392
395
  | `kilo/xingchen-agi/xing4.0-29b-a4b:free` | 262K | | | | | | — | — |
@@ -404,6 +407,7 @@ for await (const chunk of stream) {
404
407
  | `kilo/z-ai/glm-5.3` | 1.0M | | | | | | $1 | $4 |
405
408
  | `kilo/z-ai/glm-5.3-flash` | 1.0M | | | | | | $0.15 | $0.50 |
406
409
  | `kilo/z-ai/glm-5.3-flashx` | 1.0M | | | | | | $0.37 | $1 |
410
+ | `kilo/z-ai/glm-5.3-flashx-legal` | 1.0M | | | | | | $0.37 | $1 |
407
411
  | `kilo/z-ai/glm-5.3-prime` | 1.0M | | | | | | $3 | $9 |
408
412
  | `kilo/z-ai/glm-5v-turbo` | 203K | | | | | | $1 | $4 |
409
413
 
@@ -350,10 +350,10 @@ for await (const chunk of stream) {
350
350
  | `llmgateway-providers/perplexity/sonar` | 130K | | | | | | $0.25 | $3 |
351
351
  | `llmgateway-providers/quartz/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
352
352
  | `llmgateway-providers/ranoai/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
353
- | `llmgateway-providers/reka-ai/deepseek-v4.1-flash` | 1.0M | | | | | | $0.11 | $0.33 |
353
+ | `llmgateway-providers/reka-ai/deepseek-v4.1-flash` | 1.0M | | | | | | $0.13 | $0.51 |
354
354
  | `llmgateway-providers/reka-ai/deepseek-v4.1-flash-1017` | 1.0M | | | | | | $0.15 | $0.60 |
355
355
  | `llmgateway-providers/reka-ai/glm-5.3` | 1.0M | | | | | | $0.45 | $2 |
356
- | `llmgateway-providers/reka-ai/glm-5.3-flash` | 1.0M | | | | | | $0.18 | $0.60 |
356
+ | `llmgateway-providers/reka-ai/glm-5.3-flash` | 1.0M | | | | | | $0.15 | $0.50 |
357
357
  | `llmgateway-providers/reka-ai/reka-edge-2603` | 16K | | | | | | $0.10 | $0.10 |
358
358
  | `llmgateway-providers/runpod/glm-5.3` | 262K | | | | | | $0.77 | $2 |
359
359
  | `llmgateway-providers/runpod/kimi-k3` | 1.0M | | | | | | $3 | $15 |
@@ -60,7 +60,7 @@ for await (const chunk of stream) {
60
60
  | `llmgateway/deepseek-v3.2` | 164K | | | | | | $0.26 | $0.38 |
61
61
  | `llmgateway/deepseek-v4-flash` | 1.1M | | | | | | $0.08 | $0.15 |
62
62
  | `llmgateway/deepseek-v4-pro` | 1.1M | | | | | | $0.66 | $2 |
63
- | `llmgateway/deepseek-v4.1-flash` | 1.1M | | | | | | $0.11 | $0.33 |
63
+ | `llmgateway/deepseek-v4.1-flash` | 1.1M | | | | | | $0.13 | $0.51 |
64
64
  | `llmgateway/deepseek-v4.1-flash-1017` | 1.1M | | | | | | $0.15 | $0.60 |
65
65
  | `llmgateway/deepseek-v4.1-flash-cyber` | 1.0M | | | | | | $0.30 | $1 |
66
66
  | `llmgateway/fugu-max` | 1.0M | | | | | | $2 | $6 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![NanoGPT logo](https://models.dev/logos/nano-gpt.svg)NanoGPT
6
6
 
7
- Access 643 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
7
+ Access 638 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [NanoGPT documentation](https://docs.nano-gpt.com).
10
10
 
@@ -122,7 +122,7 @@ for await (const chunk of stream) {
122
122
  | `nano-gpt/deepseek-chat` | 128K | | | | | | $0.10 | $0.42 |
123
123
  | `nano-gpt/deepseek-chat-cheaper` | 128K | | | | | | $0.10 | $0.42 |
124
124
  | `nano-gpt/deepseek-v3-0324` | 128K | | | | | | $0.20 | $0.77 |
125
- | `nano-gpt/deepseek/deepseek-latest` | 1.0M | | | | | | $0.28 | $0.85 |
125
+ | `nano-gpt/deepseek/deepseek-latest` | 1.0M | | | | | | $0.66 | $2 |
126
126
  | `nano-gpt/deepseek/deepseek-v3.2` | 163K | | | | | | $0.21 | $0.31 |
127
127
  | `nano-gpt/deepseek/deepseek-v3.2:thinking` | 163K | | | | | | $0.21 | $0.31 |
128
128
  | `nano-gpt/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
@@ -130,23 +130,23 @@ for await (const chunk of stream) {
130
130
  | `nano-gpt/deepseek/deepseek-v4-flash-0423:thinking` | 1.0M | | | | | | $0.14 | $0.28 |
131
131
  | `nano-gpt/deepseek/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.04 | $0.13 |
132
132
  | `nano-gpt/deepseek/deepseek-v4-flash-0731:thinking` | 1.0M | | | | | | $0.04 | $0.13 |
133
- | `nano-gpt/deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.12 | $0.72 |
133
+ | `nano-gpt/deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.10 | $0.60 |
134
134
  | `nano-gpt/deepseek/deepseek-v4-flash-vision-exp` | 1.0M | | | | | | $0.22 | $0.65 |
135
135
  | `nano-gpt/deepseek/deepseek-v4-flash:thinking` | 1.0M | | | | | | $0.14 | $0.28 |
136
136
  | `nano-gpt/deepseek/deepseek-v4-pro` | 1.0M | | | | | | $0.70 | $1 |
137
- | `nano-gpt/deepseek/deepseek-v4-pro-0813` | 1.0M | | | | | | $0.28 | $0.85 |
138
- | `nano-gpt/deepseek/deepseek-v4-pro-0813:thinking` | 1.0M | | | | | | $0.28 | $0.85 |
137
+ | `nano-gpt/deepseek/deepseek-v4-pro-0813` | 1.0M | | | | | | $0.66 | $2 |
138
+ | `nano-gpt/deepseek/deepseek-v4-pro-0813:thinking` | 1.0M | | | | | | $0.66 | $2 |
139
139
  | `nano-gpt/deepseek/deepseek-v4-pro:thinking` | 1.0M | | | | | | $0.70 | $1 |
140
- | `nano-gpt/deepseek/deepseek-v4.1-flash` | 1.0M | | | | | | $0.04 | $0.18 |
140
+ | `nano-gpt/deepseek/deepseek-v4.1-flash` | 1.0M | | | | | | $0.03 | $0.14 |
141
141
  | `nano-gpt/deepseek/deepseek-v4.1-flash-0910-uncensored` | 524K | | | | | | $0.33 | $1 |
142
142
  | `nano-gpt/deepseek/deepseek-v4.1-flash-0910-uncensored:thinking` | 524K | | | | | | $0.33 | $1 |
143
- | `nano-gpt/deepseek/deepseek-v4.1-flash-1017` | 1.0M | | | | | | $0.12 | $0.72 |
143
+ | `nano-gpt/deepseek/deepseek-v4.1-flash-1017` | 1.0M | | | | | | $0.10 | $0.60 |
144
144
  | `nano-gpt/deepseek/deepseek-v4.1-flash-1017-uncensored` | 1.0M | | | | | | $0.33 | $1 |
145
145
  | `nano-gpt/deepseek/deepseek-v4.1-flash-1017-uncensored:thinking` | 1.0M | | | | | | $0.33 | $1 |
146
- | `nano-gpt/deepseek/deepseek-v4.1-flash-1017:thinking` | 1.0M | | | | | | $0.12 | $0.72 |
146
+ | `nano-gpt/deepseek/deepseek-v4.1-flash-1017:thinking` | 1.0M | | | | | | $0.10 | $0.60 |
147
147
  | `nano-gpt/deepseek/deepseek-v4.1-flash-uncensored` | 1.0M | | | | | | $0.33 | $1 |
148
148
  | `nano-gpt/deepseek/deepseek-v4.1-flash-uncensored:thinking` | 1.0M | | | | | | $0.33 | $1 |
149
- | `nano-gpt/deepseek/deepseek-v4.1-flash:thinking` | 1.0M | | | | | | $0.04 | $0.18 |
149
+ | `nano-gpt/deepseek/deepseek-v4.1-flash:thinking` | 1.0M | | | | | | $0.03 | $0.14 |
150
150
  | `nano-gpt/Doctor-Shotgun/MS3.2-24B-Magnum-Diamond` | 33K | | | | | | $0.49 | $0.49 |
151
151
  | `nano-gpt/doubao-seed-2-0-code-preview-260215` | 256K | | | | | | $0.78 | $4 |
152
152
  | `nano-gpt/doubao-seed-2-0-lite-260215` | 256K | | | | | | $0.25 | $2 |
@@ -244,9 +244,9 @@ for await (const chunk of stream) {
244
244
  | `nano-gpt/google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
245
245
  | `nano-gpt/google/gemini-flash-lite-latest` | 1.0M | | | | | | $0.30 | $3 |
246
246
  | `nano-gpt/google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
247
- | `nano-gpt/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.01 | $0.05 |
247
+ | `nano-gpt/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.07 | $0.24 |
248
248
  | `nano-gpt/google/gemma-4-26b-a4b-it-cybersecurity` | 262K | | | | | | $0.11 | $0.33 |
249
- | `nano-gpt/google/gemma-4-26b-a4b-it:thinking` | 262K | | | | | | $0.01 | $0.05 |
249
+ | `nano-gpt/google/gemma-4-26b-a4b-it:thinking` | 262K | | | | | | $0.07 | $0.24 |
250
250
  | `nano-gpt/google/gemma-4-31b-it` | 262K | | | | | | $0.14 | $0.40 |
251
251
  | `nano-gpt/google/gemma-4-31b-it:thinking` | 262K | | | | | | $0.10 | $0.34 |
252
252
  | `nano-gpt/google/gemma4-31b-splituntied` | 262K | | | | | | $0.10 | $0.30 |
@@ -305,7 +305,6 @@ for await (const chunk of stream) {
305
305
  | `nano-gpt/minimax/minimax-01` | 1.0M | | | | | | $0.14 | $1 |
306
306
  | `nano-gpt/minimax/minimax-latest` | 512K | | | | | | $0.23 | $0.96 |
307
307
  | `nano-gpt/minimax/minimax-m2` | 200K | | | | | | $0.17 | $2 |
308
- | `nano-gpt/minimax/minimax-m2-her` | 66K | | | | | | $0.30 | $1 |
309
308
  | `nano-gpt/minimax/minimax-m2.1` | 200K | | | | | | $0.30 | $1 |
310
309
  | `nano-gpt/minimax/minimax-m2.5` | 205K | | | | | | $0.27 | $1 |
311
310
  | `nano-gpt/minimax/minimax-m2.7` | 205K | | | | | | $0.21 | $0.84 |
@@ -350,7 +349,7 @@ for await (const chunk of stream) {
350
349
  | `nano-gpt/moonshotai/kimi-k2.6:thinking` | 262K | | | | | | $0.39 | $2 |
351
350
  | `nano-gpt/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.60 | $3 |
352
351
  | `nano-gpt/moonshotai/kimi-k2.7-code-highspeed` | 262K | | | | | | $2 | $8 |
353
- | `nano-gpt/moonshotai/kimi-k3` | 1.0M | | | | | | $0.15 | $7 |
352
+ | `nano-gpt/moonshotai/kimi-k3` | 1.0M | | | | | | $0.45 | $7 |
354
353
  | `nano-gpt/moonshotai/kimi-k3.1-pro` | 1.0M | | | | | | $2 | $10 |
355
354
  | `nano-gpt/moonshotai/kimi-k3.1-pro-highspeed` | 1.0M | | | | | | $4 | $20 |
356
355
  | `nano-gpt/moonshotai/kimi-latest` | 1.0M | | | | | | $2 | $10 |
@@ -378,7 +377,6 @@ for await (const chunk of stream) {
378
377
  | `nano-gpt/nvidia/nemotron-3.5-lightning` | 1.0M | | | | | | $0.05 | $0.20 |
379
378
  | `nano-gpt/nvidia/nemotron-3.5-lightning:thinking` | 1.0M | | | | | | $0.05 | $0.20 |
380
379
  | `nano-gpt/nvidia/nemotron-3.5-super-vl` | 262K | | | | | | $0.15 | $0.50 |
381
- | `nano-gpt/openai/gpt-4-turbo` | 128K | | | | | | $10 | $30 |
382
380
  | `nano-gpt/openai/gpt-4.1` | 1.0M | | | | | | $2 | $8 |
383
381
  | `nano-gpt/openai/gpt-4.1-mini` | 1.0M | | | | | | $0.40 | $2 |
384
382
  | `nano-gpt/openai/gpt-4.1-nano` | 1.0M | | | | | | $0.10 | $0.40 |
@@ -404,8 +402,8 @@ for await (const chunk of stream) {
404
402
  | `nano-gpt/openai/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
405
403
  | `nano-gpt/openai/gpt-5.6-luna` | 1.1M | | | | | | $0.20 | $1 |
406
404
  | `nano-gpt/openai/gpt-5.6-luna-pro` | 1.1M | | | | | | $0.20 | $1 |
407
- | `nano-gpt/openai/gpt-5.6-sol` | 1.1M | | | | | | $2 | $10 |
408
- | `nano-gpt/openai/gpt-5.6-sol-pro` | 1.1M | | | | | | $2 | $10 |
405
+ | `nano-gpt/openai/gpt-5.6-sol` | 1.1M | | | | | | $4 | $20 |
406
+ | `nano-gpt/openai/gpt-5.6-sol-pro` | 1.1M | | | | | | $4 | $20 |
409
407
  | `nano-gpt/openai/gpt-5.6-terra` | 1.1M | | | | | | $2 | $12 |
410
408
  | `nano-gpt/openai/gpt-5.6-terra-pro` | 1.1M | | | | | | $2 | $12 |
411
409
  | `nano-gpt/openai/gpt-6-astra` | 1.1M | | | | | | $10 | $50 |
@@ -423,19 +421,17 @@ for await (const chunk of stream) {
423
421
  | `nano-gpt/openai/gpt-latest` | 1.1M | | | | | | $10 | $50 |
424
422
  | `nano-gpt/openai/gpt-luna-latest` | 1.1M | | | | | | $0.10 | $0.50 |
425
423
  | `nano-gpt/openai/gpt-oss-120b` | 128K | | | | | | $0.03 | $0.15 |
426
- | `nano-gpt/openai/gpt-oss-20b` | 131K | | | | | | $0.02 | $0.10 |
427
- | `nano-gpt/openai/gpt-oss-safeguard-20b` | 128K | | | | | | $0.07 | $0.30 |
424
+ | `nano-gpt/openai/gpt-oss-20b` | 131K | | | | | | $0.01 | $0.02 |
425
+ | `nano-gpt/openai/gpt-oss-safeguard-20b` | 131K | | | | | | $0.07 | $0.30 |
428
426
  | `nano-gpt/openai/gpt-sol-latest` | 1.1M | | | | | | $2 | $10 |
429
427
  | `nano-gpt/openai/gpt-terra-latest` | 1.1M | | | | | | $1 | $5 |
430
428
  | `nano-gpt/openai/o1` | 200K | | | | | | $15 | $60 |
431
429
  | `nano-gpt/openai/o1-pro` | 200K | | | | | | $150 | $600 |
432
430
  | `nano-gpt/openai/o3` | 200K | | | | | | $2 | $8 |
433
- | `nano-gpt/openai/o3-mini` | 200K | | | | | | $1 | $4 |
434
- | `nano-gpt/openai/o3-mini-high` | 200K | | | | | | $1 | $4 |
435
431
  | `nano-gpt/openai/o3-mini-low` | 200K | | | | | | $1 | $4 |
436
432
  | `nano-gpt/openai/o3-pro-2025-06-10` | 200K | | | | | | $22 | $88 |
437
- | `nano-gpt/openai/o4-mini` | 200K | | | | | | $1 | $4 |
438
- | `nano-gpt/openai/o4-mini-high` | 200K | | | | | | $1 | $4 |
433
+ | `nano-gpt/orca/orcacyber-minimax-m3.1-flash` | 262K | | | | | | $0.80 | $2 |
434
+ | `nano-gpt/orca/orcacyber-qwen3.8-flash-next` | 262K | | | | | | $0.80 | $2 |
439
435
  | `nano-gpt/orca/orcacyber-zero-1.5` | 999K | | | | | | $3 | $8 |
440
436
  | `nano-gpt/ornith-ai/ornith-1.5-122b` | 262K | | | | | | $0.26 | $2 |
441
437
  | `nano-gpt/ornith-ai/ornith-1.5-35b-a3b` | 262K | | | | | | $0.10 | $0.40 |
@@ -447,10 +443,8 @@ for await (const chunk of stream) {
447
443
  | `nano-gpt/phi-4-mini-instruct` | 128K | | | | | | $0.17 | $0.68 |
448
444
  | `nano-gpt/phi-4-multimodal-instruct` | 128K | | | | | | $0.07 | $0.11 |
449
445
  | `nano-gpt/pokee-isaac` | 10.0M | | | | | | $0.15 | $1 |
450
- | `nano-gpt/poolside/laguna-s-2.1` | 1.0M | | | | | | $0.10 | $0.20 |
451
- | `nano-gpt/poolside/laguna-s-2.1:thinking` | 1.0M | | | | | | $0.10 | $0.20 |
452
- | `nano-gpt/pqhaz/DeepSeek-V4.1-Flash-1017-heretic` | 512K | | | | | | $0.18 | $0.72 |
453
- | `nano-gpt/pqhaz/DeepSeek-V4.1-Flash-1017-heretic:thinking` | 512K | | | | | | $0.18 | $0.72 |
446
+ | `nano-gpt/pqhaz/DeepSeek-V4.1-Flash-1017-heretic` | 512K | | | | | | $0.20 | $0.79 |
447
+ | `nano-gpt/pqhaz/DeepSeek-V4.1-Flash-1017-heretic:thinking` | 512K | | | | | | $0.20 | $0.79 |
454
448
  | `nano-gpt/prism-ml/ternary-bonsai-2-27b` | 262K | | | | | | $0.07 | $0.50 |
455
449
  | `nano-gpt/prism-ml/ternary-bonsai-2-9b` | 262K | | | | | | $0.08 | $0.13 |
456
450
  | `nano-gpt/qwen/qwen-2.5-72b-instruct` | 131K | | | | | | $0.36 | $0.40 |
@@ -660,14 +654,15 @@ for await (const chunk of stream) {
660
654
  | `nano-gpt/z-ai/glm-5:thinking` | 200K | | | | | | $0.60 | $2 |
661
655
  | `nano-gpt/z-ai/glm-5.1` | 200K | | | | | | $0.70 | $3 |
662
656
  | `nano-gpt/z-ai/glm-5.1:thinking` | 200K | | | | | | $0.70 | $3 |
663
- | `nano-gpt/z-ai/glm-5.2` | 1.0M | | | | | | $0.07 | $1 |
664
- | `nano-gpt/z-ai/glm-5.2:thinking` | 1.0M | | | | | | $0.07 | $1 |
657
+ | `nano-gpt/z-ai/glm-5.2` | 1.0M | | | | | | $0.08 | $1 |
658
+ | `nano-gpt/z-ai/glm-5.2:thinking` | 1.0M | | | | | | $0.08 | $1 |
665
659
  | `nano-gpt/z-ai/glm-5.3` | 1.0M | | | | | | $0.60 | $1 |
666
660
  | `nano-gpt/z-ai/glm-5.3-flash` | 1.0M | | | | | | $0.10 | $0.30 |
667
661
  | `nano-gpt/z-ai/glm-5.3-flash-apex` | 1.0M | | | | | | $0.15 | $0.50 |
668
662
  | `nano-gpt/z-ai/glm-5.3-flash-apex-abliterated` | 1.0M | | | | | | $0.15 | $0.50 |
669
663
  | `nano-gpt/z-ai/glm-5.3-flash-cybersecurity` | 1.0M | | | | | | $0.15 | $0.50 |
670
664
  | `nano-gpt/z-ai/glm-5.3-flash-uncensored` | 1.0M | | | | | | $0.20 | $0.80 |
665
+ | `nano-gpt/z-ai/glm-5.3-flashx-legal` | 1.0M | | | | | | $0.37 | $1 |
671
666
  | `nano-gpt/z-ai/glm-5.3-uncensored` | 1.0M | | | | | | $1 | $2 |
672
667
  | `nano-gpt/z-ai/glm-5.3:thinking` | 1.0M | | | | | | $0.60 | $1 |
673
668
  | `nano-gpt/z-ai/glm-5v-turbo` | 203K | | | | | | $1 | $4 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Ollama Cloud logo](https://models.dev/logos/ollama-cloud.svg)Ollama Cloud
6
6
 
7
- Access 23 Ollama Cloud models through Mastra's model router. Authentication is handled automatically using the `OLLAMA_API_KEY` environment variable.
7
+ Access 25 Ollama Cloud models through Mastra's model router. Authentication is handled automatically using the `OLLAMA_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Ollama Cloud documentation](https://docs.ollama.com/cloud).
10
10
 
@@ -52,6 +52,8 @@ for await (const chunk of stream) {
52
52
  | `ollama-cloud/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
53
53
  | `ollama-cloud/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
54
54
  | `ollama-cloud/kimi-k3` | 1.0M | | | | | | $3 | $15 |
55
+ | `ollama-cloud/mimo-v2.6-flash` | 1.0M | | | | | | $0.14 | $0.28 |
56
+ | `ollama-cloud/mimo-v2.6-pro` | 1.0M | | | | | | $0.43 | $0.87 |
55
57
  | `ollama-cloud/minimax-m2.7` | 197K | | | | | | $0.30 | $1 |
56
58
  | `ollama-cloud/minimax-m3` | 512K | | | | | | $0.60 | $2 |
57
59
  | `ollama-cloud/minimax-m3.1-flash` | 1.0M | | | | | | $0.15 | $0.60 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![OpenCode logo](https://models.dev/logos/opencode.svg)OpenCode
6
6
 
7
- Access 130 OpenCode models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
7
+ Access 131 OpenCode models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [OpenCode documentation](https://opencode.ai/v2/docs/console/models/).
10
10
 
@@ -114,6 +114,7 @@ for await (const chunk of stream) {
114
114
  | `opencode/muse-wonder-1.0` | 1.0M | | | | | | $4 | $20 |
115
115
  | `opencode/nemotron-3.5-lightning-free` | 262K | | | | | | — | — |
116
116
  | `opencode/nemotron-3.5-super-vl-free` | 1.0M | | | | | | — | — |
117
+ | `opencode/pulse-alpha-free` | 1.0M | | | | | | — | — |
117
118
  | `opencode/qwen3.5-plus` | 262K | | | | | | $0.20 | $1 |
118
119
  | `opencode/qwen3.6-plus` | 262K | | | | | | $0.50 | $3 |
119
120
  | `opencode/qwen3.8-flash` | 1.0M | | | | | | $0.15 | $0.47 |
@@ -51,8 +51,8 @@ for await (const chunk of stream) {
51
51
  | `prime/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.44 | $1 |
52
52
  | `prime/deepseek/deepseek-v4-flash-0731` | 1.0M | | | | | | $0.44 | $1 |
53
53
  | `prime/deepseek/deepseek-v4-pro` | 1.0M | | | | | | $2 | $4 |
54
- | `prime/deepseek/deepseek-v4.1-flash` | 1.0M | | | | | | $0.30 | $1 |
55
- | `prime/deepseek/deepseek-v4.1-flash-1017` | 1.0M | | | | | | $0.30 | $1 |
54
+ | `prime/deepseek/deepseek-v4.1-flash` | 1.0M | | | | | | $0.16 | $1 |
55
+ | `prime/deepseek/deepseek-v4.1-flash-1017` | 1.0M | | | | | | $0.16 | $1 |
56
56
  | `prime/google/gemini-3-flash-preview` | 1.0M | | | | | | $0.50 | $3 |
57
57
  | `prime/google/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
58
58
  | `prime/google/gemini-3.5-flash` | 1.0M | | | | | | $2 | $9 |
@@ -106,7 +106,7 @@ for await (const chunk of stream) {
106
106
  | `prime/x-ai/grok-4.6` | 500K | | | | | | $2 | $6 |
107
107
  | `prime/x-ai/grok-4.7` | 500K | | | | | | $2 | $5 |
108
108
  | `prime/z-ai/glm-5.2` | 1.0M | | | | | | $2 | $5 |
109
- | `prime/z-ai/glm-5.3` | 1.0M | | | | | | $0.98 | $3 |
109
+ | `prime/z-ai/glm-5.3` | 1.0M | | | | | | $0.50 | $3 |
110
110
  | `prime/z-ai/glm-5.3-flash` | 1.0M | | | | | | $0.15 | $0.50 |
111
111
 
112
112
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![SiliconFlow (China) logo](https://models.dev/logos/siliconflow-cn.svg)SiliconFlow (China)
6
6
 
7
- Access 40 SiliconFlow (China) models through Mastra's model router. Authentication is handled automatically using the `SILICONFLOW_CN_API_KEY` environment variable.
7
+ Access 45 SiliconFlow (China) models through Mastra's model router. Authentication is handled automatically using the `SILICONFLOW_CN_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [SiliconFlow (China) documentation](https://cloud.siliconflow.com/models).
10
10
 
@@ -71,11 +71,16 @@ for await (const chunk of stream) {
71
71
  | `siliconflow-cn/Qwen/Qwen3.5-35B-A3B` | 262K | | | | | | $0.06 | $0.48 |
72
72
  | `siliconflow-cn/Qwen/Qwen3.5-4B` | 262K | | | | | | — | — |
73
73
  | `siliconflow-cn/Qwen/Qwen3.5-9B` | 262K | | | | | | $0.07 | $0.60 |
74
+ | `siliconflow-cn/Qwen/Qwen3.6-27B` | 262K | | | | | | $0.45 | $3 |
74
75
  | `siliconflow-cn/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.27 | $2 |
76
+ | `siliconflow-cn/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.45 | $2 |
75
77
  | `siliconflow-cn/stepfun-ai/Step-3.5-Flash` | 262K | | | | | | $0.10 | $0.31 |
76
78
  | `siliconflow-cn/tencent/Hunyuan-A13B-Instruct` | 131K | | | | | | $0.15 | $0.60 |
77
79
  | `siliconflow-cn/zai-org/GLM-4.5-Air` | 131K | | | | | | $0.15 | $0.90 |
80
+ | `siliconflow-cn/zai-org/GLM-4.5V` | 66K | | | | | | $0.15 | $0.90 |
78
81
  | `siliconflow-cn/zai-org/GLM-5.2` | 1.0M | | | | | | $1 | $4 |
82
+ | `siliconflow-cn/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $4 |
83
+ | `siliconflow-cn/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.12 | $0.42 |
79
84
 
80
85
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
81
86
 
@@ -111,7 +116,7 @@ const agent = new Agent({
111
116
  model: ({ requestContext }) => {
112
117
  const useAdvanced = requestContext.task === "complex";
113
118
  return useAdvanced
114
- ? "siliconflow-cn/zai-org/GLM-5.2"
119
+ ? "siliconflow-cn/zai-org/GLM-5.3-Flash"
115
120
  : "siliconflow-cn/ByteDance-Seed/Seed-OSS-36B-Instruct";
116
121
  }
117
122
  });
@@ -59,7 +59,7 @@ for await (const chunk of stream) {
59
59
  | `wandb/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
60
60
  | `wandb/reflection/Beam-1.0-501B-A23B` | 1.0M | | | | | | $0.30 | $1 |
61
61
  | `wandb/zai-org/GLM-5.2` | 1.0M | | | | | | $0.62 | $2 |
62
- | `wandb/zai-org/GLM-5.3` | 1.0M | | | | | | $1 | $4 |
62
+ | `wandb/zai-org/GLM-5.3` | 1.0M | | | | | | $0.75 | $3 |
63
63
  | `wandb/zai-org/GLM-5.3-Flash` | 1.0M | | | | | | $0.12 | $0.38 |
64
64
 
65
65
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![xAI logo](https://models.dev/logos/xai.svg)xAI
6
6
 
7
- Access 13 xAI models through Mastra's model router. Authentication is handled automatically using the `XAI_API_KEY` environment variable.
7
+ Access 12 xAI models through Mastra's model router. Authentication is handled automatically using the `XAI_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [xAI documentation](https://docs.x.ai/docs/models).
10
10
 
@@ -601,7 +601,7 @@ Returns an `AgentThreadSubscription` object with these members:
601
601
 
602
602
  **requestContextSchema** (`StandardJSONSchemaV1`): Standard JSON Schema for validating request context values. When provided, the context is validated at the start of generate() or stream(), throwing a MastraError if validation fails.
603
603
 
604
- **editor** (`false | { instructions?: boolean; tools?: boolean | { description?: boolean } }`): Controls which fields the editor can override for this code-defined agent. Omit to allow editing instructions and tools. See Editor overrides below.
604
+ **editor** (`false | { instructions?: boolean; tools?: boolean | { description?: boolean }; model?: boolean }`): Controls which fields the editor can override for this code-defined agent. Omit to allow editing instructions and tools. See Editor overrides below.
605
605
 
606
606
  ## `generate()` memory options
607
607
 
@@ -674,11 +674,11 @@ The hook context `metadata` includes `agentId` and `agentName`. Per-execution ho
674
674
 
675
675
  When you register the [`MastraEditor`](https://mastra.ai/reference/editor/mastra-editor), the `editor` field controls which parts of an agent are defined in code and which are owned by Studio. Fields owned by code are read-only in Studio and are stripped from saved overrides. Fields owned by Studio must be omitted from code. The agent reads these fields from stored overrides and fails closed when they're missing.
676
676
 
677
- **editor** (`false | { instructions?: boolean; tools?: boolean | { description?: boolean } }`): Omit to allow editing instructions and tools, using values in code as defaults. Set to false to lock the agent. Set instructions: true to make Studio own the instructions; omit instructions from code. Set tools: true to make Studio own tool membership and descriptions; omit tools from code. Set tools: { description: true } to keep tool membership in code and allow only description edits.
677
+ **editor** (`false | { instructions?: boolean; tools?: boolean | { description?: boolean }; model?: boolean }`): Omit to allow editing instructions and tools, using values in code as defaults. Set to false to lock the agent. Set instructions: true to make Studio own the instructions; omit instructions from code. Set tools: true to make Studio own tool membership and descriptions; omit tools from code. Set tools: { description: true } to keep tool membership in code and allow only description edits. Set model: true to allow edits to a static model fallback list.
678
678
 
679
679
  When a field is owned by Studio, TypeScript rejects it in code: `instructions` with `editor: { instructions: true }` and `tools` with `editor: { tools: true }` are type errors. An agent whose instructions are owned by Studio fails closed until a stored version with instructions is published.
680
680
 
681
- The agent's `id`, `name`, and `model` always come from code and can't be overridden through Editor. See [Editor](https://mastra.ai/docs/studio/editor) for usage.
681
+ The agent's `id` and `name` always come from code. Models also remain code-owned unless you set `model: true`. Model ownership supports static fallback arrays whose entries have immutable IDs. Function-valued model configuration can't be overridden through Editor. See [Editor](https://mastra.ai/docs/studio/editor) for usage.
682
682
 
683
683
  ## Returns
684
684
 
@@ -89,6 +89,8 @@ You can also pass `requestContext` as a `Record<string, any>`.
89
89
 
90
90
  **conversations** (`Conversations`): Provides conversation helpers with create(), retrieve(), delete(), and items.list().
91
91
 
92
+ **resumeBackgroundTask(backgroundTaskId, resumeData, options?)** (`Promise<BackgroundTaskResponse>`): Answers a suspended background task with resumeData and returns the task. Pass options.suspendedAt (a Date, ISO string, or epoch milliseconds) from the task you read; the server rejects the answer with 409 if the task has resumed or suspended again since. Also rejects with 409 when the task isn't suspended or no concurrency slot is free, and 404 when the task doesn't exist or belongs to another resource.
93
+
92
94
  **getVector(vectorName)** (`MastraVector`): Returns a vector store instance by name.
93
95
 
94
96
  **listLogs(params)** (`Promise<LogEntry[]>`): Fetches system logs matching the provided filters.
@@ -115,6 +115,8 @@ if (capabilities.spanAggregate) {
115
115
 
116
116
  The request and response structure follows `aggregateTraces()`, with direct span predicates and span dimensions such as `spanType`, `name`, and `parentEntityName`. Token and cost measures belong to the span that recorded the usage and aren't added to parent spans. Check `capabilities.spanAggregate` before calling, and `capabilities.spanAggregateModelDimensions` before grouping or counting distinct values by `model` or `provider`. With an older adapter, those requests return `501`.
117
117
 
118
+ Both `aggregateTraces()` and `aggregateSpans()` accept `timeToFirstToken.*` and `timeToFirstChunk.*` measures when `capabilities.aggregateTimeToFirstMeasures` is `true`. Spans and traces without a recorded value are skipped, never counted as 0. See [Time to first token and chunk measures](https://mastra.ai/reference/observability/tracing/advanced-queries).
119
+
118
120
  See [Aggregate spans](https://mastra.ai/reference/observability/tracing/advanced-queries) for selection, dimensions, per-span usage, and how to list the spans behind a group.
119
121
 
120
122
  ## Querying threads
@@ -103,6 +103,10 @@ export const mastra = new Mastra({
103
103
 
104
104
  **untilIdleMaxIdleMs** (`number`): Default idle timeout, in milliseconds, for agent.stream(..., { untilIdle: true }) calls that do not set maxIdleMs. The stream closes when background tasks are still running but no event has arrived for this long. Set it above your longest expected background task so its completion still triggers a continuation turn. A per-call untilIdle: { maxIdleMs } takes precedence. Default: 5 minutes. (Default: `300000`)
105
105
 
106
+ **notifyAgentOnFinish** (`boolean`): Whether a finished deferred task sends the agent a background-task signal when no untilIdle stream is open for its thread. Set to false when your app sends its own completion signal, for example from onTaskComplete. (Default: `true`)
107
+
108
+ **wokenRunsEndAfterTurn** (`boolean`): Temporary opt-in. When true, a run that a signal starts on an idle thread ends after its own turn instead of waiting for the background tasks it dispatched, which report back through the background-task signal. A signal's own ifIdle.streamOptions.untilIdle takes precedence. In the next major release this becomes the only behavior and the option is removed; pass untilIdle: true in ifIdle.streamOptions to keep a woken run open. (Default: `false`)
109
+
106
110
  **onTaskComplete** (`(task: BackgroundTask) => void | Promise<void>`): Global callback invoked when any background task completes successfully. Fires in addition to per-tool and per-agent callbacks.
107
111
 
108
112
  **onTaskFailed** (`(task: BackgroundTask) => void | Promise<void>`): Global callback invoked when any background task fails. Fires in addition to per-tool and per-agent callbacks.
@@ -44,7 +44,9 @@ The configured observability store must support each API. Call `getObservability
44
44
  | `traceQueryTimeToFirstChunkSort` | `trace-query-time-to-first-chunk-sort` | `orderBy` on `timeToFirstChunkMs` |
45
45
  | `traceQueryTimeToFirstToken` | `trace-query-time-to-first-token` | `timeToFirstTokenMs` predicates and results |
46
46
  | `traceQueryTimeToFirstTokenSort` | `trace-query-time-to-first-token-sort` | `orderBy` on `timeToFirstTokenMs` |
47
+ | `aggregateTimeToFirstMeasures` | `aggregate-time-to-first-measures` | `timeToFirstToken.*` and `timeToFirstChunk.*` measures in `aggregateTraces()` and `aggregateSpans()` |
47
48
  | `traceQueryContextIds` | `trace-query-context-ids` | `runId`, `sessionId`, `userId`, and `organizationId` predicates |
49
+ | `traceQueryContextFields` | `trace-query-context-fields` | `requestId`, `serviceName`, and `experimentId` predicates |
48
50
  | `traceQueryRootSpanFields` | `trace-query-root-span-fields` | Trace-scope `name` and `spanType` predicates, dimensions, and `countDistinct` measures |
49
51
  | `traceQueryRootEntityId` | `trace-query-root-entity-id` | Trace-scope `entityId` predicates, dimensions, and `countDistinct` measures |
50
52
  | `traceQueryOutcomeFields` | `trace-query-outcome-fields` | `outcome` and `stopReason` in trace and `spans.some` / `spans.none` predicates, trace dimensions, and value discovery, plus the root span's outcome fields on trace results |
@@ -93,16 +95,16 @@ Span clauses examine the current root span and current child spans. The root `ti
93
95
 
94
96
  ### Fields and operators
95
97
 
96
- | Predicate context | Fields | Operators |
97
- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
98
- | Trace | `traceId`, `threadId`, `resourceId`, `runId`, `sessionId`, `userId`, `organizationId`, `entityId`, `entityName`, `entityType`, `name`, `spanType`, `environment`, `status`, `outcome`, `stopReason` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
99
- | Trace metadata | `metadata.<key>` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
100
- | Trace | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs`, `timeToFirstTokenMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
101
- | Trace | `tags` | `includes`, `notIncludes`, `exists`, `notExists` |
102
- | Span | `name` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists`, `matches`, `notMatches` |
103
- | Span | `spanType`, `model`, `provider`, `status`, `outcome`, `stopReason`, `entityType`, `entityId`, `entityName`, `entityVersionId`, `parentEntityVersionId`, `rootEntityVersionId`, `runId`, `sessionId`, `userId`, `organizationId` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
104
- | Span | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs`, `timeToFirstTokenMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
105
- | Span | `error` | `exists`, `notExists` |
98
+ | Predicate context | Fields | Operators |
99
+ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
100
+ | Trace | `traceId`, `threadId`, `resourceId`, `runId`, `sessionId`, `userId`, `organizationId`, `requestId`, `serviceName`, `experimentId`, `entityId`, `entityName`, `entityType`, `name`, `spanType`, `environment`, `status`, `outcome`, `stopReason` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
101
+ | Trace metadata | `metadata.<key>` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
102
+ | Trace | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs`, `timeToFirstTokenMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
103
+ | Trace | `tags` | `includes`, `notIncludes`, `exists`, `notExists` |
104
+ | Span | `name` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists`, `matches`, `notMatches` |
105
+ | Span | `spanType`, `model`, `provider`, `status`, `outcome`, `stopReason`, `entityType`, `entityId`, `entityName`, `entityVersionId`, `parentEntityVersionId`, `rootEntityVersionId`, `runId`, `sessionId`, `userId`, `organizationId`, `requestId`, `serviceName`, `experimentId` | `eq`, `ne`, `in`, `notIn`, `exists`, `notExists` |
106
+ | Span | `startedAt`, `endedAt`, `durationMs`, `timeToFirstChunkMs`, `timeToFirstTokenMs` | `eq`, `ne`, `in`, `notIn`, `lt`, `lte`, `gt`, `gte`, `exists`, `notExists` |
107
+ | Span | `error` | `exists`, `notExists` |
106
108
 
107
109
  Trace-scope `name`, `spanType`, and `entityId` read the current root span, so `{ op: 'eq', left: { path: 'spanType' }, right: { literal: 'workflow_run' } }` selects traces started by a workflow run. Inside `spans.some` or `spans.none`, the same fields match any span in the trace.
108
110
 
@@ -211,6 +213,25 @@ const sessionTracesWithRun = {
211
213
 
212
214
  These identifiers support `eq`, `ne`, `in`, `notIn`, `exists`, and `notExists`. Field discovery lists them, but value discovery doesn't return their recorded values. Stores advertise support through the `trace-query-context-ids` feature. A predicate on one of these fields against an older store returns `501` before storage runs, and field discovery omits them for that store.
213
215
 
216
+ `requestId`, `serviceName`, and `experimentId` work the same way, at trace scope and inside `spans.some` / `spans.none`. This predicate finds checkout requests that reached the `payments` service on a child span. The child span records `metadata: { serviceName: 'payments' }`; the root keeps `checkout`:
217
+
218
+ ```typescript
219
+ const checkoutRequestsThroughPayments = {
220
+ op: 'and',
221
+ args: [
222
+ { op: 'eq', left: { path: 'serviceName' }, right: { literal: 'checkout' } },
223
+ { op: 'exists', path: 'requestId' },
224
+ {
225
+ spans: {
226
+ some: { op: 'eq', left: { path: 'serviceName' }, right: { literal: 'payments' } },
227
+ },
228
+ },
229
+ ],
230
+ }
231
+ ```
232
+
233
+ Stores advertise support for these three fields through the `trace-query-context-fields` feature, reported as the `traceQueryContextFields` capability. Against an older store, a predicate on one of them returns `501` before storage runs, and field discovery omits them.
234
+
214
235
  #### Filter by span properties
215
236
 
216
237
  Every condition inside one `spans.some` or `spans.none` clause applies to the same current span. For example, this predicate finds a failed tool span whose name is `medication_lookup`; a matching name on one span and an error on another don't satisfy it:
@@ -807,24 +828,30 @@ Dimensions read the current root span of each selected trace:
807
828
  | `outcome`, `stopReason` | How the root span ended and why. Traces whose root span didn't record a value group as `null`. Requires the `traceQueryOutcomeFields` capability. |
808
829
  | `metadata.<key>` | One non-empty top-level metadata key. Values are trimmed. Missing, empty, and non-string values group as `null`. |
809
830
 
810
- Every dimension except `serviceName`, `executionSource`, and `experimentId` is also a trace-scope `where` field, so you can drill into a group by adding its values to the predicate. `traceId`, `spanId`, `runId`, and `requestId` aren't groupable. Traces with no value for a dimension form their own group with a `null` value. To select that group in a query, use `notExists` for the dimension instead of `eq` with `literal: null`.
831
+ Every dimension except `executionSource` is also a trace-scope `where` field, so you can drill into a group by adding its values to the predicate. `traceId`, `spanId`, `runId`, and `requestId` aren't groupable. Traces with no value for a dimension form their own group with a `null` value. To select that group in a query, use `notExists` for the dimension instead of `eq` with `literal: null`.
811
832
 
812
833
  ### Measures
813
834
 
814
- | Measure | Value |
815
- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
816
- | `count` | Number of selected traces. |
817
- | `countDistinct.<field>` | Number of distinct non-null values of a dimension or `traceId`, such as `countDistinct.userId`. |
818
- | `duration.avg`, `duration.min`, `duration.max` | Root span duration in milliseconds. |
819
- | `duration.p50`, `duration.p90`, `duration.p95`, `duration.p99` | Root span duration percentile in milliseconds. Percentiles can be approximate, depending on the store. |
820
- | `errorCount` | Number of traces whose root span recorded an error. |
821
- | `errorRate` | `errorCount` divided by `count`, from 0 to 1. |
822
- | `tokens.input.sum`, `tokens.input.avg` | Input tokens. |
823
- | `tokens.output.sum`, `tokens.output.avg` | Output tokens. |
824
- | `tokens.total.sum`, `tokens.total.avg` | Input plus output tokens. |
825
- | `tokens.reasoning.sum`, `tokens.reasoning.avg` | Reasoning output tokens. |
826
- | `tokens.cached.sum`, `tokens.cached.avg` | Input tokens read from the provider's cache. |
827
- | `cost.sum`, `cost.avg` | Estimated model cost. |
835
+ | Measure | Value |
836
+ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
837
+ | `count` | Number of selected traces. |
838
+ | `countDistinct.<field>` | Number of distinct non-null values of a dimension or `traceId`, such as `countDistinct.userId`. |
839
+ | `duration.avg`, `duration.min`, `duration.max` | Root span duration in milliseconds. |
840
+ | `duration.p50`, `duration.p90`, `duration.p95`, `duration.p99` | Root span duration percentile in milliseconds. Percentiles can be approximate, depending on the store. |
841
+ | `errorCount` | Number of traces whose root span recorded an error. |
842
+ | `errorRate` | `errorCount` divided by `count`, from 0 to 1. |
843
+ | `tokens.input.sum`, `tokens.input.avg` | Input tokens. |
844
+ | `tokens.output.sum`, `tokens.output.avg` | Output tokens. |
845
+ | `tokens.total.sum`, `tokens.total.avg` | Input plus output tokens. |
846
+ | `tokens.reasoning.sum`, `tokens.reasoning.avg` | Reasoning output tokens. |
847
+ | `tokens.cached.sum`, `tokens.cached.avg` | Input tokens read from the provider's cache. |
848
+ | `cost.sum`, `cost.avg` | Estimated model cost. |
849
+ | `timeToFirstToken.avg`, `timeToFirstToken.min`, `timeToFirstToken.max` | Root span time to first token in milliseconds. Requires the `aggregateTimeToFirstMeasures` capability. |
850
+ | `timeToFirstToken.p50`, `timeToFirstToken.p90`, `timeToFirstToken.p95`, `timeToFirstToken.p99` | Root span time to first token percentile in milliseconds. Requires the `aggregateTimeToFirstMeasures` capability. |
851
+ | `timeToFirstToken.count` | Number of traces whose root span recorded a time to first token. Requires the `aggregateTimeToFirstMeasures` capability. |
852
+ | `timeToFirstChunk.avg`, `timeToFirstChunk.min`, `timeToFirstChunk.max` | Root span time to first chunk in milliseconds. Requires the `aggregateTimeToFirstMeasures` capability. |
853
+ | `timeToFirstChunk.p50`, `timeToFirstChunk.p90`, `timeToFirstChunk.p95`, `timeToFirstChunk.p99` | Root span time to first chunk percentile in milliseconds. Requires the `aggregateTimeToFirstMeasures` capability. |
854
+ | `timeToFirstChunk.count` | Number of traces whose root span recorded a time to first chunk. Requires the `aggregateTimeToFirstMeasures` capability. |
828
855
 
829
856
  Numeric measures over metadata aren't supported.
830
857
 
@@ -845,6 +872,34 @@ When you request any `cost.*` measure, every row also includes a `cost` object:
845
872
 
846
873
  `cost.sum` and `cost.avg` are `null` when the group has no priced traces or `unit` is `'mixed'`. A coverage below 1 means the cost understates the group's spend. The `cost` object isn't a measure, so `having` and `orderBy` can't reference it.
847
874
 
875
+ #### Time to first token and chunk measures
876
+
877
+ `timeToFirstToken.*` and `timeToFirstChunk.*` read the root span's `timeToFirstTokenMs` and `timeToFirstChunkMs`, the same values [`queryTraces()`](#query-traces) returns. An agent run copies them from the first model generation of its own loop:
878
+
879
+ - `timeToFirstChunk.*` is measured from the agent run's start, so it includes work done before the first model call, such as input processors and memory recall.
880
+ - `timeToFirstToken.*` is the time to first token of the model call that streamed that first chunk.
881
+
882
+ Traces without a value are skipped, never counted as 0. This includes traces whose agent run didn't stream, and traces rooted in a workflow, since a workflow run records neither value. `avg`, `min`, `max`, and the percentiles are `null` for a group where no trace has a value, and `.count` is the number of traces that do have one. Percentiles can be approximate, depending on the store.
883
+
884
+ Stores advertise support through the `aggregate-time-to-first-measures` feature, and the server reports it as the `aggregateTimeToFirstMeasures` capability. Against an older store, a request for any of these measures returns `501` before storage runs, and [field discovery](#discover-fields-and-values) omits them.
885
+
886
+ ```typescript
887
+ const { capabilities } = await mastraClient.getObservabilityCapabilities()
888
+
889
+ if (capabilities.traceAggregate && capabilities.aggregateTimeToFirstMeasures) {
890
+ const { rows } = await mastraClient.aggregateTraces({
891
+ timeRange: {
892
+ from: '2026-08-01T00:00:00.000Z',
893
+ to: '2026-08-02T00:00:00.000Z',
894
+ },
895
+ where: { op: 'eq', left: { path: 'entityType' }, right: { literal: 'agent' } },
896
+ groupBy: ['entityName'],
897
+ measures: ['timeToFirstChunk.p50', 'timeToFirstChunk.p95', 'timeToFirstChunk.count'],
898
+ orderBy: { field: 'timeToFirstChunk.p95', direction: 'desc' },
899
+ })
900
+ }
901
+ ```
902
+
848
903
  ### Filter and order groups
849
904
 
850
905
  A group is one distinct combination of `groupBy` values. `having`, `orderBy`, and `limit` operate on groups and use each group's measures over the whole time range, even when `interval` is set. The server applies `having` first, then orders the remaining groups and keeps the first `limit`. `truncated` is `true` when more groups remained than `limit`.
@@ -976,6 +1031,15 @@ Aggregation uses the same span predicates as [`querySpans()`](#query-spans), wit
976
1031
 
977
1032
  `count` counts selected spans in each group or time bucket. Buckets use each span's `startedAt`. `duration.*` measures read the span's own duration, and `errorCount` and `errorRate` read whether the span itself recorded an error.
978
1033
 
1034
+ `timeToFirstToken.*` and `timeToFirstChunk.*` read the span's own `timeToFirstTokenMs` and `timeToFirstChunkMs`, and skip spans without a value. Several span types record them:
1035
+
1036
+ - `model_inference`: each provider call. Filter to this type for per-call time to first token.
1037
+ - `model_step`: each step of a generation, with the values of the inference that streamed the step's first chunk.
1038
+ - `model_generation`: the whole generation, with the values of its first streamed inference only. A multi-step generation, such as a tool loop, reports only its first call.
1039
+ - `agent_run`: the agent run, with time to first chunk measured from the run's start. Filter to this type for latency as the caller of each agent sees it.
1040
+
1041
+ Without a `spanType` filter, one agent call contributes its agent run, its model generation, and every model step and model inference.
1042
+
979
1043
  On ClickHouse, a direct `spanType` `eq` or `in` predicate, or one immediately inside an `and`, can select the smaller branch table. All selected types must be branch types: `agent_run`, `workflow_run`, `processor_run`, `scorer_run`, `rag_ingestion`, `tool_call`, or `mcp_tool_call`. Every requested field must be available in that table. An equivalent `or` predicate doesn't select this optimization. The branch path can differ from `querySpans()`:
980
1044
 
981
1045
  - Spans written before an upgrade from `@mastra/clickhouse` 1.4, 1.5, or 1.6 aren't in the branch table, so older windows can count fewer spans.
@@ -202,7 +202,7 @@ When using the `headers` option, the markdown strategy ignores all general optio
202
202
 
203
203
  **maxSize** (`number`): Maximum size of each chunk
204
204
 
205
- **minSize** (`number`): Minimum size of each chunk
205
+ **minSize** (`number`): Accepted for compatibility. Has no effect on JSON chunking: chunks smaller than this are kept, so no data is discarded.
206
206
 
207
207
  **ensureAscii** (`boolean`): Whether to ensure ASCII encoding
208
208
 
@@ -8,6 +8,8 @@ The `.cancel()` method cancels a workflow run, stopping execution and cleaning u
8
8
 
9
9
  This method aborts any running steps and updates the workflow status to 'canceled'. It works for both actively running workflows and suspended/waiting workflows.
10
10
 
11
+ On the default and evented engines, nested workflow runs are canceled with their parent, including suspended ones. Calling `cancel()` on a run that's already canceled cancels any of its nested runs that are still suspended.
12
+
11
13
  ## Usage example
12
14
 
13
15
  ```typescript
@@ -22,7 +24,7 @@ await run.cancel()
22
24
 
23
25
  ## Returns
24
26
 
25
- **result** (`Promise<void>`): A promise that resolves once cancellation is requested and, if storage is configured, the status update to canceled has been attempted. It does not wait for running steps to stop. Calling cancel() on a run that already finished leaves its status unchanged, except with the Inngest engine.
27
+ **result** (`Promise<void>`): A promise that resolves once cancellation is requested and, if storage is configured, the status update to canceled has been attempted. It does not wait for running steps to stop. Calling cancel() on a run that already finished leaves its status unchanged, except with the Inngest engine. Rejects if storage fails while canceling suspended nested workflow runs.
26
28
 
27
29
  ## How cancellation works
28
30
 
@@ -224,7 +224,9 @@ A classifier without constructor-configured questions can't be used as a workflo
224
224
 
225
225
  **execute.mastra** (`Mastra`): Access to Mastra services (agents, tools, etc.)
226
226
 
227
- **execute.getStepResult** (`(step: Step | string) => any`): Function to access results from other steps
227
+ **execute.getStepResultAsync** (`(step: Step | string) => Promise<any>`): Function to access results from other steps. Resolves to the step's output, or null if the step hasn't completed successfully.
228
+
229
+ **execute.getStepResult** (`(step: Step | string) => any`): Deprecated. Use await getStepResultAsync(step) instead. getStepResult will be removed in a future major release.
228
230
 
229
231
  **execute.getInitData** (`() => any`): Function to access the initial input data of the workflow in any step
230
232
 
@@ -33,17 +33,19 @@ Use `inputData` to access the full output of the previous step.
33
33
  })
34
34
  ```
35
35
 
36
- ## Using `getStepResult()`
36
+ ## Using `getStepResultAsync()`
37
37
 
38
- Use `getStepResult()` to access the full output of a specific step by referencing the step's instance.
38
+ Use `getStepResultAsync()` to access the full output of a specific step by referencing the step's instance or its ID.
39
39
 
40
40
  ```typescript
41
41
  .then(step1)
42
- .map(async ({ getStepResult }) => {
43
- console.log(getStepResult(step1));
42
+ .map(async ({ getStepResultAsync }) => {
43
+ console.log(await getStepResultAsync(step1));
44
44
  })
45
45
  ```
46
46
 
47
+ `getStepResultAsync()` replaces the deprecated `getStepResult()`, which returns the same value synchronously.
48
+
47
49
  ## Using `getInitData()`
48
50
 
49
51
  Use `getInitData<typeof workflow>()` to access the initial input data provided to the workflow.
@@ -369,6 +369,28 @@ A long-running process's output stream reconnects periodically, and the process
369
369
 
370
370
  **fetch** (`typeof fetch`): Custom fetch implementation, mainly for testing.
371
371
 
372
+ ### Port URLs
373
+
374
+ `sandbox.networking.getPortUrl(port)` returns the URL of a port your app listens on in the sandbox, for example a dev server:
375
+
376
+ ```typescript
377
+ await sandbox.processes.spawn('pnpm dev --host 0.0.0.0 --port 3000')
378
+
379
+ const url = await sandbox.networking?.getPortUrl(3000)
380
+ // https://3000-<sandbox id>.sandbox.us.mastra.cloud/
381
+ ```
382
+
383
+ Ports are private: the URL opens in a browser for members of the sandbox's organization once they sign in to Mastra. You can share it, since it never expires, and opening it wakes a paused sandbox.
384
+
385
+ `networking` is `undefined` on a sandbox whose ports can't be opened. `getPortUrl()` returns `null` without starting the sandbox when the sandbox isn't running or has been destroyed, for a port that isn't a whole number from 1 to 65535, and for the sandbox's reserved control port. Other platform errors, such as an invalid access token, are thrown.
386
+
387
+ A browser you control, such as an agent's browser, can't sign in. `getPortAuthCookie(port)` returns a cookie that lets it open the port's URL for an hour without signing in. Don't share the cookie: anyone holding it can open the port.
388
+
389
+ ```typescript
390
+ const cookie = await sandbox.getPortAuthCookie(3000)
391
+ if (cookie) await browserContext.addCookies([cookie])
392
+ ```
393
+
372
394
  ## Properties
373
395
 
374
396
  **id** (`string`): Sandbox instance identifier.
@@ -381,6 +403,8 @@ A long-running process's output stream reconnects periodically, and the process
381
403
 
382
404
  **processes** (`SandboxProcessManager`): Background process manager. spawn() streams output while the process runs, kill() stops it, list() shows what is running in the sandbox, and get(pid) attaches to a process this manager didn't start. See Background processes and the SandboxProcessManager reference.
383
405
 
406
+ **networking** (`SandboxNetworking | undefined`): Port URLs. getPortUrl(port) returns the URL of a port in the running sandbox, which opens in a browser after signing in to Mastra, or null when the sandbox isn't running. undefined when the sandbox's ports can't be opened. See Port URLs.
407
+
384
408
  **filesystem** (`PlatformSandboxFilesystem | undefined`): The sandbox's disk through E2B's files API, sent straight to the VM with the same lease executeCommand() uses. undefined when the sandbox isn't E2B-backed; use executeCommand() then. Paths are absolute and not confined to a root. Copies, appends, and no-overwrite writes run as one command in the VM. See Native filesystem.
385
409
 
386
410
  **templatePending** (`{ templateId: string; retryAfterMs: number } | undefined`): Set when the running sandbox booted from a fallback template (same-lineage stale or provider base) while the exact template continues to build in the background. Undefined when the sandbox booted from the exact template. Observability only — PlatformSandbox does not re-execute template operations; reconcile filesystem state in your own runtime setup.
@@ -399,6 +423,8 @@ A long-running process's output stream reconnects periodically, and the process
399
423
 
400
424
  **snapshot** (`() => Promise<void>`): Capture the configured recovery checkpoint immediately. Resolves without work when no caller-provided id exists or the sandbox is not running.
401
425
 
426
+ **getPortAuthCookie** (`(port: number) => Promise<SandboxPortAuthCookie | null>`): Return a cookie that lets a browser you control open the port's URL for an hour without signing in, in the shape Playwright's addCookies() accepts. null in the same cases as networking.getPortUrl(). See Port URLs.
427
+
402
428
  **getInfo** (`() => Promise<SandboxInfo>`): Return the sandbox's platform id, provider, status, createdAt, and metadata (sandboxId, providerResourceId, platformStatus).
403
429
 
404
430
  **getInstructions** (`(opts?: { requestContext?: RequestContext }) => string`): Return the sandbox instructions the workspace surfaces in tool descriptions. Honors the instructions constructor option; otherwise returns platform-default instructions that include the current remote sandbox id when running.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.3.12-alpha.1",
3
+ "version": "1.3.12-alpha.3",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,8 +26,8 @@
26
26
  "@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
27
27
  "local-pkg": "^1.2.1",
28
28
  "zod": "^4.6.7",
29
- "@mastra/core": "1.82.0-alpha.0",
30
- "@mastra/mcp": "^2.8.0-alpha.0"
29
+ "@mastra/core": "1.82.0-alpha.2",
30
+ "@mastra/mcp": "^2.8.0-alpha.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hono/node-server": "^2.1.3",
@@ -43,8 +43,8 @@
43
43
  "typescript": "^7.0.2",
44
44
  "vitest": "4.1.12",
45
45
  "@internal/lint": "0.0.147",
46
- "@mastra/core": "1.82.0-alpha.0",
47
- "@internal/types-builder": "0.0.122"
46
+ "@internal/types-builder": "0.0.122",
47
+ "@mastra/core": "1.82.0-alpha.2"
48
48
  },
49
49
  "homepage": "https://mastra.ai",
50
50
  "repository": {