Pydantic AI gives you typed agents with structured outputs, validators, and tool calls — all backed by Pydantic models. Its OpenAI provider accepts any OpenAI-compatible base URL, so AIgateway slots in unchanged.
Pass an OpenAIProvider (or AnthropicProvider for /v1/messages) with our base URL. Every Pydantic AI feature — typed responses, tool calls, agent graphs — works unchanged.
Because AIgateway exposes 900+ models behind one schema, switching the model string is the only code change between Claude, GPT, Gemini, Kimi, Llama, DeepSeek, etc.