Pydantic AI Gateway
Pydantic AI Gateway (PAIG) is a unified interface for accessing multiple AI providers with a single key. Features include built-in OpenTelemetry observability, real-time cost monitoring, failover management , and native integration with the Pydantic stack.
Currently in Beta
The Pydantic AI Gateway is currently in Beta. No charges will be applied during this period.
Sign up at gateway.pydantic.dev.
For questions and feedback, contact us on Slack.
Key features
- API key management: access multiple LLM providers with a single Gateway key.
- Cost Limits: set spending limits at project, user, and API key levels with daily, weekly, and monthly caps.
- BYOK and managed providers: Bring your own API keys (BYOK) from LLM providers, or pay for API usage directly through the platform (coming soon).
- Multi-provider support: Access models from OpenAI, Anthropic, Google Vertex, Groq, and AWS Bedrock. More providers coming soon.
- Backend observability: Log every request through Pydantic Logfire or any OpenTelemetry backend (coming soon).
- Zero translation: Unlike traditional AI gateways that translate everything to one common schema, PAIG allows requests to flow through directly in each provider's native format. This gives you immediate access to the new model features as soon as they are released.
- Open source with self-hosting: PAIG's core is open source (under AGPL-3.0), allowing self-hosting with file-based configuration, instead of using the managed service.
- Enterprise ready: Includes SSO (with OIDC support), granular permissions, and flexible deployment options. Deploy to your Cloudflare account, or run on-premises with our consulting support.
hello_word.py
For now, this is a complete
from pydantic_ai import Agent
agent = Agent('gateway/chat:gpt-4.1')
result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
"""
The first known use of "hello, world" was in a 1974 textbook about the C programming language.
"""