AtmoRouter guide: running PydanticAI agents through an OpenAI-compatible API, with usage and cost math
AtmoRouter published a guide to running PydanticAI agents against its OpenAI-compatible Chat Completions endpoint: the OpenAICompatibleProvider configuration, typed outputs and tools, reading token usage per run, a fallback chain, and an illustrative cost comparison across four catalogue models for ten thousand agent runs.
Why it matters
The guide's core recommendation is to use OpenAICompatibleProvider with a stable service name and base URL rather than OpenAIProvider, which the PydanticAI documentation reserves for OpenAI itself or a transparent proxy to it. AtmoRouter says its catalogue IDs get the shared OpenAI-compatible profile, so tool calling and prompted or tool-based structured output work out of the box.
For cost, AtmoRouter suggests reading result.usage() and multiplying by live catalogue rates, since the framework's built-in cost lookup returns nothing for unknown model IDs. Its illustrative math, three model requests per run at twelve thousand input and six hundred output tokens each, puts ten thousand runs at about $1.46 on zai/glm-5.4 and about $337.50 on cx/gpt-6.2-sol, with two Claude models in between.
The guide is authored by AtmoRouter and, in the company's own words, is not a benchmark. It also covers FallbackModel ordering, usage limits, the 10% cached input rate where supported, and a reminder that rates change and the model page is authoritative.