/PydanticAI

Announcement: Pydantic AI Gateway Open Beta

Samuel Colvin avatar
Samuel Colvin
7 mins

If you've built anything serious with LLMs, you've probably seen it: a tangled mess of API keys, rate limits, and one unexpected Slack message:

Why did we spend $10,000 last night?

Once you get beyond toy usage, LLM governance is a pain. That's exactly why we built Pydantic AI Gateway (PAIG), and today, we're opening the beta to everyone.

Sign up now at gateway.pydantic.dev. Docs at ai.pydantic.dev/gateway The beta is free while we gather feedback.


  1. We could see it was a pain point for our customers.
  2. We knew we could build something with higher engineering quality and better chosen abstractions.
  3. We are uniquely positioned to offer a better developer experience via integrations with the existing Pydantic stack (specifically Pydantic AI and Logfire).

Most "AI gateways" are the wrong kind of abstraction.

They try to wrap every provider in a single "universal schema" that slows you down. Every time a model adds a feature: tool calling, image input, JSON mode - you wait weeks for the gateway to catch up.

PAIG takes a different approach: one key, zero translation.

Your requests go straight through in the provider's native format. That means when OpenAI, Anthropic, Google, Groq or any other provider ship something new, you can use it immediately. No adapters, no waiting.

Added to that, you get superb observability via the Gateway's (optional) integration with Pydantic Logfire.


  • One key, many models: talk to OpenAI, Anthropic, Google Vertex, Groq, or AWS Bedrock with the same key. More providers (notably Azure) are on the way.
  • Cost limits that stop spend: set daily, weekly, monthly and total caps at project, user, and key levels.
  • Built-in observability: every request can be logged to Pydantic Logfire or any OpenTelemetry backend.
  • Failover: route around provider outages automatically.
  • Open source & self-hostable: AGPL-3.0 core, file-based config, deploy anywhere. Console and UI are closed source.
  • Enterprise-ready: SSO via OIDC, granular permissions, and Cloudflare or on-prem deployment options.
  • Low latency: Finally, and perhaps most importantly, PAIG runs on Cloudflare's globally distributed edge compute network, meaning absolutely minimal latency. If you're sitting in Berlin making a request to a model near Frankfurt, you'll connect to a PAIG service running in Berlin. After the first request, it won't need to call back to our central database, so using the gateway will add single-digit milliseconds to your response time. It might even be faster, as the request will run through Cloudflare's backbone to the model provider.

This isn't "one schema to rule them all." It's a thin layer that gives you control without hiding power. If PAIG ever slows you down, we've failed.


If you already use Pydantic AI, switching takes one line:

from pydantic_ai import Agent

agent = Agent(
    'gateway/openai:gpt-5',
    instructions='Be concise, reply with one sentence.',
)
print(agent.run_sync('Hello World').output)

To switch models, just change the string:

gateway/<api_format>:<model_name>

For example:

  • gateway/openai:gpt-5
  • gateway/anthropic:claude-sonnet-4-5
  • gateway/google-vertex:gemini-2.5-flash
  • gateway/groq:openai/gpt-oss-120b

You don't have to use Pydantic AI at all, you can point any supported SDK at PAIG and keep your existing code.

import openai

client = openai.Client(
    base_url='https://gateway.pydantic.dev/proxy/openai/',
    api_key='paig_...',
)

response = client.chat.completions.create(
    model='gpt-4o',
    messages=[{'role': 'user', 'content': 'Hello world'}],
)

print(response.choices[0].message.content)
import anthropic

client = anthropic.Anthropic(
    base_url='https://gateway.pydantic.dev/proxy/anthropic/',
    auth_token='paig_...',
)

response = client.messages.create(
    model='claude-3-haiku-20240307',
    max_tokens=1000,
    messages=[{'role': 'user', 'content': 'Hello world'}],
)

print(response.content[0].text)

You can even route Claude Code through PAIG by setting:

export ANTHROPIC_AUTH_TOKEN="paig_..."
export ANTHROPIC_BASE_URL="https://gateway.pydantic.dev/proxy/anthropic"

Then launch Claude Code as normal — now with real cost limits and logs.


  • Abstractions should be honest. We won't "normalize" APIs into a pretend universal schema. That only hides power and delays progress.
  • Observability is not optional. Shared keys without logs are accidents waiting to happen. With PAIG + Logfire (or any inferior OTel-compatible backend), you always know who spent what.
  • Control beats ceremony. Budgets should live in your gateway, not in a Notion doc.

We want PAIG to be the boring, reliable layer you don't think about — until you realize how much time and cost it's saved you.


  1. Why did you build a gateway? It's a pain point for a lot of our customers, and we think that it integrates nicely with Pydantic AI and Pydantic Logfire (but those are not required to use it).
  2. Is it open-source? The core gateway is open source and available on GitHub. However, some features, like the hosted UI and SSO support are closed source and part of the managed service.
  3. How long will the beta last? Until early December (roughly).
  4. How much will it cost after the beta? Pricing will be announced closer to general availability. During the open beta, the gateway is completely free to use (we’ll eat the card fee for now). We roughly expect to charge competitive markup fee on LLM inference credits if you are using our built-in models, and a base fee for enterprise features (e.g. SSO).
  5. What's the difference between this and other gateways? Similar purpose, pricing and features - just built with higher engineering quality and richer observability via Pydantic Logfire.

You can:

  1. Create an org with GitHub or Google login.
  2. Add provider credentials (BYOK).
  3. Set project, user, and key-level caps.
  4. Drop the gateway key into your code.
  5. Watch usage and costs in Logfire.

The open beta starts today — November 13, 2025. PAIG is free during beta while we gather feedback. Go to gateway.pydantic.dev and tell us what works, and what sucks.


PAIG is built with the same philosophy as the Pydantic stack: developer-first, transparent and fast. If that sounds like your kind of infrastructure, we think you'll love it.