@mastra/mcp-docs-server 0.0.0-studio-deploy-20260404182525 → 0.0.0-studio-cli-20260504022012
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.
- package/.docs/docs/agents/adding-voice.md +18 -17
- package/.docs/docs/agents/background-tasks.md +242 -0
- package/.docs/docs/agents/channels.md +2 -1
- package/.docs/docs/agents/overview.md +4 -0
- package/.docs/docs/agents/processors.md +177 -5
- package/.docs/docs/agents/structured-output.md +66 -1
- package/.docs/docs/agents/supervisor-agents.md +65 -0
- package/.docs/docs/agents/using-tools.md +73 -0
- package/.docs/docs/browser/agent-browser.md +78 -0
- package/.docs/docs/browser/browser-viewer.md +144 -0
- package/.docs/docs/browser/overview.md +168 -0
- package/.docs/docs/browser/stagehand.md +129 -0
- package/.docs/docs/deployment/cloud-providers.md +5 -1
- package/.docs/docs/deployment/mastra-server.md +4 -4
- package/.docs/docs/deployment/monorepo.md +3 -3
- package/.docs/docs/deployment/overview.md +11 -8
- package/.docs/docs/editor/overview.md +290 -0
- package/.docs/docs/editor/prompts.md +134 -0
- package/.docs/docs/editor/tools.md +152 -0
- package/.docs/docs/evals/custom-scorers.md +63 -3
- package/.docs/docs/evals/datasets/overview.md +1 -1
- package/.docs/docs/index.md +2 -2
- package/.docs/docs/mastra-platform/configuration.md +36 -0
- package/.docs/docs/mastra-platform/overview.md +78 -0
- package/.docs/docs/mcp/overview.md +17 -0
- package/.docs/docs/memory/memory-processors.md +3 -3
- package/.docs/docs/memory/message-history.md +8 -2
- package/.docs/docs/memory/observational-memory.md +65 -8
- package/.docs/docs/memory/storage.md +1 -2
- package/.docs/docs/memory/working-memory.md +2 -2
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/metrics/overview.md +2 -2
- package/.docs/docs/observability/overview.md +1 -1
- package/.docs/docs/observability/tracing/bridges/datadog.md +217 -0
- package/.docs/docs/observability/tracing/bridges/otel.md +2 -2
- package/.docs/docs/observability/tracing/exporters/arthur.md +163 -0
- package/.docs/docs/observability/tracing/exporters/cloud.md +135 -63
- package/.docs/docs/observability/tracing/exporters/datadog.md +3 -1
- package/.docs/docs/observability/tracing/exporters/default.md +5 -5
- package/.docs/docs/observability/tracing/exporters/laminar.md +22 -14
- package/.docs/docs/observability/tracing/exporters/langfuse.md +50 -33
- package/.docs/docs/observability/tracing/overview.md +87 -20
- package/.docs/docs/server/custom-adapters.md +5 -5
- package/.docs/docs/server/custom-api-routes.md +3 -3
- package/.docs/docs/server/mastra-client.md +2 -2
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/server/middleware.md +46 -42
- package/.docs/docs/server/request-context.md +13 -2
- package/.docs/docs/server/server-adapters.md +91 -8
- package/.docs/docs/streaming/background-task-streaming.md +80 -0
- package/.docs/docs/streaming/overview.md +3 -0
- package/.docs/docs/studio/deployment.md +24 -6
- package/.docs/docs/studio/observability.md +1 -1
- package/.docs/docs/studio/overview.md +4 -4
- package/.docs/docs/voice/overview.md +74 -5
- package/.docs/docs/voice/speech-to-speech.md +45 -1
- package/.docs/docs/voice/speech-to-text.md +7 -7
- package/.docs/docs/voice/text-to-speech.md +10 -10
- package/.docs/docs/workflows/agents-and-tools.md +1 -1
- package/.docs/docs/workflows/overview.md +105 -4
- package/.docs/docs/workflows/scheduled-workflows.md +181 -0
- package/.docs/docs/workspace/filesystem.md +64 -6
- package/.docs/docs/workspace/lsp.md +76 -4
- package/.docs/docs/workspace/overview.md +62 -15
- package/.docs/docs/workspace/sandbox.md +3 -1
- package/.docs/docs/workspace/search.md +41 -2
- package/.docs/docs/workspace/skills.md +19 -19
- package/.docs/guides/agent-frameworks/ai-sdk.md +4 -4
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +56 -9
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/deployment/mastra-platform.md +191 -0
- package/.docs/guides/deployment/netlify.md +16 -1
- package/.docs/guides/getting-started/nestjs.md +238 -0
- package/.docs/guides/getting-started/next-js.md +0 -4
- package/.docs/guides/guide/code-review-bot.md +2 -2
- package/.docs/guides/guide/dev-assistant.md +4 -4
- package/.docs/{docs/mcp → guides/guide}/publishing-mcp-server.md +21 -1
- package/.docs/guides/guide/slack-assistant.md +191 -0
- package/.docs/guides/migrations/mastra-cloud.md +368 -0
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +1 -1
- package/.docs/models/embeddings.md +3 -3
- package/.docs/models/gateways/azure-openai.md +74 -35
- package/.docs/models/gateways/mastra.md +64 -0
- package/.docs/models/gateways/netlify.md +7 -3
- package/.docs/models/gateways/openrouter.md +28 -12
- package/.docs/models/gateways/vercel.md +22 -2
- package/.docs/models/gateways.md +1 -0
- package/.docs/models/index.md +43 -8
- package/.docs/models/providers/302ai.md +37 -4
- package/.docs/models/providers/abliteration-ai.md +71 -0
- package/.docs/models/providers/alibaba-cn.md +8 -2
- package/.docs/models/providers/alibaba-coding-plan-cn.md +3 -2
- package/.docs/models/providers/alibaba-coding-plan.md +3 -2
- package/.docs/models/providers/alibaba.md +8 -1
- package/.docs/models/providers/anthropic.md +18 -5
- package/.docs/models/providers/baseten.md +3 -1
- package/.docs/models/providers/berget.md +10 -12
- package/.docs/models/providers/chutes.md +4 -2
- package/.docs/models/providers/cloudflare-workers-ai.md +14 -48
- package/.docs/models/providers/cortecs.md +22 -2
- package/.docs/models/providers/deepinfra.md +8 -2
- package/.docs/models/providers/deepseek.md +6 -4
- package/.docs/models/providers/digitalocean.md +133 -0
- package/.docs/models/providers/fireworks-ai.md +6 -1
- package/.docs/models/providers/firmware.md +12 -10
- package/.docs/models/providers/friendli.md +6 -7
- package/.docs/models/providers/google.md +9 -3
- package/.docs/models/providers/helicone.md +1 -2
- package/.docs/models/providers/hpc-ai.md +73 -0
- package/.docs/models/providers/huggingface.md +6 -2
- package/.docs/models/providers/inception.md +9 -11
- package/.docs/models/providers/kilo.md +359 -339
- package/.docs/models/providers/kimi-for-coding.md +2 -1
- package/.docs/models/providers/llmgateway.md +67 -77
- package/.docs/models/providers/mistral.md +3 -2
- package/.docs/models/providers/mixlayer.md +75 -0
- package/.docs/models/providers/moonshotai-cn.md +3 -2
- package/.docs/models/providers/moonshotai.md +3 -2
- package/.docs/models/providers/nano-gpt.md +8 -2
- package/.docs/models/providers/neuralwatt.md +84 -0
- package/.docs/models/providers/novita-ai.md +19 -4
- package/.docs/models/providers/nvidia.md +8 -1
- package/.docs/models/providers/ollama-cloud.md +7 -2
- package/.docs/models/providers/openai.md +7 -2
- package/.docs/models/providers/opencode-go.md +21 -13
- package/.docs/models/providers/opencode.md +11 -4
- package/.docs/models/providers/ovhcloud.md +6 -8
- package/.docs/models/providers/poe.md +10 -15
- package/.docs/models/providers/regolo-ai.md +83 -0
- package/.docs/models/providers/siliconflow-cn.md +5 -2
- package/.docs/models/providers/siliconflow.md +6 -3
- package/.docs/models/providers/stepfun.md +8 -7
- package/.docs/models/providers/synthetic.md +5 -2
- package/.docs/models/providers/tencent-token-plan.md +71 -0
- package/.docs/models/providers/tencent-tokenhub.md +71 -0
- package/.docs/models/providers/togetherai.md +8 -7
- package/.docs/models/providers/vivgrid.md +7 -3
- package/.docs/models/providers/vultr.md +7 -6
- package/.docs/models/providers/wafer.ai.md +73 -0
- package/.docs/models/providers/wandb.md +3 -2
- package/.docs/models/providers/xai.md +6 -1
- package/.docs/models/providers/xiaomi-token-plan-ams.md +75 -0
- package/.docs/models/providers/xiaomi-token-plan-cn.md +75 -0
- package/.docs/models/providers/xiaomi-token-plan-sgp.md +75 -0
- package/.docs/models/providers/xiaomi.md +4 -2
- package/.docs/models/providers/zai-coding-plan.md +11 -19
- package/.docs/models/providers/zai.md +2 -1
- package/.docs/models/providers/zenmux.md +17 -6
- package/.docs/models/providers/zhipuai-coding-plan.md +11 -21
- package/.docs/models/providers/zhipuai.md +2 -1
- package/.docs/models/providers.md +11 -0
- package/.docs/reference/agents/agent.md +1 -1
- package/.docs/reference/agents/channels.md +3 -3
- package/.docs/reference/agents/generate.md +88 -6
- package/.docs/reference/agents/generateLegacy.md +1 -1
- package/.docs/reference/ai-sdk/chat-route.md +2 -0
- package/.docs/reference/ai-sdk/handle-chat-stream.md +19 -0
- package/.docs/reference/ai-sdk/handle-network-stream.md +2 -0
- package/.docs/reference/ai-sdk/network-route.md +2 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +95 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +15 -0
- package/.docs/reference/browser/agent-browser.md +375 -0
- package/.docs/reference/browser/browser-viewer.md +228 -0
- package/.docs/reference/browser/mastra-browser.md +286 -0
- package/.docs/reference/browser/stagehand-browser.md +286 -0
- package/.docs/reference/cli/mastra.md +703 -0
- package/.docs/reference/client-js/agents.md +166 -0
- package/.docs/reference/client-js/conversations.md +1 -1
- package/.docs/reference/client-js/mastra-client.md +23 -0
- package/.docs/reference/client-js/observability.md +2 -2
- package/.docs/reference/client-js/responses.md +1 -1
- package/.docs/reference/client-js/workflows.md +62 -1
- package/.docs/reference/configuration.md +67 -1
- package/.docs/reference/core/addGateway.md +5 -5
- package/.docs/reference/core/getEditor.md +35 -0
- package/.docs/reference/core/getGateway.md +5 -5
- package/.docs/reference/core/getGatewayById.md +5 -5
- package/.docs/reference/core/getMCPServer.md +2 -2
- package/.docs/reference/core/getMCPServerById.md +2 -2
- package/.docs/reference/core/getScorer.md +3 -3
- package/.docs/reference/core/getScorerById.md +3 -3
- package/.docs/reference/core/listGateways.md +5 -5
- package/.docs/reference/core/listMCPServers.md +2 -2
- package/.docs/reference/core/listScorers.md +3 -3
- package/.docs/reference/core/mastra-class.md +11 -1
- package/.docs/reference/core/mastra-model-gateway.md +5 -5
- package/.docs/reference/datasets/create.md +4 -4
- package/.docs/reference/datasets/startExperiment.md +28 -2
- package/.docs/reference/datasets/update.md +4 -4
- package/.docs/reference/deployer/cloudflare.md +14 -1
- package/.docs/reference/deployer/netlify.md +50 -2
- package/.docs/reference/editor/mastra-editor.md +168 -0
- package/.docs/reference/editor/tool-provider.md +85 -0
- package/.docs/reference/evals/context-precision.md +3 -3
- package/.docs/reference/evals/context-relevance.md +3 -3
- package/.docs/reference/evals/create-scorer.md +5 -3
- package/.docs/reference/evals/filter-run.md +117 -0
- package/.docs/reference/evals/mastra-scorer.md +4 -4
- package/.docs/reference/evals/noise-sensitivity.md +6 -6
- package/.docs/reference/evals/prompt-alignment.md +12 -12
- package/.docs/reference/evals/run-evals.md +6 -6
- package/.docs/reference/evals/scorer-utils.md +3 -3
- package/.docs/reference/evals/trajectory-accuracy.md +3 -3
- package/.docs/reference/harness/harness-class.md +152 -53
- package/.docs/reference/index.md +25 -0
- package/.docs/reference/logging/pino-logger.md +0 -2
- package/.docs/reference/mastra-platform/api.md +108 -0
- package/.docs/reference/memory/clone-utilities.md +4 -2
- package/.docs/reference/memory/cloneThread.md +4 -2
- package/.docs/reference/memory/observational-memory.md +4 -0
- package/.docs/reference/observability/metrics/automatic-metrics.md +3 -3
- package/.docs/reference/observability/tracing/bridges/datadog.md +211 -0
- package/.docs/reference/observability/tracing/bridges/otel.md +3 -3
- package/.docs/reference/observability/tracing/configuration.md +18 -11
- package/.docs/reference/observability/tracing/exporters/arthur.md +122 -0
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +102 -21
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +8 -8
- package/.docs/reference/observability/tracing/exporters/datadog.md +3 -1
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +8 -8
- package/.docs/reference/observability/tracing/exporters/langfuse.md +25 -32
- package/.docs/reference/observability/tracing/exporters/otel.md +3 -3
- package/.docs/reference/observability/tracing/instances.md +7 -7
- package/.docs/reference/observability/tracing/interfaces.md +23 -6
- package/.docs/reference/observability/tracing/span-filtering.md +95 -0
- package/.docs/reference/observability/tracing/spans.md +6 -6
- package/.docs/reference/processors/prefill-error-handler.md +70 -0
- package/.docs/reference/processors/processor-interface.md +400 -40
- package/.docs/reference/processors/skill-search-processor.md +20 -1
- package/.docs/reference/processors/stream-error-retry-processor.md +54 -0
- package/.docs/reference/processors/tool-call-filter.md +23 -0
- package/.docs/reference/server/create-route.md +3 -3
- package/.docs/reference/server/express-adapter.md +4 -4
- package/.docs/reference/server/fastify-adapter.md +4 -4
- package/.docs/reference/server/hono-adapter.md +4 -4
- package/.docs/reference/server/koa-adapter.md +4 -4
- package/.docs/reference/server/mastra-server.md +3 -3
- package/.docs/reference/server/nestjs-adapter.md +169 -0
- package/.docs/reference/server/register-api-route.md +4 -4
- package/.docs/reference/server/routes.md +11 -10
- package/.docs/reference/storage/clickhouse.md +300 -0
- package/.docs/reference/storage/cloudflare-d1.md +42 -42
- package/.docs/reference/storage/composite.md +5 -3
- package/.docs/reference/storage/duckdb.md +150 -0
- package/.docs/reference/storage/overview.md +1 -1
- package/.docs/reference/storage/redis.md +266 -0
- package/.docs/reference/streaming/ChunkType.md +143 -3
- package/.docs/reference/streaming/agents/MastraModelOutput.md +2 -2
- package/.docs/reference/streaming/agents/stream.md +10 -2
- package/.docs/reference/streaming/agents/streamUntilIdle.md +94 -0
- package/.docs/reference/streaming/workflows/resumeStream.md +2 -0
- package/.docs/reference/templates/overview.md +88 -14
- package/.docs/reference/tools/create-tool.md +107 -5
- package/.docs/reference/tools/mcp-client.md +45 -0
- package/.docs/reference/tools/mcp-server.md +1 -3
- package/.docs/reference/tools/perplexity.md +155 -0
- package/.docs/reference/tools/tavily.md +307 -0
- package/.docs/reference/vectors/mongodb.md +0 -2
- package/.docs/reference/voice/aws-nova-sonic.md +247 -0
- package/.docs/reference/voice/cloudflare.md +3 -3
- package/.docs/reference/voice/sarvam.md +29 -23
- package/.docs/reference/voice/voice.connect.md +4 -4
- package/.docs/reference/voice/voice.listen.md +3 -3
- package/.docs/reference/workflows/run-methods/resume.md +24 -0
- package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
- package/.docs/reference/workflows/step.md +88 -7
- package/.docs/reference/workflows/workflow-methods/foreach.md +14 -1
- package/.docs/reference/workflows/workflow.md +88 -4
- package/.docs/reference/workspace/azure-blob-filesystem.md +219 -0
- package/.docs/reference/workspace/docker-sandbox.md +196 -0
- package/.docs/reference/workspace/gcs-filesystem.md +1 -0
- package/.docs/reference/workspace/google-drive-filesystem.md +185 -0
- package/.docs/reference/workspace/modal-sandbox.md +168 -0
- package/.docs/reference/workspace/process-manager.md +1 -1
- package/.docs/reference/workspace/s3-filesystem.md +80 -5
- package/.docs/reference/workspace/vercel.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +37 -6
- package/CHANGELOG.md +500 -4
- package/dist/stdio.js.map +1 -1
- package/dist/utils.d.ts +1 -4
- package/dist/utils.d.ts.map +1 -1
- package/package.json +11 -11
- package/.docs/docs/mastra-cloud/deployment.md +0 -77
- package/.docs/docs/mastra-cloud/observability.md +0 -38
- package/.docs/docs/mastra-cloud/overview.md +0 -23
- package/.docs/docs/mastra-cloud/setup.md +0 -42
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Xiaomi Token Plan (Singapore)
|
|
2
|
+
|
|
3
|
+
Access 5 Xiaomi Token Plan (Singapore) models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [Xiaomi Token Plan (Singapore) documentation](https://platform.xiaomimimo.com/#/docs).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
XIAOMI_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: "xiaomi-token-plan-sgp/mimo-v2-omni"
|
|
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 [Xiaomi Token Plan (Singapore) documentation](https://platform.xiaomimimo.com/#/docs) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| ------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `xiaomi-token-plan-sgp/mimo-v2-omni` | 256K | | | | | | — | — |
|
|
38
|
+
| `xiaomi-token-plan-sgp/mimo-v2-pro` | 1.0M | | | | | | — | — |
|
|
39
|
+
| `xiaomi-token-plan-sgp/mimo-v2-tts` | 8K | | | | | | — | — |
|
|
40
|
+
| `xiaomi-token-plan-sgp/mimo-v2.5` | 1.0M | | | | | | — | — |
|
|
41
|
+
| `xiaomi-token-plan-sgp/mimo-v2.5-pro` | 1.0M | | | | | | — | — |
|
|
42
|
+
|
|
43
|
+
## Advanced configuration
|
|
44
|
+
|
|
45
|
+
### Custom headers
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
const agent = new Agent({
|
|
49
|
+
id: "custom-agent",
|
|
50
|
+
name: "custom-agent",
|
|
51
|
+
model: {
|
|
52
|
+
url: "https://token-plan-sgp.xiaomimimo.com/v1",
|
|
53
|
+
id: "xiaomi-token-plan-sgp/mimo-v2-omni",
|
|
54
|
+
apiKey: process.env.XIAOMI_API_KEY,
|
|
55
|
+
headers: {
|
|
56
|
+
"X-Custom-Header": "value"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Dynamic model selection
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
const agent = new Agent({
|
|
66
|
+
id: "dynamic-agent",
|
|
67
|
+
name: "Dynamic Agent",
|
|
68
|
+
model: ({ requestContext }) => {
|
|
69
|
+
const useAdvanced = requestContext.task === "complex";
|
|
70
|
+
return useAdvanced
|
|
71
|
+
? "xiaomi-token-plan-sgp/mimo-v2.5-pro"
|
|
72
|
+
: "xiaomi-token-plan-sgp/mimo-v2-omni";
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Xiaomi
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 5 Xiaomi models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Xiaomi documentation](https://platform.xiaomimimo.com/#/docs).
|
|
6
6
|
|
|
@@ -37,6 +37,8 @@ for await (const chunk of stream) {
|
|
|
37
37
|
| `xiaomi/mimo-v2-flash` | 256K | | | | | | $0.10 | $0.30 |
|
|
38
38
|
| `xiaomi/mimo-v2-omni` | 256K | | | | | | $0.40 | $2 |
|
|
39
39
|
| `xiaomi/mimo-v2-pro` | 1.0M | | | | | | $1 | $3 |
|
|
40
|
+
| `xiaomi/mimo-v2.5` | 1.0M | | | | | | $0.40 | $2 |
|
|
41
|
+
| `xiaomi/mimo-v2.5-pro` | 1.0M | | | | | | $1 | $3 |
|
|
40
42
|
|
|
41
43
|
## Advanced configuration
|
|
42
44
|
|
|
@@ -66,7 +68,7 @@ const agent = new Agent({
|
|
|
66
68
|
model: ({ requestContext }) => {
|
|
67
69
|
const useAdvanced = requestContext.task === "complex";
|
|
68
70
|
return useAdvanced
|
|
69
|
-
? "xiaomi/mimo-v2-pro"
|
|
71
|
+
? "xiaomi/mimo-v2.5-pro"
|
|
70
72
|
: "xiaomi/mimo-v2-flash";
|
|
71
73
|
}
|
|
72
74
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Z.AI Coding Plan
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 5 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
|
|
|
@@ -15,7 +15,7 @@ const agent = new Agent({
|
|
|
15
15
|
id: "my-agent",
|
|
16
16
|
name: "My Agent",
|
|
17
17
|
instructions: "You are a helpful assistant",
|
|
18
|
-
model: "zai-coding-plan/glm-4.5"
|
|
18
|
+
model: "zai-coding-plan/glm-4.5-air"
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
// Generate a response
|
|
@@ -32,21 +32,13 @@ for await (const chunk of stream) {
|
|
|
32
32
|
|
|
33
33
|
## Models
|
|
34
34
|
|
|
35
|
-
| Model
|
|
36
|
-
|
|
|
37
|
-
| `zai-coding-plan/glm-4.5`
|
|
38
|
-
| `zai-coding-plan/glm-4.
|
|
39
|
-
| `zai-coding-plan/glm-
|
|
40
|
-
| `zai-coding-plan/glm-
|
|
41
|
-
| `zai-coding-plan/glm-
|
|
42
|
-
| `zai-coding-plan/glm-4.6v` | 128K | | | | | | — | — |
|
|
43
|
-
| `zai-coding-plan/glm-4.7` | 205K | | | | | | — | — |
|
|
44
|
-
| `zai-coding-plan/glm-4.7-flash` | 200K | | | | | | — | — |
|
|
45
|
-
| `zai-coding-plan/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
|
|
46
|
-
| `zai-coding-plan/glm-5` | 205K | | | | | | — | — |
|
|
47
|
-
| `zai-coding-plan/glm-5-turbo` | 200K | | | | | | — | — |
|
|
48
|
-
| `zai-coding-plan/glm-5.1` | 200K | | | | | | — | — |
|
|
49
|
-
| `zai-coding-plan/glm-5v-turbo` | 200K | | | | | | — | — |
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| ------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `zai-coding-plan/glm-4.5-air` | 131K | | | | | | — | — |
|
|
38
|
+
| `zai-coding-plan/glm-4.7` | 205K | | | | | | — | — |
|
|
39
|
+
| `zai-coding-plan/glm-5-turbo` | 200K | | | | | | — | — |
|
|
40
|
+
| `zai-coding-plan/glm-5.1` | 200K | | | | | | — | — |
|
|
41
|
+
| `zai-coding-plan/glm-5v-turbo` | 200K | | | | | | — | — |
|
|
50
42
|
|
|
51
43
|
## Advanced configuration
|
|
52
44
|
|
|
@@ -58,7 +50,7 @@ const agent = new Agent({
|
|
|
58
50
|
name: "custom-agent",
|
|
59
51
|
model: {
|
|
60
52
|
url: "https://api.z.ai/api/coding/paas/v4",
|
|
61
|
-
id: "zai-coding-plan/glm-4.5",
|
|
53
|
+
id: "zai-coding-plan/glm-4.5-air",
|
|
62
54
|
apiKey: process.env.ZHIPU_API_KEY,
|
|
63
55
|
headers: {
|
|
64
56
|
"X-Custom-Header": "value"
|
|
@@ -77,7 +69,7 @@ const agent = new Agent({
|
|
|
77
69
|
const useAdvanced = requestContext.task === "complex";
|
|
78
70
|
return useAdvanced
|
|
79
71
|
? "zai-coding-plan/glm-5v-turbo"
|
|
80
|
-
: "zai-coding-plan/glm-4.5";
|
|
72
|
+
: "zai-coding-plan/glm-4.5-air";
|
|
81
73
|
}
|
|
82
74
|
});
|
|
83
75
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Z.AI
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 13 Z.AI 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 documentation](https://docs.z.ai/guides/overview/pricing).
|
|
6
6
|
|
|
@@ -45,6 +45,7 @@ for await (const chunk of stream) {
|
|
|
45
45
|
| `zai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
|
|
46
46
|
| `zai/glm-5` | 205K | | | | | | $1 | $3 |
|
|
47
47
|
| `zai/glm-5-turbo` | 200K | | | | | | $1 | $4 |
|
|
48
|
+
| `zai/glm-5.1` | 200K | | | | | | $1 | $4 |
|
|
48
49
|
| `zai/glm-5v-turbo` | 200K | | | | | | $1 | $4 |
|
|
49
50
|
|
|
50
51
|
## Advanced configuration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ZenMux
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 96 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [ZenMux documentation](https://docs.zenmux.ai).
|
|
6
6
|
|
|
@@ -41,6 +41,7 @@ for await (const chunk of stream) {
|
|
|
41
41
|
| `zenmux/anthropic/claude-opus-4.1` | 200K | | | | | | $15 | $75 |
|
|
42
42
|
| `zenmux/anthropic/claude-opus-4.5` | 200K | | | | | | $5 | $25 |
|
|
43
43
|
| `zenmux/anthropic/claude-opus-4.6` | 1.0M | | | | | | $5 | $25 |
|
|
44
|
+
| `zenmux/anthropic/claude-opus-4.7` | 1.0M | | | | | | $5 | $25 |
|
|
44
45
|
| `zenmux/anthropic/claude-sonnet-4` | 1.0M | | | | | | $3 | $15 |
|
|
45
46
|
| `zenmux/anthropic/claude-sonnet-4.5` | 1.0M | | | | | | $3 | $15 |
|
|
46
47
|
| `zenmux/anthropic/claude-sonnet-4.6` | 1.0M | | | | | | $3 | $15 |
|
|
@@ -48,17 +49,17 @@ for await (const chunk of stream) {
|
|
|
48
49
|
| `zenmux/deepseek/deepseek-chat` | 128K | | | | | | $0.28 | $0.42 |
|
|
49
50
|
| `zenmux/deepseek/deepseek-v3.2` | 128K | | | | | | $0.28 | $0.43 |
|
|
50
51
|
| `zenmux/deepseek/deepseek-v3.2-exp` | 163K | | | | | | $0.22 | $0.33 |
|
|
52
|
+
| `zenmux/deepseek/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
53
|
+
| `zenmux/deepseek/deepseek-v4-pro` | 1.0M | | | | | | $2 | $3 |
|
|
51
54
|
| `zenmux/google/gemini-2.5-flash` | 1.0M | | | | | | $0.30 | $3 |
|
|
52
55
|
| `zenmux/google/gemini-2.5-flash-lite` | 1.0M | | | | | | $0.10 | $0.40 |
|
|
53
56
|
| `zenmux/google/gemini-2.5-pro` | 1.0M | | | | | | $1 | $10 |
|
|
54
57
|
| `zenmux/google/gemini-3-flash-preview` | 1.0M | | | | | | $0.50 | $3 |
|
|
55
|
-
| `zenmux/google/gemini-3-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
56
58
|
| `zenmux/google/gemini-3.1-flash-lite-preview` | 1.1M | | | | | | $0.25 | $2 |
|
|
57
59
|
| `zenmux/google/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
58
60
|
| `zenmux/inclusionai/ling-1t` | 128K | | | | | | $0.56 | $2 |
|
|
59
61
|
| `zenmux/inclusionai/ring-1t` | 128K | | | | | | $0.56 | $2 |
|
|
60
|
-
| `zenmux/kuaishou/kat-coder-pro-
|
|
61
|
-
| `zenmux/kuaishou/kat-coder-pro-v1-free` | 256K | | | | | | — | — |
|
|
62
|
+
| `zenmux/kuaishou/kat-coder-pro-v2` | 256K | | | | | | $0.30 | $1 |
|
|
62
63
|
| `zenmux/minimax/minimax-m2` | 204K | | | | | | $0.30 | $1 |
|
|
63
64
|
| `zenmux/minimax/minimax-m2.1` | 204K | | | | | | $0.30 | $1 |
|
|
64
65
|
| `zenmux/minimax/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
|
|
@@ -69,6 +70,7 @@ for await (const chunk of stream) {
|
|
|
69
70
|
| `zenmux/moonshotai/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
|
|
70
71
|
| `zenmux/moonshotai/kimi-k2-thinking-turbo` | 262K | | | | | | $1 | $8 |
|
|
71
72
|
| `zenmux/moonshotai/kimi-k2.5` | 262K | | | | | | $0.58 | $3 |
|
|
73
|
+
| `zenmux/moonshotai/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
|
|
72
74
|
| `zenmux/openai/gpt-5` | 400K | | | | | | $1 | $10 |
|
|
73
75
|
| `zenmux/openai/gpt-5-codex` | 400K | | | | | | $1 | $10 |
|
|
74
76
|
| `zenmux/openai/gpt-5.1` | 400K | | | | | | $1 | $10 |
|
|
@@ -84,13 +86,19 @@ for await (const chunk of stream) {
|
|
|
84
86
|
| `zenmux/openai/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
|
|
85
87
|
| `zenmux/openai/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
|
|
86
88
|
| `zenmux/openai/gpt-5.4-pro` | 1.1M | | | | | | $45 | $225 |
|
|
89
|
+
| `zenmux/openai/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
|
|
90
|
+
| `zenmux/openai/gpt-5.5-pro` | 1.1M | | | | | | $30 | $180 |
|
|
87
91
|
| `zenmux/qwen/qwen3-coder-plus` | 1.0M | | | | | | $1 | $5 |
|
|
88
92
|
| `zenmux/qwen/qwen3-max` | 256K | | | | | | $1 | $6 |
|
|
89
93
|
| `zenmux/qwen/qwen3.5-flash` | 1.0M | | | | | | $0.10 | $0.40 |
|
|
90
94
|
| `zenmux/qwen/qwen3.5-plus` | 1.0M | | | | | | $0.80 | $5 |
|
|
95
|
+
| `zenmux/qwen/qwen3.6-plus` | 1.0M | | | | | | $0.50 | $3 |
|
|
96
|
+
| `zenmux/sapiens-ai/agnes-1.5-lite` | 256K | | | | | | $0.12 | $0.60 |
|
|
97
|
+
| `zenmux/sapiens-ai/agnes-1.5-pro` | 256K | | | | | | $0.16 | $0.80 |
|
|
91
98
|
| `zenmux/stepfun/step-3` | 66K | | | | | | $0.21 | $0.57 |
|
|
92
99
|
| `zenmux/stepfun/step-3.5-flash` | 256K | | | | | | $0.10 | $0.30 |
|
|
93
100
|
| `zenmux/stepfun/step-3.5-flash-free` | 256K | | | | | | — | — |
|
|
101
|
+
| `zenmux/tencent/hy3-preview` | 256K | | | | | | $0.17 | $0.57 |
|
|
94
102
|
| `zenmux/volcengine/doubao-seed-1.8` | 256K | | | | | | $0.11 | $0.28 |
|
|
95
103
|
| `zenmux/volcengine/doubao-seed-2.0-code` | 256K | | | | | | $0.90 | $4 |
|
|
96
104
|
| `zenmux/volcengine/doubao-seed-2.0-lite` | 256K | | | | | | $0.09 | $0.51 |
|
|
@@ -105,9 +113,10 @@ for await (const chunk of stream) {
|
|
|
105
113
|
| `zenmux/x-ai/grok-4.2-fast-non-reasoning` | 2.0M | | | | | | $3 | $9 |
|
|
106
114
|
| `zenmux/x-ai/grok-code-fast-1` | 256K | | | | | | $0.20 | $2 |
|
|
107
115
|
| `zenmux/xiaomi/mimo-v2-flash` | 262K | | | | | | $0.10 | $0.30 |
|
|
108
|
-
| `zenmux/xiaomi/mimo-v2-flash-free` | 262K | | | | | | — | — |
|
|
109
116
|
| `zenmux/xiaomi/mimo-v2-omni` | 265K | | | | | | $0.40 | $2 |
|
|
110
117
|
| `zenmux/xiaomi/mimo-v2-pro` | 1.0M | | | | | | $2 | $5 |
|
|
118
|
+
| `zenmux/xiaomi/mimo-v2.5` | 1.0M | | | | | | $0.40 | $2 |
|
|
119
|
+
| `zenmux/xiaomi/mimo-v2.5-pro` | 1.0M | | | | | | $1 | $3 |
|
|
111
120
|
| `zenmux/z-ai/glm-4.5` | 128K | | | | | | $0.35 | $2 |
|
|
112
121
|
| `zenmux/z-ai/glm-4.5-air` | 128K | | | | | | $0.11 | $0.56 |
|
|
113
122
|
| `zenmux/z-ai/glm-4.6` | 200K | | | | | | $0.35 | $2 |
|
|
@@ -119,6 +128,8 @@ for await (const chunk of stream) {
|
|
|
119
128
|
| `zenmux/z-ai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.42 |
|
|
120
129
|
| `zenmux/z-ai/glm-5` | 200K | | | | | | $0.58 | $3 |
|
|
121
130
|
| `zenmux/z-ai/glm-5-turbo` | 200K | | | | | | $0.88 | $3 |
|
|
131
|
+
| `zenmux/z-ai/glm-5.1` | 200K | | | | | | $0.88 | $4 |
|
|
132
|
+
| `zenmux/z-ai/glm-5v-turbo` | 200K | | | | | | $0.73 | $3 |
|
|
122
133
|
|
|
123
134
|
## Advanced configuration
|
|
124
135
|
|
|
@@ -148,7 +159,7 @@ const agent = new Agent({
|
|
|
148
159
|
model: ({ requestContext }) => {
|
|
149
160
|
const useAdvanced = requestContext.task === "complex";
|
|
150
161
|
return useAdvanced
|
|
151
|
-
? "zenmux/z-ai/glm-
|
|
162
|
+
? "zenmux/z-ai/glm-5v-turbo"
|
|
152
163
|
: "zenmux/anthropic/claude-3.5-haiku";
|
|
153
164
|
}
|
|
154
165
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zhipu AI Coding Plan
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 4 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
|
|
|
@@ -15,7 +15,7 @@ const agent = new Agent({
|
|
|
15
15
|
id: "my-agent",
|
|
16
16
|
name: "My Agent",
|
|
17
17
|
instructions: "You are a helpful assistant",
|
|
18
|
-
model: "zhipuai-coding-plan/glm-4.5"
|
|
18
|
+
model: "zhipuai-coding-plan/glm-4.5-air"
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
// Generate a response
|
|
@@ -32,22 +32,12 @@ for await (const chunk of stream) {
|
|
|
32
32
|
|
|
33
33
|
## Models
|
|
34
34
|
|
|
35
|
-
| Model
|
|
36
|
-
|
|
|
37
|
-
| `zhipuai-coding-plan/glm-4.5`
|
|
38
|
-
| `zhipuai-coding-plan/glm-4.
|
|
39
|
-
| `zhipuai-coding-plan/glm-
|
|
40
|
-
| `zhipuai-coding-plan/glm-
|
|
41
|
-
| `zhipuai-coding-plan/glm-4.6` | 205K | | | | | | — | — |
|
|
42
|
-
| `zhipuai-coding-plan/glm-4.6v` | 128K | | | | | | — | — |
|
|
43
|
-
| `zhipuai-coding-plan/glm-4.6v-flash` | 128K | | | | | | — | — |
|
|
44
|
-
| `zhipuai-coding-plan/glm-4.7` | 205K | | | | | | — | — |
|
|
45
|
-
| `zhipuai-coding-plan/glm-4.7-flash` | 200K | | | | | | — | — |
|
|
46
|
-
| `zhipuai-coding-plan/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
|
|
47
|
-
| `zhipuai-coding-plan/glm-5` | 205K | | | | | | — | — |
|
|
48
|
-
| `zhipuai-coding-plan/glm-5-turbo` | 200K | | | | | | — | — |
|
|
49
|
-
| `zhipuai-coding-plan/glm-5.1` | 200K | | | | | | — | — |
|
|
50
|
-
| `zhipuai-coding-plan/glm-5v-turbo` | 200K | | | | | | — | — |
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| --------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `zhipuai-coding-plan/glm-4.5-air` | 131K | | | | | | — | — |
|
|
38
|
+
| `zhipuai-coding-plan/glm-4.7` | 205K | | | | | | — | — |
|
|
39
|
+
| `zhipuai-coding-plan/glm-5-turbo` | 200K | | | | | | — | — |
|
|
40
|
+
| `zhipuai-coding-plan/glm-5.1` | 200K | | | | | | — | — |
|
|
51
41
|
|
|
52
42
|
## Advanced configuration
|
|
53
43
|
|
|
@@ -59,7 +49,7 @@ const agent = new Agent({
|
|
|
59
49
|
name: "custom-agent",
|
|
60
50
|
model: {
|
|
61
51
|
url: "https://open.bigmodel.cn/api/coding/paas/v4",
|
|
62
|
-
id: "zhipuai-coding-plan/glm-4.5",
|
|
52
|
+
id: "zhipuai-coding-plan/glm-4.5-air",
|
|
63
53
|
apiKey: process.env.ZHIPU_API_KEY,
|
|
64
54
|
headers: {
|
|
65
55
|
"X-Custom-Header": "value"
|
|
@@ -77,8 +67,8 @@ const agent = new Agent({
|
|
|
77
67
|
model: ({ requestContext }) => {
|
|
78
68
|
const useAdvanced = requestContext.task === "complex";
|
|
79
69
|
return useAdvanced
|
|
80
|
-
? "zhipuai-coding-plan/glm-
|
|
81
|
-
: "zhipuai-coding-plan/glm-4.5";
|
|
70
|
+
? "zhipuai-coding-plan/glm-5.1"
|
|
71
|
+
: "zhipuai-coding-plan/glm-4.5-air";
|
|
82
72
|
}
|
|
83
73
|
});
|
|
84
74
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zhipu AI
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 12 Zhipu AI 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 documentation](https://docs.z.ai/guides/overview/pricing).
|
|
6
6
|
|
|
@@ -44,6 +44,7 @@ for await (const chunk of stream) {
|
|
|
44
44
|
| `zhipuai/glm-4.7-flash` | 200K | | | | | | — | — |
|
|
45
45
|
| `zhipuai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
|
|
46
46
|
| `zhipuai/glm-5` | 205K | | | | | | $1 | $3 |
|
|
47
|
+
| `zhipuai/glm-5.1` | 200K | | | | | | $6 | $24 |
|
|
47
48
|
| `zhipuai/glm-5v-turbo` | 200K | | | | | | $5 | $22 |
|
|
48
49
|
|
|
49
50
|
## Advanced configuration
|
|
@@ -11,6 +11,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
11
11
|
- [xAI](https://mastra.ai/models/providers/xai)
|
|
12
12
|
- [302.AI](https://mastra.ai/models/providers/302ai)
|
|
13
13
|
- [Abacus](https://mastra.ai/models/providers/abacus)
|
|
14
|
+
- [abliteration.ai](https://mastra.ai/models/providers/abliteration-ai)
|
|
14
15
|
- [Alibaba](https://mastra.ai/models/providers/alibaba)
|
|
15
16
|
- [Alibaba (China)](https://mastra.ai/models/providers/alibaba-cn)
|
|
16
17
|
- [Alibaba Coding Plan](https://mastra.ai/models/providers/alibaba-coding-plan)
|
|
@@ -26,6 +27,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
26
27
|
- [Cortecs](https://mastra.ai/models/providers/cortecs)
|
|
27
28
|
- [D.Run (China)](https://mastra.ai/models/providers/drun)
|
|
28
29
|
- [Deep Infra](https://mastra.ai/models/providers/deepinfra)
|
|
30
|
+
- [DigitalOcean](https://mastra.ai/models/providers/digitalocean)
|
|
29
31
|
- [DInference](https://mastra.ai/models/providers/dinference)
|
|
30
32
|
- [evroc](https://mastra.ai/models/providers/evroc)
|
|
31
33
|
- [FastRouter](https://mastra.ai/models/providers/fastrouter)
|
|
@@ -34,6 +36,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
34
36
|
- [Friendli](https://mastra.ai/models/providers/friendli)
|
|
35
37
|
- [GitHub Models](https://mastra.ai/models/providers/github-models)
|
|
36
38
|
- [Helicone](https://mastra.ai/models/providers/helicone)
|
|
39
|
+
- [HPC-AI](https://mastra.ai/models/providers/hpc-ai)
|
|
37
40
|
- [Hugging Face](https://mastra.ai/models/providers/huggingface)
|
|
38
41
|
- [iFlow](https://mastra.ai/models/providers/iflowcn)
|
|
39
42
|
- [Inception](https://mastra.ai/models/providers/inception)
|
|
@@ -52,6 +55,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
52
55
|
- [MiniMax (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn)
|
|
53
56
|
- [MiniMax Coding Plan (minimax.io)](https://mastra.ai/models/providers/minimax-coding-plan)
|
|
54
57
|
- [MiniMax Coding Plan (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn-coding-plan)
|
|
58
|
+
- [Mixlayer](https://mastra.ai/models/providers/mixlayer)
|
|
55
59
|
- [Moark](https://mastra.ai/models/providers/moark)
|
|
56
60
|
- [ModelScope](https://mastra.ai/models/providers/modelscope)
|
|
57
61
|
- [Moonshot AI](https://mastra.ai/models/providers/moonshotai)
|
|
@@ -59,6 +63,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
59
63
|
- [Morph](https://mastra.ai/models/providers/morph)
|
|
60
64
|
- [NanoGPT](https://mastra.ai/models/providers/nano-gpt)
|
|
61
65
|
- [Nebius Token Factory](https://mastra.ai/models/providers/nebius)
|
|
66
|
+
- [Neuralwatt](https://mastra.ai/models/providers/neuralwatt)
|
|
62
67
|
- [Nova](https://mastra.ai/models/providers/nova)
|
|
63
68
|
- [NovitaAI](https://mastra.ai/models/providers/novita-ai)
|
|
64
69
|
- [Nvidia](https://mastra.ai/models/providers/nvidia)
|
|
@@ -72,6 +77,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
72
77
|
- [Privatemode AI](https://mastra.ai/models/providers/privatemode-ai)
|
|
73
78
|
- [QiHang](https://mastra.ai/models/providers/qihang-ai)
|
|
74
79
|
- [Qiniu](https://mastra.ai/models/providers/qiniu-ai)
|
|
80
|
+
- [Regolo AI](https://mastra.ai/models/providers/regolo-ai)
|
|
75
81
|
- [Requesty](https://mastra.ai/models/providers/requesty)
|
|
76
82
|
- [Scaleway](https://mastra.ai/models/providers/scaleway)
|
|
77
83
|
- [SiliconFlow](https://mastra.ai/models/providers/siliconflow)
|
|
@@ -81,13 +87,18 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
81
87
|
- [submodel](https://mastra.ai/models/providers/submodel)
|
|
82
88
|
- [Synthetic](https://mastra.ai/models/providers/synthetic)
|
|
83
89
|
- [Tencent Coding Plan (China)](https://mastra.ai/models/providers/tencent-coding-plan)
|
|
90
|
+
- [Tencent TokenHub](https://mastra.ai/models/providers/tencent-tokenhub)
|
|
84
91
|
- [The Grid AI](https://mastra.ai/models/providers/the-grid-ai)
|
|
85
92
|
- [Together AI](https://mastra.ai/models/providers/togetherai)
|
|
86
93
|
- [Upstage](https://mastra.ai/models/providers/upstage)
|
|
87
94
|
- [Vivgrid](https://mastra.ai/models/providers/vivgrid)
|
|
88
95
|
- [Vultr](https://mastra.ai/models/providers/vultr)
|
|
96
|
+
- [Wafer](https://mastra.ai/models/providers/wafer.ai)
|
|
89
97
|
- [Weights & Biases](https://mastra.ai/models/providers/wandb)
|
|
90
98
|
- [Xiaomi](https://mastra.ai/models/providers/xiaomi)
|
|
99
|
+
- [Xiaomi Token Plan (China)](https://mastra.ai/models/providers/xiaomi-token-plan-cn)
|
|
100
|
+
- [Xiaomi Token Plan (Europe)](https://mastra.ai/models/providers/xiaomi-token-plan-ams)
|
|
101
|
+
- [Xiaomi Token Plan (Singapore)](https://mastra.ai/models/providers/xiaomi-token-plan-sgp)
|
|
91
102
|
- [Z.AI](https://mastra.ai/models/providers/zai)
|
|
92
103
|
- [Z.AI Coding Plan](https://mastra.ai/models/providers/zai-coding-plan)
|
|
93
104
|
- [ZenMux](https://mastra.ai/models/providers/zenmux)
|
|
@@ -132,7 +132,7 @@ export const agent = new Agent({
|
|
|
132
132
|
|
|
133
133
|
**maxProcessorRetries** (`number`): Maximum number of times a processor can request retrying the LLM step.
|
|
134
134
|
|
|
135
|
-
**requestContextSchema** (`
|
|
135
|
+
**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.
|
|
136
136
|
|
|
137
137
|
## Returns
|
|
138
138
|
|
|
@@ -159,6 +159,6 @@ type InlineLinkEntry =
|
|
|
159
159
|
|
|
160
160
|
## Related
|
|
161
161
|
|
|
162
|
-
- [Channels guide](https://mastra.ai/docs/agents/channels)
|
|
163
|
-
- [Agent class](https://mastra.ai/reference/agents/agent)
|
|
164
|
-
- [Chat SDK adapters](https://chat-sdk.dev/adapters)
|
|
162
|
+
- [Channels guide](https://mastra.ai/docs/agents/channels): Concepts, quickstart, and platform setup
|
|
163
|
+
- [Agent class](https://mastra.ai/reference/agents/agent): Constructor parameters and methods
|
|
164
|
+
- [Chat SDK adapters](https://chat-sdk.dev/adapters): Adapter configuration and platform setup
|
|
@@ -184,7 +184,7 @@ const response = await agent.generate('Help me organize my day', {
|
|
|
184
184
|
|
|
185
185
|
**options.structuredOutput** (`StructuredOutputOptions<S extends ZodTypeAny = ZodTypeAny>`): Options to fine tune your structured output generation.
|
|
186
186
|
|
|
187
|
-
**options.structuredOutput.schema** (`
|
|
187
|
+
**options.structuredOutput.schema** (`StandardJSONSchemaV1`): Standard JSON Schema defining the expected output structure.
|
|
188
188
|
|
|
189
189
|
**options.structuredOutput.model** (`MastraLanguageModel`): Language model to use for structured output generation. If provided, enables the agent to respond in multi step with tool calls, text, and structured output
|
|
190
190
|
|
|
@@ -218,7 +218,7 @@ const response = await agent.generate('Help me organize my day', {
|
|
|
218
218
|
|
|
219
219
|
**options.memory.resource** (`string`): Resource identifier for organizing conversations by user, session, or context.
|
|
220
220
|
|
|
221
|
-
**options.memory.options** (`MemoryConfig`): Additional memory configuration options including lastMessages, readOnly, semanticRecall, and
|
|
221
|
+
**options.memory.options** (`MemoryConfig`): Additional memory configuration options including lastMessages, readOnly, semanticRecall, workingMemory, and filterIncompleteToolCalls.
|
|
222
222
|
|
|
223
223
|
**options.onFinish** (`LoopConfig['onFinish']`): Callback fired when generation completes.
|
|
224
224
|
|
|
@@ -266,7 +266,7 @@ const response = await agent.generate('Help me organize my day', {
|
|
|
266
266
|
|
|
267
267
|
**options.clientTools** (`ToolsInput`): Client-side tools available during execution.
|
|
268
268
|
|
|
269
|
-
**options.savePerStep** (`boolean`): Save messages incrementally after each generation step completes (default: false).
|
|
269
|
+
**options.savePerStep** (`boolean`): Save messages incrementally after each generation step completes (default: false). Disabled internally when observational memory is enabled.
|
|
270
270
|
|
|
271
271
|
**options.providerOptions** (`Record<string, Record<string, JSONValue>>`): Provider-specific options passed to the language model.
|
|
272
272
|
|
|
@@ -298,8 +298,44 @@ const response = await agent.generate('Help me organize my day', {
|
|
|
298
298
|
|
|
299
299
|
**options.tracingOptions.tags** (`string[]`): Tags to apply to this trace. String labels for categorizing and filtering traces.
|
|
300
300
|
|
|
301
|
+
**options.versions** (`VersionOverrides`): Per-invocation version overrides for sub-agent delegation. Merged on top of Mastra instance-level versions and propagated automatically through sub-agent calls via requestContext. Requires the editor package. See \[Sub-agent versioning]\(/docs/editor/overview#sub-agent-versioning).
|
|
302
|
+
|
|
303
|
+
**options.versions.agents** (`Record<string, VersionSelector>`): A map of agent IDs to their version selectors.
|
|
304
|
+
|
|
305
|
+
**options.versions.agents.versionId** (`string`): Target a specific version by ID.
|
|
306
|
+
|
|
307
|
+
**options.versions.agents.status** (`'draft' | 'published'`): Target the latest version with this publication status.
|
|
308
|
+
|
|
301
309
|
**options.includeRawChunks** (`boolean`): Whether to include raw chunks in the stream output. Not available on all model providers.
|
|
302
310
|
|
|
311
|
+
## Response structure
|
|
312
|
+
|
|
313
|
+
`Agent.generate()` returns the final data collected during execution. `steps` is an array of step objects. The tool arrays in the result, including top-level `toolCalls` and `toolResults` and the nested `step.toolCalls` and `step.toolResults` arrays, use Mastra's chunk format.
|
|
314
|
+
|
|
315
|
+
That means tool data is wrapped in `payload`:
|
|
316
|
+
|
|
317
|
+
```ts
|
|
318
|
+
const response = await agent.generate('Check the weather in Lagos')
|
|
319
|
+
|
|
320
|
+
for (const toolCall of response.toolCalls) {
|
|
321
|
+
console.log(toolCall.type) // 'tool-call'
|
|
322
|
+
console.log(toolCall.runId)
|
|
323
|
+
console.log(toolCall.from)
|
|
324
|
+
console.log(toolCall.payload.toolName)
|
|
325
|
+
console.log(toolCall.payload.args)
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
for (const step of response.steps) {
|
|
329
|
+
for (const toolResult of step.toolResults) {
|
|
330
|
+
console.log(toolResult.type) // 'tool-result'
|
|
331
|
+
console.log(toolResult.payload.toolName)
|
|
332
|
+
console.log(toolResult.payload.result)
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
For the streaming version of the same chunk shape, see the [ChunkType reference](https://mastra.ai/reference/streaming/ChunkType).
|
|
338
|
+
|
|
303
339
|
## Returns
|
|
304
340
|
|
|
305
341
|
**result** (`Awaited<ReturnType<MastraModelOutput<Output>['getFullOutput']>>`): Returns the full output of the generation process including text, object (if structured output), tool calls, tool results, usage statistics, and step information.
|
|
@@ -308,13 +344,59 @@ const response = await agent.generate('Help me organize my day', {
|
|
|
308
344
|
|
|
309
345
|
**object** (`Output | undefined`): The structured output object if structuredOutput was provided, validated against the schema.
|
|
310
346
|
|
|
311
|
-
**toolCalls** (`
|
|
347
|
+
**toolCalls** (`ToolCallChunk[]`): Array of tool call chunks made during generation.
|
|
348
|
+
|
|
349
|
+
**toolCalls.type** (`'tool-call'`): Chunk type identifier.
|
|
350
|
+
|
|
351
|
+
**toolCalls.runId** (`string`): Execution run identifier.
|
|
352
|
+
|
|
353
|
+
**toolCalls.from** (`ChunkFrom`): Source of the chunk, such as AGENT or WORKFLOW.
|
|
354
|
+
|
|
355
|
+
**toolCalls.payload** (`ToolCallPayload`): Tool call data.
|
|
356
|
+
|
|
357
|
+
**toolCalls.payload.toolCallId** (`string`): Unique identifier for the tool call.
|
|
358
|
+
|
|
359
|
+
**toolCalls.payload.toolName** (`string`): Name of the tool that was called.
|
|
312
360
|
|
|
313
|
-
**
|
|
361
|
+
**toolCalls.payload.args** (`Record<string, unknown>`): Arguments passed to the tool.
|
|
362
|
+
|
|
363
|
+
**toolCalls.payload.providerExecuted** (`boolean`): Whether the model provider executed the tool directly.
|
|
364
|
+
|
|
365
|
+
**toolResults** (`ToolResultChunk[]`): Array of tool result chunks from tool executions.
|
|
366
|
+
|
|
367
|
+
**toolResults.type** (`'tool-result'`): Chunk type identifier.
|
|
368
|
+
|
|
369
|
+
**toolResults.runId** (`string`): Execution run identifier.
|
|
370
|
+
|
|
371
|
+
**toolResults.from** (`ChunkFrom`): Source of the chunk, such as AGENT or WORKFLOW.
|
|
372
|
+
|
|
373
|
+
**toolResults.payload** (`ToolResultPayload`): Tool result data.
|
|
374
|
+
|
|
375
|
+
**toolResults.payload.toolCallId** (`string`): Unique identifier for the tool call.
|
|
376
|
+
|
|
377
|
+
**toolResults.payload.toolName** (`string`): Name of the tool that produced the result.
|
|
378
|
+
|
|
379
|
+
**toolResults.payload.result** (`unknown`): Value returned by the tool.
|
|
380
|
+
|
|
381
|
+
**toolResults.payload.isError** (`boolean`): Whether the tool execution failed.
|
|
314
382
|
|
|
315
383
|
**usage** (`TokenUsage`): Token usage statistics for the generation.
|
|
316
384
|
|
|
317
|
-
**steps** (`
|
|
385
|
+
**steps** (`object[]`): Array of execution steps, useful for debugging multi-step generations.
|
|
386
|
+
|
|
387
|
+
**steps.text** (`string`): Text generated in this step.
|
|
388
|
+
|
|
389
|
+
**steps.toolCalls** (`ToolCallChunk[]`): Tool calls emitted during this step.
|
|
390
|
+
|
|
391
|
+
**steps.toolResults** (`ToolResultChunk[]`): Tool results emitted during this step.
|
|
392
|
+
|
|
393
|
+
**steps.finishReason** (`string`): Why this step finished.
|
|
394
|
+
|
|
395
|
+
**steps.usage** (`LanguageModelUsage`): Token usage for this step.
|
|
396
|
+
|
|
397
|
+
**steps.request** (`{ body?: unknown }`): Request metadata for this step.
|
|
398
|
+
|
|
399
|
+
**steps.response** (`object`): Response metadata for this step.
|
|
318
400
|
|
|
319
401
|
**finishReason** (`string`): The reason generation finished. Values include 'stop' (normal completion), 'tool-calls' (ended with tool calls), 'suspended' (waiting for tool approval), or 'error' (error occurred).
|
|
320
402
|
|
|
@@ -84,7 +84,7 @@ await agent.generateLegacy('message for agent')
|
|
|
84
84
|
|
|
85
85
|
**options.clientTools** (`ToolsInput`): Tools that are executed on the 'client' side of the request. These tools do not have execute functions in the definition.
|
|
86
86
|
|
|
87
|
-
**options.savePerStep** (`boolean`): Save messages incrementally after each
|
|
87
|
+
**options.savePerStep** (`boolean`): Save messages incrementally after each generation step completes (default: false). Disabled internally when observational memory is enabled.
|
|
88
88
|
|
|
89
89
|
**options.providerOptions** (`Record<string, Record<string, JSONValue>>`): Additional provider-specific options that are passed through to the underlying LLM provider. The structure is \`{ providerName: { optionKey: value } }\`. Since Mastra extends AI SDK, see the \[AI SDK documentation]\(https\://sdk.vercel.ai/docs/providers/ai-sdk-providers) for complete provider options.
|
|
90
90
|
|
|
@@ -55,6 +55,8 @@ export const mastra = new Mastra({
|
|
|
55
55
|
|
|
56
56
|
**agent** (`string`): The ID of the agent to use for this chat route. Required if the path doesn't include \`:agentId\`.
|
|
57
57
|
|
|
58
|
+
**agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass \`{ versionId: '\<id>' }\` to target an exact version, or \`{ status: 'draft' }\` / \`{ status: 'published' }\` to resolve by status. When the route is called, query parameters \`?versionId=\<id>\` or \`?status=draft|published\` take precedence over this static value. Requires the \[Editor]\(/docs/editor/overview) to be configured.
|
|
59
|
+
|
|
58
60
|
**defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These can include instructions, memory configuration, maxSteps, and other execution settings.
|
|
59
61
|
|
|
60
62
|
**sendStart** (`boolean`): Whether to send start events in the stream. (Default: `true`)
|