@mastra/mcp-docs-server 1.2.7-alpha.12 → 1.2.7-alpha.16
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/using-tools.md +2 -0
- package/.docs/docs/evals/datasets/overview.md +2 -0
- package/.docs/docs/evals/datasets/running-experiments.md +2 -0
- package/.docs/docs/evals/gates-and-verdicts.md +17 -0
- package/.docs/docs/getting-started/file-based-agents.md +7 -4
- package/.docs/docs/mastra-platform/github.md +2 -2
- package/.docs/docs/observability/logging.md +2 -0
- package/.docs/docs/observability/metrics/querying.md +2 -0
- package/.docs/docs/observability/tracing/overview.md +2 -0
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/models/environment-variables.md +10 -2
- package/.docs/models/gateways/azure-openai.md +15 -15
- package/.docs/models/gateways/mastra.md +2 -2
- package/.docs/models/gateways/openrouter.md +1 -2
- package/.docs/models/gateways/vercel.md +4 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/ai-router.md +77 -0
- package/.docs/models/providers/ambient.md +4 -3
- package/.docs/models/providers/blueclaw.md +74 -0
- package/.docs/models/providers/crossmodel.md +4 -1
- package/.docs/models/providers/daoxe.md +81 -0
- package/.docs/models/providers/databricks.md +4 -2
- package/.docs/models/providers/deepinfra.md +2 -2
- package/.docs/models/providers/ebcloud.md +76 -0
- package/.docs/models/providers/hpc-ai.md +16 -10
- package/.docs/models/providers/inferx.md +78 -0
- package/.docs/models/providers/llmgateway.md +1 -3
- package/.docs/models/providers/lynkr.md +73 -0
- package/.docs/models/providers/neon.md +1 -1
- package/.docs/models/providers/stepfun-ai-step-plan.md +75 -0
- package/.docs/models/providers/stepfun-ai.md +6 -6
- package/.docs/models/providers/stepfun-step-plan.md +76 -0
- package/.docs/models/providers/stepfun.md +5 -5
- package/.docs/models/providers/vivgrid.md +5 -2
- package/.docs/models/providers/wafer.ai.md +9 -12
- package/.docs/models/providers/zenmux.md +5 -1
- package/.docs/models/providers.md +10 -2
- package/.docs/reference/coding-agent/create-coding-agent.md +5 -4
- package/.docs/reference/evals/run-evals.md +2 -2
- package/.docs/reference/mastra-platform/api.md +1 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +8 -8
- package/.docs/reference/observability/tracing/exporters/braintrust.md +1 -0
- package/.docs/reference/observability/tracing/exporters/datadog.md +10 -9
- package/.docs/reference/observability/tracing/exporters/langsmith.md +8 -7
- package/.docs/reference/observability/tracing/exporters/posthog.md +13 -12
- package/.docs/reference/observability/tracing/exporters/sentry.md +1 -0
- package/.docs/reference/observability/tracing/interfaces.md +9 -0
- package/.docs/reference/processors/stream-error-retry-processor.md +25 -0
- package/.docs/reference/server/register-api-route.md +5 -4
- package/.docs/reference/templates/overview.md +1 -1
- package/CHANGELOG.md +14 -0
- package/package.json +5 -5
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Agents use tools to call APIs, query databases, or run custom functions from your codebase. Tools give agents capabilities beyond language generation by providing structured access to data and performing clearly defined operations. You can also load tools from remote [MCP servers](https://mastra.ai/docs/mcp/overview) to expand an agent's capabilities.
|
|
6
6
|
|
|
7
|
+
**For AI agents:** Run `npx mastra api tool execute weather-tool '{"location":"San Francisco"}'` to test this tool directly instead of writing a temporary script. The command requires a running Mastra server; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api tool execute --schema` before constructing different input. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
8
|
+
|
|
7
9
|
## When to use tools
|
|
8
10
|
|
|
9
11
|
Use tools when an agent needs additional context or information from remote resources, or when it needs to run code that performs a specific operation. This includes tasks a model can't reliably handle on its own, such as fetching live data or returning consistent, well-defined outputs.
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
Datasets are collections of test cases that you run experiments against to measure how well your agents and workflows perform. Each mutation creates a new version, so you can reproduce past experiments exactly. Pair datasets with [scorers](https://mastra.ai/docs/evals/overview) to track quality across prompts, models, or code changes.
|
|
8
8
|
|
|
9
|
+
**For AI agents:** Run `npx mastra api dataset create '{"name":"translation-pairs"}'` to create a dataset directly instead of opening Studio or writing a temporary script. The command requires a running Mastra server with a storage adapter that supports datasets; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api dataset create --schema` before adding different dataset fields. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
|
+
|
|
9
11
|
## Usage
|
|
10
12
|
|
|
11
13
|
### Configure storage
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
An experiment runs every item in a dataset through a target (an agent, a workflow, or a scorer) and then optionally scores the outputs. Use a scorer as the target when you want to evaluate an LLM judge itself. Results are persisted to storage so you can compare runs across different prompts, models, or code changes.
|
|
8
8
|
|
|
9
|
+
**For AI agents:** Run `npx mastra api experiment run dataset_123 '{"name":"translation-baseline"}'` to start an experiment directly instead of opening Studio or writing a temporary script. Use a dataset ID returned by `npx mastra api dataset list` in place of the sample ID. The command requires a running Mastra server with dataset storage and registered experiment targets; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api experiment run --schema` before constructing different input, and get user approval before starting an experiment because it can make model calls. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
|
+
|
|
9
11
|
## Basic experiment
|
|
10
12
|
|
|
11
13
|
Call [`startExperiment()`](https://mastra.ai/reference/datasets/startExperiment) with a target and scorers:
|
|
@@ -66,6 +66,23 @@ const result = await runEvals({
|
|
|
66
66
|
|
|
67
67
|
Any scorer works as a gate. Quick Checks are a natural fit because they return binary 1/0 scores. Visit [runEvals() reference](https://mastra.ai/reference/evals/run-evals) for the full parameter and return type documentation.
|
|
68
68
|
|
|
69
|
+
### Gate-only runs
|
|
70
|
+
|
|
71
|
+
`scorers` is optional when at least one gate is provided. This is useful for deterministic CI checks where you only care about pass/fail gates and don't need to track any quality metrics.
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { runEvals } from '@mastra/core/evals'
|
|
75
|
+
import { checks } from '@mastra/evals/checks'
|
|
76
|
+
|
|
77
|
+
const result = await runEvals({
|
|
78
|
+
data: [{ input: 'What is the weather in Brooklyn?' }],
|
|
79
|
+
target: weatherAgent,
|
|
80
|
+
gates: [checks.calledTool('get_weather'), checks.noToolErrors()],
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
You must provide at least one scorer or gate — a run with neither throws an error.
|
|
85
|
+
|
|
69
86
|
## Thresholds
|
|
70
87
|
|
|
71
88
|
Wrap a scorer in `{ scorer, threshold }` to set pass/fail bounds. The threshold is compared against the scorer's average score across all data items.
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
> **Beta:** This feature is in beta. Breaking changes may occur without a major version bump until the API is stable.
|
|
8
8
|
|
|
9
|
-
File-based agents are
|
|
9
|
+
File-based agents are an experimental, convention-based way to define [Mastra agents](https://mastra.ai/docs/agents/overview) and the primitives they use in files under `src/mastra/`, instead of registering them manually on your [`Mastra`](https://mastra.ai/reference/core/mastra-class) instance.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
This approach reduces glue code and makes the file system itself a direct representation of your [project structure](https://mastra.ai/reference/project-structure), so both you and your coding agent can understand it at a glance.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
You can build your entire project with file-based agents or combine this approach with agents and other primitives defined directly in code, making it easy to adopt incrementally.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
File-based agents have some limitations while in beta. Not every Mastra feature can be defined in a file yet, and they are not the best fit for dynamic configuration or runtime wiring. When needed, you can define agents and related primitives directly in code.
|
|
16
|
+
|
|
17
|
+
> **Note:** All Mastra documentation currently shows agents and primitives defined directly in code. File-based agents use the same underlying concepts and APIs, so the guidance elsewhere in the docs still applies. As file-based agents mature, more examples may use this structure where appropriate.
|
|
16
18
|
|
|
17
19
|
## Basic layout
|
|
18
20
|
|
|
@@ -78,6 +80,7 @@ Map each primitive or feature to its file convention:
|
|
|
78
80
|
| [Logger](https://mastra.ai/reference/file-based-agents/logger) | `src/mastra/logger.ts` |
|
|
79
81
|
| [Server config](https://mastra.ai/reference/file-based-agents/server) | `src/mastra/server.ts` |
|
|
80
82
|
| [Studio config](https://mastra.ai/reference/file-based-agents/studio) | `src/mastra/studio.ts` |
|
|
83
|
+
| [Schedules](https://mastra.ai/docs/long-running-agents/schedules) | Not yet file-based — create at runtime with `mastra.schedules.create()` |
|
|
81
84
|
|
|
82
85
|
## Discovery lifecycle
|
|
83
86
|
|
|
@@ -9,7 +9,7 @@ The GitHub integration links a Mastra platform project to a GitHub repository. W
|
|
|
9
9
|
After a repository is linked, the platform:
|
|
10
10
|
|
|
11
11
|
- Builds and deploys Studio and Server on every push to the configured branches.
|
|
12
|
-
- Provisions managed databases and the
|
|
12
|
+
- Provisions managed databases and the Gateway API key for projects created from a template.
|
|
13
13
|
- Surfaces commit, branch, and pull request context on each deploy.
|
|
14
14
|
- Reports build status back to GitHub as check runs and to the project dashboard with live status badges and inline logs.
|
|
15
15
|
|
|
@@ -59,7 +59,7 @@ Templates are the fastest way to get started. The platform creates a new reposit
|
|
|
59
59
|
|
|
60
60
|
3. Configure the template's managed database requirements. Templates can declare required databases (such as Turso or Neon) and you pick the provider and region per requirement.
|
|
61
61
|
|
|
62
|
-
4. Add any template-specific environment variables (for example, AI provider API keys). The platform seeds `MASTRA_GATEWAY_API_KEY` and `MASTRA_PLATFORM_ACCESS_TOKEN` automatically so that template code that talks to the
|
|
62
|
+
4. Add any template-specific environment variables (for example, AI provider API keys). The platform seeds `MASTRA_GATEWAY_API_KEY` and `MASTRA_PLATFORM_ACCESS_TOKEN` automatically so that template code that talks to the Gateway works on the first deploy.
|
|
63
63
|
|
|
64
64
|
5. Select **Create project**. The platform creates the repository, writes a `.mastra-project.json` config file into it, provisions the managed databases, and triggers the initial Studio and Server deploys.
|
|
65
65
|
|
|
@@ -6,6 +6,8 @@ Mastra's logging system captures function execution, input data, and output resp
|
|
|
6
6
|
|
|
7
7
|
When deploying to the Mastra platform, logs are shown in the dashboard. In self-hosted or custom environments, logs can be directed to files or external services depending on the configured transports.
|
|
8
8
|
|
|
9
|
+
**For AI agents:** Run `npx mastra api log list '{"level":"error","page":0,"perPage":50}'` to inspect recent error logs directly instead of opening Studio or writing a temporary script. The command requires a running Mastra server with observability logging configured; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api log list --schema` before constructing different filters. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
|
+
|
|
9
11
|
## Configuring logs with `PinoLogger`
|
|
10
12
|
|
|
11
13
|
When [initializing a new Mastra project](https://mastra.ai/guides/getting-started/quickstart) using the CLI, `PinoLogger` is included by default.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Mastra exposes the same five OLAP queries (`getMetricAggregate`, `getMetricBreakdown`, `getMetricTimeSeries`, `getMetricPercentiles`, and discovery helpers) through three surfaces: an in-process store accessor, the runtime HTTP API, and the `mastra api metric` CLI. All three accept the same Zod-validated input shapes, so you can move from a one-off CLI investigation to a programmatic dashboard tool without re-learning the API.
|
|
6
6
|
|
|
7
|
+
**For AI agents:** Run `npx mastra api metric aggregate '{"name":"mastra_agent_duration_ms","aggregation":"avg"}'` to query average agent latency directly instead of writing a temporary script. Querying local metrics requires a running Mastra server with an OLAP-capable observability store; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api metric aggregate --schema` before constructing a different query. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
8
|
+
|
|
7
9
|
## When to use this
|
|
8
10
|
|
|
9
11
|
- Build a custom dashboard or KPI tile alongside Studio.
|
|
@@ -6,6 +6,8 @@ Tracing is the observability signal that records how a request moves through age
|
|
|
6
6
|
|
|
7
7
|
This page focuses on trace-specific concepts: span hierarchy, sampling, metadata, filtering, trace IDs, and third-party trace context.
|
|
8
8
|
|
|
9
|
+
**For AI agents:** Run `npx mastra api trace list '{"page":0,"perPage":20}'` to inspect recent traces directly instead of opening Studio or writing a temporary script. The command requires a running Mastra server with observability configured; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api trace list --schema` before constructing different filters. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
|
+
|
|
9
11
|
## When to use tracing
|
|
10
12
|
|
|
11
13
|
- Debug unexpected agent or workflow behavior by inspecting the full execution path.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Workflows let you define complex sequences of tasks using clear, structured steps rather than relying on the reasoning of a single agent. They give you full control over how tasks are broken down, how data moves between them, and what gets executed when. Workflows run using the built-in execution engine by default, or can be deployed to [workflow runners](https://mastra.ai/docs/deployment/workflow-runners) like Inngest for managed infrastructure.
|
|
6
6
|
|
|
7
|
-
!
|
|
7
|
+
**For AI agents:** Run `npx mastra api workflow run start test-workflow '{"inputData":{"message":"Hello, world!"}}'` to start this workflow directly instead of writing a temporary script. The command requires a running Mastra server; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api workflow run start --schema` before constructing different input. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
8
8
|
|
|
9
9
|
## When to use workflows
|
|
10
10
|
|
|
@@ -9,6 +9,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
9
9
|
| [302.AI](https://mastra.ai/models/providers/302ai) | `302ai/*` | `302AI_API_KEY` |
|
|
10
10
|
| [Abacus](https://mastra.ai/models/providers/abacus) | `abacus/*` | `ABACUS_API_KEY` |
|
|
11
11
|
| [abliteration.ai](https://mastra.ai/models/providers/abliteration-ai) | `abliteration-ai/*` | `ABLIT_KEY` |
|
|
12
|
+
| [AI-ROUTER](https://mastra.ai/models/providers/ai-router) | `ai-router/*` | `AI_ROUTER_API_KEY` |
|
|
12
13
|
| [Alibaba](https://mastra.ai/models/providers/alibaba) | `alibaba/*` | `DASHSCOPE_API_KEY` |
|
|
13
14
|
| [Alibaba (China)](https://mastra.ai/models/providers/alibaba-cn) | `alibaba-cn/*` | `DASHSCOPE_API_KEY` |
|
|
14
15
|
| [Alibaba Coding Plan](https://mastra.ai/models/providers/alibaba-coding-plan) | `alibaba-coding-plan/*` | `ALIBABA_CODING_PLAN_API_KEY` |
|
|
@@ -23,6 +24,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
23
24
|
| [Bailing](https://mastra.ai/models/providers/bailing) | `bailing/*` | `BAILING_API_TOKEN` |
|
|
24
25
|
| [Baseten](https://mastra.ai/models/providers/baseten) | `baseten/*` | `BASETEN_API_KEY` |
|
|
25
26
|
| [Berget.AI](https://mastra.ai/models/providers/berget) | `berget/*` | `BERGET_API_KEY` |
|
|
27
|
+
| [Blue Claw](https://mastra.ai/models/providers/blueclaw) | `blueclaw/*` | `BLUECLAW_API_KEY` |
|
|
26
28
|
| [Cerebras](https://mastra.ai/models/providers/cerebras) | `cerebras/*` | `CEREBRAS_API_KEY` |
|
|
27
29
|
| [Chutes](https://mastra.ai/models/providers/chutes) | `chutes/*` | `CHUTES_API_KEY` |
|
|
28
30
|
| [Clarifai](https://mastra.ai/models/providers/clarifai) | `clarifai/*` | `CLARIFAI_PAT` |
|
|
@@ -33,11 +35,13 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
33
35
|
| [CrofAI](https://mastra.ai/models/providers/crof) | `crof/*` | `CROF_API_KEY` |
|
|
34
36
|
| [CrossModel](https://mastra.ai/models/providers/crossmodel) | `crossmodel/*` | `CROSSMODEL_API_KEY` |
|
|
35
37
|
| [D.Run (China)](https://mastra.ai/models/providers/drun) | `drun/*` | `DRUN_API_KEY` |
|
|
38
|
+
| [DaoXE](https://mastra.ai/models/providers/daoxe) | `daoxe/*` | `DAOXE_API_KEY` |
|
|
36
39
|
| [Databricks](https://mastra.ai/models/providers/databricks) | `databricks/*` | `DATABRICKS_HOST`, `DATABRICKS_TOKEN` |
|
|
37
40
|
| [Deep Infra](https://mastra.ai/models/providers/deepinfra) | `deepinfra/*` | `DEEPINFRA_API_KEY` |
|
|
38
41
|
| [DeepSeek](https://mastra.ai/models/providers/deepseek) | `deepseek/*` | `DEEPSEEK_API_KEY` |
|
|
39
42
|
| [DigitalOcean](https://mastra.ai/models/providers/digitalocean) | `digitalocean/*` | `DIGITALOCEAN_ACCESS_TOKEN` |
|
|
40
43
|
| [DInference](https://mastra.ai/models/providers/dinference) | `dinference/*` | `DINFERENCE_API_KEY` |
|
|
44
|
+
| [EBCloud](https://mastra.ai/models/providers/ebcloud) | `ebcloud/*` | `EBCLOUD_API_KEY` |
|
|
41
45
|
| [EmpirioLabs AI](https://mastra.ai/models/providers/empiriolabs) | `empiriolabs/*` | `EMPIRIOLABS_API_KEY` |
|
|
42
46
|
| [evroc](https://mastra.ai/models/providers/evroc) | `evroc/*` | `EVROC_API_KEY` |
|
|
43
47
|
| [FastRouter](https://mastra.ai/models/providers/fastrouter) | `fastrouter/*` | `FASTROUTER_API_KEY` |
|
|
@@ -56,6 +60,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
56
60
|
| [Inception](https://mastra.ai/models/providers/inception) | `inception/*` | `INCEPTION_API_KEY` |
|
|
57
61
|
| [Inceptron](https://mastra.ai/models/providers/inceptron) | `inceptron/*` | `INCEPTRON_API_KEY` |
|
|
58
62
|
| [Inference](https://mastra.ai/models/providers/inference) | `inference/*` | `INFERENCE_API_KEY` |
|
|
63
|
+
| [InferX](https://mastra.ai/models/providers/inferx) | `inferx/*` | `INFERX_API_KEY` |
|
|
59
64
|
| [IO.NET](https://mastra.ai/models/providers/io-net) | `io-net/*` | `IOINTELLIGENCE_API_KEY` |
|
|
60
65
|
| [Jiekou.AI](https://mastra.ai/models/providers/jiekou) | `jiekou/*` | `JIEKOU_API_KEY` |
|
|
61
66
|
| [Kenari](https://mastra.ai/models/providers/kenari) | `kenari/*` | `KENARI_API_KEY` |
|
|
@@ -69,6 +74,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
69
74
|
| [LMStudio](https://mastra.ai/models/providers/lmstudio) | `lmstudio/*` | `LMSTUDIO_API_KEY` |
|
|
70
75
|
| [LongCat](https://mastra.ai/models/providers/longcat) | `longcat/*` | `LONGCAT_API_KEY` |
|
|
71
76
|
| [LucidQuery](https://mastra.ai/models/providers/lucidquery) | `lucidquery/*` | `LUCIDQUERY_API_KEY` |
|
|
77
|
+
| [Lynkr](https://mastra.ai/models/providers/lynkr) | `lynkr/*` | `LYNKR_API_KEY` |
|
|
72
78
|
| [Meganova](https://mastra.ai/models/providers/meganova) | `meganova/*` | `MEGANOVA_API_KEY` |
|
|
73
79
|
| [Meta](https://mastra.ai/models/providers/meta) | `meta/*` | `META_MODEL_API_KEY` |
|
|
74
80
|
| [MiniMax (minimax.io)](https://mastra.ai/models/providers/minimax) | `minimax/*` | `MINIMAX_API_KEY` |
|
|
@@ -115,8 +121,10 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
115
121
|
| [SiliconFlow (China)](https://mastra.ai/models/providers/siliconflow-cn) | `siliconflow-cn/*` | `SILICONFLOW_CN_API_KEY` |
|
|
116
122
|
| [Snowflake Cortex](https://mastra.ai/models/providers/snowflake-cortex) | `snowflake-cortex/*` | `SNOWFLAKE_ACCOUNT`, `SNOWFLAKE_CORTEX_PAT` |
|
|
117
123
|
| [STACKIT](https://mastra.ai/models/providers/stackit) | `stackit/*` | `STACKIT_API_KEY` |
|
|
118
|
-
| [StepFun](https://mastra.ai/models/providers/stepfun)
|
|
119
|
-
| [StepFun
|
|
124
|
+
| [StepFun (China)](https://mastra.ai/models/providers/stepfun) | `stepfun/*` | `STEPFUN_API_KEY` |
|
|
125
|
+
| [StepFun (Global)](https://mastra.ai/models/providers/stepfun-ai) | `stepfun-ai/*` | `STEPFUN_API_KEY` |
|
|
126
|
+
| [StepFun Step Plan (China)](https://mastra.ai/models/providers/stepfun-step-plan) | `stepfun-step-plan/*` | `STEPFUN_API_KEY` |
|
|
127
|
+
| [StepFun Step Plan (Global)](https://mastra.ai/models/providers/stepfun-ai-step-plan) | `stepfun-ai-step-plan/*` | `STEPFUN_API_KEY` |
|
|
120
128
|
| [Subconscious](https://mastra.ai/models/providers/subconscious) | `subconscious/*` | `SUBCONSCIOUS_API_KEY` |
|
|
121
129
|
| [submodel](https://mastra.ai/models/providers/submodel) | `submodel/*` | `SUBMODEL_INSTAGEN_ACCESS_KEY` |
|
|
122
130
|
| [Synthetic](https://mastra.ai/models/providers/synthetic) | `synthetic/*` | `SYNTHETIC_API_KEY` |
|
|
@@ -57,13 +57,13 @@ import { Mastra } from "@mastra/core";
|
|
|
57
57
|
import { AzureOpenAIGateway } from "@mastra/core/llm";
|
|
58
58
|
|
|
59
59
|
export const mastra = new Mastra({
|
|
60
|
-
gateways:
|
|
61
|
-
new AzureOpenAIGateway({
|
|
60
|
+
gateways: {
|
|
61
|
+
"azure-openai": new AzureOpenAIGateway({
|
|
62
62
|
resourceName: "my-openai-resource",
|
|
63
63
|
apiKey: process.env.AZURE_API_KEY!,
|
|
64
64
|
deployments: ["gpt-5-4-prod", "gpt-5-4-mini-dev"],
|
|
65
65
|
}),
|
|
66
|
-
|
|
66
|
+
},
|
|
67
67
|
});
|
|
68
68
|
```
|
|
69
69
|
|
|
@@ -76,8 +76,8 @@ import { Mastra } from "@mastra/core";
|
|
|
76
76
|
import { AzureOpenAIGateway } from "@mastra/core/llm";
|
|
77
77
|
|
|
78
78
|
export const mastra = new Mastra({
|
|
79
|
-
gateways:
|
|
80
|
-
new AzureOpenAIGateway({
|
|
79
|
+
gateways: {
|
|
80
|
+
"azure-openai": new AzureOpenAIGateway({
|
|
81
81
|
resourceName: "my-openai-resource",
|
|
82
82
|
apiKey: process.env.AZURE_API_KEY!,
|
|
83
83
|
management: {
|
|
@@ -88,7 +88,7 @@ export const mastra = new Mastra({
|
|
|
88
88
|
resourceGroup: "my-resource-group",
|
|
89
89
|
},
|
|
90
90
|
}),
|
|
91
|
-
|
|
91
|
+
},
|
|
92
92
|
});
|
|
93
93
|
```
|
|
94
94
|
|
|
@@ -106,8 +106,8 @@ import { Mastra } from "@mastra/core";
|
|
|
106
106
|
import { AzureOpenAIGateway } from "@mastra/core/llm";
|
|
107
107
|
|
|
108
108
|
export const mastra = new Mastra({
|
|
109
|
-
gateways:
|
|
110
|
-
new AzureOpenAIGateway({
|
|
109
|
+
gateways: {
|
|
110
|
+
"azure-openai": new AzureOpenAIGateway({
|
|
111
111
|
resourceName: "my-openai-resource",
|
|
112
112
|
authentication: {
|
|
113
113
|
type: "entraId",
|
|
@@ -115,7 +115,7 @@ export const mastra = new Mastra({
|
|
|
115
115
|
},
|
|
116
116
|
deployments: ["gpt-5-4-prod", "gpt-5-4-mini-dev"],
|
|
117
117
|
}),
|
|
118
|
-
|
|
118
|
+
},
|
|
119
119
|
});
|
|
120
120
|
```
|
|
121
121
|
|
|
@@ -138,12 +138,12 @@ import { Mastra } from "@mastra/core";
|
|
|
138
138
|
import { AzureOpenAIGateway } from "@mastra/core/llm";
|
|
139
139
|
|
|
140
140
|
export const mastra = new Mastra({
|
|
141
|
-
gateways:
|
|
142
|
-
new AzureOpenAIGateway({
|
|
141
|
+
gateways: {
|
|
142
|
+
"azure-openai": new AzureOpenAIGateway({
|
|
143
143
|
resourceName: "my-openai-resource",
|
|
144
144
|
apiKey: process.env.AZURE_API_KEY!,
|
|
145
145
|
}),
|
|
146
|
-
|
|
146
|
+
},
|
|
147
147
|
});
|
|
148
148
|
```
|
|
149
149
|
|
|
@@ -156,14 +156,14 @@ import { Mastra } from "@mastra/core";
|
|
|
156
156
|
import { AzureOpenAIGateway } from "@mastra/core/llm";
|
|
157
157
|
|
|
158
158
|
export const mastra = new Mastra({
|
|
159
|
-
gateways:
|
|
160
|
-
new AzureOpenAIGateway({
|
|
159
|
+
gateways: {
|
|
160
|
+
"azure-openai": new AzureOpenAIGateway({
|
|
161
161
|
resourceName: "my-openai-resource",
|
|
162
162
|
apiKey: process.env.AZURE_API_KEY!,
|
|
163
163
|
useResponsesAPI: true,
|
|
164
164
|
deployments: ["my-gpt-5-4-deployment"],
|
|
165
165
|
}),
|
|
166
|
-
|
|
166
|
+
},
|
|
167
167
|
});
|
|
168
168
|
```
|
|
169
169
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Mastra
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The Gateway is an OpenAI-compatible API proxy with built-in [Observational Memory](https://gateway.mastra.ai/docs/features#observational-memory). Point any HTTP client, SDK, or framework at the gateway and every conversation is automatically remembered without any memory management code.
|
|
6
6
|
|
|
7
|
-
Learn more in the [
|
|
7
|
+
Learn more in the [Gateway documentation](https://gateway.mastra.ai/docs).
|
|
8
8
|
|
|
9
9
|
## Get an API key
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# OpenRouter
|
|
4
4
|
|
|
5
|
-
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
5
|
+
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 344 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
|
|
8
8
|
|
|
@@ -142,7 +142,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
142
142
|
| `liquid/lfm-2.5-1.2b-instruct:free` |
|
|
143
143
|
| `liquid/lfm-2.5-1.2b-thinking:free` |
|
|
144
144
|
| `mancer/weaver` |
|
|
145
|
-
| `meta-llama/llama-3-8b-instruct` |
|
|
146
145
|
| `meta-llama/llama-3.1-70b-instruct` |
|
|
147
146
|
| `meta-llama/llama-3.1-8b-instruct` |
|
|
148
147
|
| `meta-llama/llama-3.2-11b-vision-instruct` |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Vercel
|
|
4
4
|
|
|
5
|
-
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
5
|
+
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 309 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
|
|
8
8
|
|
|
@@ -112,6 +112,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
112
112
|
| `bytedance/seedream-4.0` |
|
|
113
113
|
| `bytedance/seedream-4.5` |
|
|
114
114
|
| `bytedance/seedream-5.0-lite` |
|
|
115
|
+
| `bytedance/seedream-5.0-pro` |
|
|
115
116
|
| `cohere/command-a` |
|
|
116
117
|
| `cohere/embed-v4.0` |
|
|
117
118
|
| `cohere/rerank-v3.5` |
|
|
@@ -164,8 +165,10 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
164
165
|
| `klingai/kling-v3.0-i2v` |
|
|
165
166
|
| `klingai/kling-v3.0-motion-control` |
|
|
166
167
|
| `klingai/kling-v3.0-t2v` |
|
|
168
|
+
| `kwaipilot/kat-coder-air-v2.5` |
|
|
167
169
|
| `kwaipilot/kat-coder-pro-v1` |
|
|
168
170
|
| `kwaipilot/kat-coder-pro-v2` |
|
|
171
|
+
| `kwaipilot/kat-coder-pro-v2.5` |
|
|
169
172
|
| `meituan/longcat-flash-chat` |
|
|
170
173
|
| `meituan/longcat-flash-thinking-2601` |
|
|
171
174
|
| `meta/llama-3.1-70b` |
|
package/.docs/models/index.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Model Providers
|
|
4
4
|
|
|
5
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
5
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 4868 models from 155 providers through a single API.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# AI-ROUTER
|
|
4
|
+
|
|
5
|
+
Access 5 AI-ROUTER models through Mastra's model router. Authentication is handled automatically using the `AI_ROUTER_API_KEY` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [AI-ROUTER documentation](https://ai-router.dev/openai-compatible-api-gateway/).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
AI_ROUTER_API_KEY=your-api-key
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Agent } from "@mastra/core/agent";
|
|
15
|
+
|
|
16
|
+
const agent = new Agent({
|
|
17
|
+
id: "my-agent",
|
|
18
|
+
name: "My Agent",
|
|
19
|
+
instructions: "You are a helpful assistant",
|
|
20
|
+
model: "ai-router/gpt-5.4"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Generate a response
|
|
24
|
+
const response = await agent.generate("Hello!");
|
|
25
|
+
|
|
26
|
+
// Stream a response
|
|
27
|
+
const stream = await agent.stream("Tell me a story");
|
|
28
|
+
for await (const chunk of stream) {
|
|
29
|
+
console.log(chunk);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [AI-ROUTER documentation](https://ai-router.dev/openai-compatible-api-gateway/) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `ai-router/gpt-5.4` | 1.1M | | | | | | $3 | $15 |
|
|
40
|
+
| `ai-router/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
|
|
41
|
+
| `ai-router/gpt-5.6-luna` | 1.1M | | | | | | $1 | $6 |
|
|
42
|
+
| `ai-router/gpt-5.6-sol` | 1.1M | | | | | | $5 | $30 |
|
|
43
|
+
| `ai-router/gpt-5.6-terra` | 1.1M | | | | | | $3 | $15 |
|
|
44
|
+
|
|
45
|
+
## Advanced configuration
|
|
46
|
+
|
|
47
|
+
### Custom headers
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
const agent = new Agent({
|
|
51
|
+
id: "custom-agent",
|
|
52
|
+
name: "custom-agent",
|
|
53
|
+
model: {
|
|
54
|
+
url: "https://api.ai-router.dev/v1",
|
|
55
|
+
id: "ai-router/gpt-5.4",
|
|
56
|
+
apiKey: process.env.AI_ROUTER_API_KEY,
|
|
57
|
+
headers: {
|
|
58
|
+
"X-Custom-Header": "value"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Dynamic model selection
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
const agent = new Agent({
|
|
68
|
+
id: "dynamic-agent",
|
|
69
|
+
name: "Dynamic Agent",
|
|
70
|
+
model: ({ requestContext }) => {
|
|
71
|
+
const useAdvanced = requestContext.task === "complex";
|
|
72
|
+
return useAdvanced
|
|
73
|
+
? "ai-router/gpt-5.6-terra"
|
|
74
|
+
: "ai-router/gpt-5.4";
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Ambient
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 4 Ambient models through Mastra's model router. Authentication is handled automatically using the `AMBIENT_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Ambient documentation](https://ambient.xyz).
|
|
8
8
|
|
|
@@ -37,8 +37,9 @@ for await (const chunk of stream) {
|
|
|
37
37
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
38
|
| ----------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
39
|
| `ambient/moonshotai/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
|
|
40
|
-
| `ambient/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.
|
|
40
|
+
| `ambient/moonshotai/kimi-k2.7-code` | 262K | | | | | | $0.84 | $4 |
|
|
41
41
|
| `ambient/zai-org/GLM-5.1-FP8` | 203K | | | | | | $1 | $4 |
|
|
42
|
+
| `ambient/zai-org/GLM-5.2-FP8` | 203K | | | | | | $1 | $4 |
|
|
42
43
|
|
|
43
44
|
## Advanced configuration
|
|
44
45
|
|
|
@@ -68,7 +69,7 @@ const agent = new Agent({
|
|
|
68
69
|
model: ({ requestContext }) => {
|
|
69
70
|
const useAdvanced = requestContext.task === "complex";
|
|
70
71
|
return useAdvanced
|
|
71
|
-
? "ambient/zai-org/GLM-5.
|
|
72
|
+
? "ambient/zai-org/GLM-5.2-FP8"
|
|
72
73
|
: "ambient/moonshotai/kimi-k2.6";
|
|
73
74
|
}
|
|
74
75
|
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Blue Claw
|
|
4
|
+
|
|
5
|
+
Access 2 Blue Claw models through Mastra's model router. Authentication is handled automatically using the `BLUECLAW_API_KEY` environment variable.
|
|
6
|
+
|
|
7
|
+
Learn more in the [Blue Claw documentation](https://blueclaw.network).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
BLUECLAW_API_KEY=your-api-key
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Agent } from "@mastra/core/agent";
|
|
15
|
+
|
|
16
|
+
const agent = new Agent({
|
|
17
|
+
id: "my-agent",
|
|
18
|
+
name: "My Agent",
|
|
19
|
+
instructions: "You are a helpful assistant",
|
|
20
|
+
model: "blueclaw/Qwen/Qwen3.6-35B-A3B-FP8"
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Generate a response
|
|
24
|
+
const response = await agent.generate("Hello!");
|
|
25
|
+
|
|
26
|
+
// Stream a response
|
|
27
|
+
const stream = await agent.stream("Tell me a story");
|
|
28
|
+
for await (const chunk of stream) {
|
|
29
|
+
console.log(chunk);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Blue Claw documentation](https://blueclaw.network) for details.
|
|
34
|
+
|
|
35
|
+
## Models
|
|
36
|
+
|
|
37
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
38
|
+
| ----------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
39
|
+
| `blueclaw/Qwen/Qwen3.6-35B-A3B-FP8` | 131K | | | | | | — | — |
|
|
40
|
+
| `blueclaw/Qwen3.6-27B` | 197K | | | | | | — | — |
|
|
41
|
+
|
|
42
|
+
## Advanced configuration
|
|
43
|
+
|
|
44
|
+
### Custom headers
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const agent = new Agent({
|
|
48
|
+
id: "custom-agent",
|
|
49
|
+
name: "custom-agent",
|
|
50
|
+
model: {
|
|
51
|
+
url: "https://openai.blueclaw.network/v1",
|
|
52
|
+
id: "blueclaw/Qwen/Qwen3.6-35B-A3B-FP8",
|
|
53
|
+
apiKey: process.env.BLUECLAW_API_KEY,
|
|
54
|
+
headers: {
|
|
55
|
+
"X-Custom-Header": "value"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Dynamic model selection
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
const agent = new Agent({
|
|
65
|
+
id: "dynamic-agent",
|
|
66
|
+
name: "Dynamic Agent",
|
|
67
|
+
model: ({ requestContext }) => {
|
|
68
|
+
const useAdvanced = requestContext.task === "complex";
|
|
69
|
+
return useAdvanced
|
|
70
|
+
? "blueclaw/Qwen3.6-27B"
|
|
71
|
+
: "blueclaw/Qwen/Qwen3.6-35B-A3B-FP8";
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# CrossModel
|
|
4
4
|
|
|
5
|
-
Access
|
|
5
|
+
Access 40 CrossModel models through Mastra's model router. Authentication is handled automatically using the `CROSSMODEL_API_KEY` environment variable.
|
|
6
6
|
|
|
7
7
|
Learn more in the [CrossModel documentation](https://www.crossmodel.ai/docs).
|
|
8
8
|
|
|
@@ -61,6 +61,9 @@ for await (const chunk of stream) {
|
|
|
61
61
|
| `crossmodel/openai/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
|
|
62
62
|
| `crossmodel/openai/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
|
|
63
63
|
| `crossmodel/openai/gpt-5.5-pro` | 1.1M | | | | | | $30 | $180 |
|
|
64
|
+
| `crossmodel/openai/gpt-5.6-luna` | 1.1M | | | | | | $1 | $6 |
|
|
65
|
+
| `crossmodel/openai/gpt-5.6-sol` | 1.1M | | | | | | $5 | $30 |
|
|
66
|
+
| `crossmodel/openai/gpt-5.6-terra` | 1.1M | | | | | | $3 | $15 |
|
|
64
67
|
| `crossmodel/qwen/qwen3.6-flash` | 1.0M | | | | | | $0.19 | $1 |
|
|
65
68
|
| `crossmodel/qwen/qwen3.6-plus` | 1.0M | | | | | | $0.32 | $2 |
|
|
66
69
|
| `crossmodel/qwen/qwen3.7-max` | 1.0M | | | | | | $2 | $6 |
|