Skip to content

Conversation

@laisbsc
Copy link

@laisbsc laisbsc commented Nov 10, 2025

Docs for the Pydantic AI Gateway, including guides for getting started, usage examples, and an overview of features. The navigation in mkdocs.yml has been updated to include these new sections, and a minor theme enhancement has been made.

For now, most of the docs are a copy of what we have in Notion. I'm working now on updating the existing PAI examples to use PAIG and testing the gateway to update the descriptions.

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Docs Preview

commit: 994583a
Preview URL: https://0c4f9234-pydantic-ai-previews.pydantic.workers.dev

@DouweM DouweM marked this pull request as draft November 10, 2025 14:04
import openai

client = openai.Client(
base_url='https://gateway.pydantic.dev/proxy/openai/',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has changed to:

Suggested change
base_url='https://gateway.pydantic.dev/proxy/openai/',
base_url='https://gateway.pydantic.dev/proxy/chat/',

Copy link
Author

@laisbsc laisbsc Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested now and both seem to work 🤔 is this by design?

docs/gateway.md Outdated
from pydantic_ai import Agent

agent = Agent(
'gateway/openai:gpt-4.1',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'gateway/openai:gpt-4.1',
'gateway/chat:gpt-4.1',


```python {title="roulette_wheel.py"}
from pydantic_ai import Agent, RunContext
=== "Pydantic AI Gateway"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be the second tab, so we don't make things unnecessarily complicated for new users

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep it like this, we should at least link to the gateway docs


| **Provider** | **Provider ID** | **Example Model** |
| --- | --- | --- |
| OpenAI | `openai` | `gateway/openai:gpt-4.1` |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be updated with API types rather than provider IDs.

#> False
```

1. Create an agent, which expects an integer dependency and produces a boolean output. This agent will have type `#!python Agent[int, bool]`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these tooltips actually get properly rendered on both code examples? We may need to repeat them on each tab.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with other parts of the docs, I think they should all be under docs/gateway/, this should be docs/gateway/overview.md, and we can add a redirect from /gateway to gateway/overview in docs-site/src/index.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants