You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ai_gateway/gateway.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Pydantic AI Gateway
2
2
3
-
**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.
3
+
**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.
4
4
5
5
!!! note "Free while in Beta"
6
6
The Pydantic AI Gateway is currently in Beta. You can bring your own key (BYOK) or buy inference through the Gateway (we will eat the card fee for now).
@@ -11,24 +11,22 @@ For questions and feedback, contact us on [Slack](https://logfire.pydantic.dev/d
11
11
12
12
## Documentation Integration
13
13
14
-
To help you get started with [Pydantic AI Gateway](https://gateway.pydantic.dev), most code examples throughout the Pydantic AI docs include a "Pydantic AI Gateway" tab alongside the standard Pydantic AI call string named here "Direct to Provider API" tab. This allows you to see how to adapt examples for Gateway usage by simply switching tabs.
15
-
16
-
The main difference is that when using Gateway, model strings use the `gateway/` prefix.
14
+
To help you get started with [Pydantic AI Gateway](https://gateway.pydantic.dev), some code examples on the Pydantic AI documentation include a "Via Pydantic AI Gateway" tab, alongside a "Direct to Provider API" tab with the standard Pydantic AI model string. The main difference between them is that when using Gateway, model strings use the `gateway/` prefix.
17
15
18
16
## Key features
19
17
-**API key management**: access multiple LLM providers with a single Gateway key.
20
18
-**Cost Limits**: set spending limits at project, user, and API key levels with daily, weekly, and monthly caps.
21
-
-**BYOK and managed providers:** Bring your own API keys (BYOK) from LLM providers, or pay for API usage directly through the platform (_coming soon_).
19
+
-**BYOK and managed providers:** Bring your own API keys (BYOK) from LLM providers, or pay for inference directly through the platform.
22
20
-**Multi-provider support:** Access models from OpenAI, Anthropic, Google Vertex, Groq, and AWS Bedrock. _More providers coming soon_.
23
21
-**Backend observability:** Log every request through [Pydantic Logfire](https://pydantic.dev/logfire) or any OpenTelemetry backend (_coming soon_).
24
22
-**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.
25
23
-**Open source with self-hosting**: PAIG's core is [open source](https://github.com/pydantic/pydantic-ai-gateway/) (under [AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.en.html)), allowing self-hosting with file-based configuration, instead of using the managed service.
26
24
-**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](https://pydantic.dev/contact).
27
25
28
-
```python {title="hello_world.py" test="skip"}
26
+
```python {title="hello_world.py"}
29
27
from pydantic_ai import Agent
30
28
31
-
agent = Agent('gateway/chat:gpt-4.1')
29
+
agent = Agent('gateway/chat:gpt-5')
32
30
33
31
result = agent.run_sync('Where does "hello world" come from?')
0 commit comments