unbiased ai

Pydantic AI on Pareto: messy text in, typed objects out

Pydantic AI hands you a validated Python object instead of a paragraph to parse. Keep the agents, the output types and the tools, and change the model they call. Hand OpenAIChatModel Unbiased’s base URL and the model name pareto, and each run goes to Pareto, which selects frontier and open models for each request and blends their outputs into one answer.

Tested live with Pydantic AI 2.58.050M tokens a week

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

Set it up with OpenAIProvider

Pydantic AI reaches any OpenAI-compatible API through OpenAIProvider. Give it Unbiased’s base URL and your key, wrap it in OpenAIChatModel with the model name pareto, and pass that model to your agent.

  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.

  2. Install Pydantic AI with the OpenAI extra

    Run pip install "pydantic-ai-slim[openai]". The full pydantic-ai package includes the same OpenAI support.

  3. Build the model

    Create OpenAIChatModel('pareto', provider=OpenAIProvider(...)) with base_url set to https://api.unbiased.ai/v1. Keep /v1 on the URL, and type pareto by hand: Unbiased does not list models at /v1/models.

  4. Give the agent an output type and run it

    Pass the model and a Pydantic class to Agent(model, output_type=Invoice). result.output comes back as an Invoice, already validated.

Tested on October 20, 2026Pydantic AI 2.58.0 on Pareto (pareto). A 40-line agent turned a messy vendor email into a validated Invoice model with the right number, due date, line items and a total that matched them. Run record.
invoice.py
import os
from datetime import date
from decimal import Decimal
from pydantic import BaseModel
from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIChatModel
from pydantic_ai.providers.openai import OpenAIProvider

class LineItem(BaseModel):
    description: str
    quantity: int
    unit_price: Decimal

class Invoice(BaseModel):
    vendor: str
    invoice_number: str
    due_date: date
    currency: str
    items: list[LineItem]
    total: Decimal

URL = 'https://api.unbiased.ai/v1'
model = OpenAIChatModel(
    'pareto',
    provider=OpenAIProvider(
        base_url=URL,
        api_key=os.environ['UNBIASED_API_KEY'],
    ),
)
agent = Agent(model, output_type=Invoice)

email = """hey!! sorry for the late send, here's the bill from Brightwater Print Co.
inv # BW-2291 ... pls pay by nov 14 2026 (USD obviously)
- 3x poster runs @ $120 each
- 1 rush fee, $45
so all in thats $405. thx -- Dana
"""
prompt = f'Extract the invoice from this email:\n{email}'
result = agent.run_sync(prompt)
invoice = result.output
print(invoice.model_dump_json())
assert sum(i.quantity * i.unit_price for i in invoice.items) == invoice.total
print('Checks: items sum to total ok')
Shell
pip install "pydantic-ai-slim[openai]"
export UNBIASED_API_KEY=your-unbiased-api-key
python invoice.py

You can also configure it by environment, per Pydantic AI’s docs: set OPENAI_BASE_URL to https://api.unbiased.ai/v1 and OPENAI_API_KEY to your key, then use Agent('openai-chat:pareto'). Write openai-chat:, not openai:, which picks the Responses API model class. Our live test used the explicit provider above.

Pydantic AI stays. The model changes.

One model object changes. Your agents, schemas and tools don’t notice.

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 Pydantic AI 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 Pydantic AI by the month

One API key works across Pydantic AI 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.

Pydantic AI on Pareto, questions answered

Which Pydantic AI model class should I use with Pareto?

OpenAIChatModel, which sends OpenAI Chat Completions requests. That is the setup we tested. The bare openai: model string resolves to OpenAIResponsesModel, so if you configure Pydantic AI by environment variables, write openai-chat:pareto.

Does structured output work on Pareto?

Yes, in our test. By default Pydantic AI turns your output_type into a tool the model must call, so the API has to support tool calling. We ran Pydantic AI 2.58.0 against Pareto on October 20, 2026: it read a messy vendor email and returned an Invoice with the right number, due date and line items, and a total that matched them. Format compatibility is not a promise that every feature works, so tell us if one doesn’t.

Do I need an OpenAI account?

No. The class names say OpenAI because that is the request format. With base_url and api_key passed to OpenAIProvider, requests go to Unbiased with your Unbiased key, and your Unbiased plan pays for them. Pydantic AI itself is free and open source.

Do I need to set a model profile?

Not in our test. OpenAIProvider chooses request settings as if the model name belonged to OpenAI, and Pydantic AI’s docs say to adjust the profile if an endpoint rejects one of them. The defaults worked for pareto.

What is the banner that prints when my script runs?

Pydantic AI 2.x prints a short banner with the version, the model and the output type, and suggests turning on observability. It does not change the request. Set PYDANTIC_AI_NO_BANNER=1 to hide it.

Is Pareto made by the Pydantic AI team?

No. Pareto is Unbiased’s model. Pydantic AI is made by Pydantic, and Unbiased is not affiliated with or endorsed by them. You keep Pydantic AI 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.

Hand Pydantic AI the email nobody wants to read

One provider object, one key and the same agents. Pareto starts at $10 a month for 50M tokens a week. Building agents that read a lot? See what reading costs.