Mastra
Use Boundless in Mastra agents: an OpenAI-compatible provider from the AI SDK, the version rule and common errors.
Mastra reaches Boundless through an OpenAI-compatible provider from the AI SDK, using the base URL https://api.inference.boundless.network/v1.
Install#
Mastra is a library, so you configure it in code. The setup command does not offer it. Install Mastra and @ai-sdk/openai-compatible from their own documentation, then add the provider below. Need a key? Create one in API Keys and export it as BOUNDLESS_API_KEY.
Configure#
Mastra#
An OpenAI-compatible provider from the AI SDK:
Keep @ai-sdk/openai-compatible on the same AI SDK major version as @mastra/core.
Model ids#
The examples use deepseek/deepseek-v4.1-flash. Use any id from GET https://api.inference.boundless.network/v1/models; the models page lists each one with its price and limits.
Verify#
To check the base URL and key on their own, list the models the gateway serves. A list of models means both are right. A 401 means the key is missing or wrong:
Then send a short message in a new session and check that a reply comes back.
Common errors#
| What you see | What it usually is |
|---|---|
401 on every request |
BOUNDLESS_API_KEY is not set in the process that runs the agent. |
| Type errors or odd behaviour from the provider | Keep @ai-sdk/openai-compatible on the same AI SDK major version as @mastra/core. |
403 with model_not_allowed |
Your team admin has not enabled that model for you. Ask them, or pick another. See Model access. |
Every status and code is on the Errors page. Other harnesses are on the Coding Agents & Harnesses page.