• Playground
  • Models
  • Rankings
  • Pricing
  • Support
Docs
  • About Boundless
  • Quickstart
  • API Compatibility
  • Models
  • OpenAI SDK
  • Anthropic SDK
  • Vercel AI SDK
  • LangChain
  • Streaming
  • Tool calling
  • Reasoning
  • Errors
  • MPP & Agentic Payments
  • Credits & Billing
  • Rate Limits
  • Teams
  • Privacy & ZDR
  • FAQ
  • Coding agents
    Coding Agents & Harnesses
  • Claude Code
  • Claude Desktop
  • Codex CLI
  • Codex app
  • OpenCode
  • Cursor
  • Cline
  • GitHub Copilot
  • Kilo Code
  • Qwen Code
  • Amp
  • CodeBuddy
  • Hermes
  • Hermes Desktop
  • JetBrains AI & Junie
  • Cherry Studio
  • Mastra
  • MiMo Code
  • Muse
  • omp (Oh My Pi)
  • OpenClaw
  • OpenHands
  • T3 Code
  • Advanced
    System One
All systems operational
© 2026 BoundlessTermssupport@boundless.network

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:

import { Agent } from "@mastra/core/agent";
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";

const boundless = createOpenAICompatible({
  name: "boundless",
  baseURL: "https://api.inference.boundless.network/v1",
  apiKey: process.env.BOUNDLESS_API_KEY,
});

export const assistant = new Agent({
  name: "assistant",
  instructions: "You are a helpful coding assistant.",
  model: boundless("deepseek/deepseek-v4.1-flash"),
});

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:

curl https://api.inference.boundless.network/v1/models -H "Authorization: Bearer YOUR_API_KEY"

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.

NextMiMo Code