unbiased ai

Mastra agents, thinking on Pareto

Mastra gives your TypeScript agents tools, memory and workflows, and leaves the model to you. Hand it a custom model object with Unbiased’s base URL and the id custom/pareto, and your agent’s calls go to Pareto, which selects frontier and open models for each request and blends their outputs into one answer. Your tools and schemas stay as written.

Tested live with @mastra/core 1.78.050M tokens a week

A demonstration of Mastra on Pareto, recreated from a real run. Not a screenshot.

Set it up in the model object

Mastra accepts any OpenAI-compatible endpoint as a model. Instead of a provider string, give the agent’s model an object with an id, the endpoint’s base url and an apiKey.

  1. Get an Unbiased API key

    Choose a plan, then create a key in the Unbiased platform. New accounts are reviewed and approved by a person before the key works. Keep it in an environment variable such as UNBIASED_API_KEY.

  2. Give the model a custom id

    Set id to custom/pareto. Mastra needs a prefix before the slash; it drops the prefix and sends model: "pareto". Type the name yourself: Unbiased does not list models at /v1/models, and Mastra sends whatever id you give it without checking a model list.

  3. Point url at the base URL

    Set url to https://api.unbiased.ai/v1. Stop at /v1: Mastra adds /chat/completions itself.

  4. Pass the key and give tools room

    Put apiKey on the same object. For an agent that calls a tool and then answers, pass maxSteps to agent.generate so it can take more than one step.

Tested on October 20, 2026Mastra @mastra/core 1.78.0 on Pareto (pareto). A 36-line TypeScript agent called a book-slot tool to take the earliest free afternoon slot and returned the confirmation code. Run record.
src/mastra/agents/scheduler.ts
import { Agent } from "@mastra/core/agent";
import { bookSlot } from "../tools/book-slot";

export const scheduler = new Agent({
  id: "scheduler",
  name: "Scheduler",
  instructions: "You book meetings with the book-slot tool. Pick the earliest free afternoon slot when asked for an afternoon.",
  model: {
    id: "custom/pareto",
    url: "https://api.unbiased.ai/v1",
    apiKey: process.env.UNBIASED_API_KEY, // your-unbiased-api-key
  },
  tools: { bookSlot },
});
Run it
// maxSteps lets the agent call book-slot, then answer
const result = await scheduler.generate(
  "Book me a 30-minute afternoon meeting with Dana this week, then tell me the confirmation code.",
  { maxSteps: 4 },
);
console.log(result.text);

Mastra uses Chat Completions for a custom url by default, and that is what we tested. Its docs also offer api: "responses" for endpoints that serve /v1/responses; Unbiased serves that endpoint, but our run did not try it.

Your agent stays. Its model changes.

Three fields in one object change. The agent, its tools and the code that calls it do not.

One model string, several models behind it

Pareto is Unbiased’s blended AI model. On each request it selects frontier and open models and blends their outputs into one answer, so Mastra talks to one model string, pareto, and never has to pick.

“When the frontier improves, Pareto improves; when frontier prices fall, you should benefit.” From the pricing page.

How a Pareto answer gets made →
An illustration, not a wiring diagram. The blend includes frontier and open models, and its composition can change.

What an agent task costs on Pareto

Agents make many model calls per task, so the price of a finished task matters more than the price of a token. The model card publishes both for Pareto on two public agent benchmarks.

Terminal-Bench 4.0Tasks an agent completes in a terminal
$0.48/task
50.8% solved
DeepSWE v1.1Changes an agent makes in a real codebase
$0.24/task
69.9% solved

Pareto 26.10, preliminary October 1, 2026 runs that may change; denominators and the cost method still require confirmation. Cost is the reported mean USD per task at API rates, not an estimate for your workload. Model card and method.

Pay for your Mastra agent’s model by the month

One API key works across Mastra and any other tool you point at Pareto. Pick a monthly allowance, or pay per token on Team.

Personal

$10/month

  • 50M tokens a week
  • 20 requests per minute
  • For one person
Choose Personal

Personal Max

$100/month

  • 600M tokens a week
  • 60 requests per minute
  • For one person
Choose Personal Max

Team

Pay as you go

  • Prepaid credits at published rates
  • 300 requests per minute
  • No weekly token cap
Get started with Team

Subscriptions are for one person and are not unlimited. New API accounts are reviewed by a person before access turns on, and commercial or production use needs a separate written agreement. Rates and limits are on Pricing.

Mastra on Pareto, questions answered

Why custom/pareto and not just pareto?

Mastra’s model router reads ids as provider/model, so a custom endpoint still needs something before the slash. With a custom url, Mastra drops the prefix on the way out. In our test the request to Unbiased carried model: "pareto".

Does tool calling work with Pareto in Mastra?

Yes, in our test. On October 20, 2026, a Mastra agent built with @mastra/core 1.78.0 and one createTool tool called book-slot with the right day and time and returned the confirmation code. Format compatibility is not a promise that every Mastra feature works, so tell us if one doesn’t.

My agent calls the tool but never answers. What’s wrong?

Usually the step limit. A tool call and the answer after it are separate steps, so pass maxSteps to agent.generate (our test used 4).

Do I need an OpenAI key or a Mastra account?

No. Mastra is open source, and with a custom url it sends your Unbiased key to Unbiased.

Can I ship a product built on this?

A Personal plan is for one person building and testing. Commercial or production use needs a separate written agreement with Unbiased; see Unbiased for agent builders.

Is Pareto made by the Mastra team?

No. Pareto is Unbiased’s model. Mastra is made by Mastra, and Unbiased is not affiliated with or endorsed by them. You keep Mastra and point it at the Unbiased API.

What happens when I hit the weekly allowance?

Requests over your plan’s limits return an HTTP 429 error. Personal includes 50M tokens a week and 20 requests per minute. Personal Max raises that to 600M a week and 60 requests per minute for $100/month. Team uses prepaid pay-as-you-go credits with no weekly token cap.

Do I choose between models?

No. You send every request to one model string, pareto. Pareto selects frontier and open models for each request and blends their outputs into one answer.

Is my code kept?

Personal and Personal Max are not our zero data retention tier: prompts and responses may be kept up to 30 days, as section 5(c) of the Terms explains. For work that must not be kept, ask about the Zero Data Retention API on the Private AI page.

Pareto works in other tools too

The same key and the same model string go into each of these. See them all.

Product names belong to their owners. Except where a guide says otherwise, Unbiased is not affiliated with or endorsed by the makers of the tools on this page.

Give your Mastra agent a harder errand

One model object, one key, the same tools. Pareto starts at $10 a month for 50M tokens a week.