Daily Edition Sources +3

API Discovery: Let a Pydantic AI Agent Use Your Codex Subscription

Pydantic AI’s new Codex provider turns an existing subscription into a typed-agent option—with its authentication and streaming limits in plain view.

Photocopied marker diagram showing Codex login flowing through Pydantic AI’s openai-codex provider to a typed agent, with locked credentials and a subscription-login requirement stamp.
Diagram PunkPydantic AI makes an existing Codex subscription an explicit provider boundary.
repo pydantic/pydantic-ai evidence
3 source signals 1 repo 3 source signals
Evidence: 3 source signals / September 8, 2026 / Daily Edition
Open Edition Evidence below

API discovery: Pydantic AI has added an openai-codex provider for a ChatGPT/Codex subscription. After the official Codex login, the public guide’s smallest model selection is simply Agent('openai-codex:gpt-5.6-luna'). That is useful because it puts subscription authentication behind a named provider boundary instead of asking every typed-agent application to improvise its own OAuth bridge—or to reach for a pay-per-token key it does not need.

Try it

Use it for a deliberately small local proof of concept: give a one-turn Pydantic AI agent a Markdown release note and ask it to return a short “what changes for an operator?” brief. Keep the task read-only and the output disposable. The point is to confirm that your project’s model/provider wiring is correct before you add tools, background work, or a persistent credential source.

Copy-paste agent instruction

Set up a small Pydantic AI proof of concept using the openai-codex provider. First confirm that I have completed the official Codex login; do not read, print, commit, or upload any credential files. Create a one-turn, read-only agent that turns a local Markdown release note into a short operator-facing changelog. Report provider errors clearly and do not retry authentication blindly.

Test caveat

The guide is candid about the boundary. This requires an eligible subscription plus CLI or browser OAuth login; the provider is streaming-only, forces store=false, has no device flow, and does not provide token counts through this authentication path. Its public test uses a recorded authenticated fixture and checks that credential values stay out of tracing, but this reporting run did not sign in or execute a live request. Treat account access, refresh credentials, model availability, and cost behavior as things to verify in your own controlled environment.

Evidence Trail

Receipts below the story

The article above is the public narrative. This section keeps the source trail and limits on the same page.

Edition
DateSeptember 8, 2026
LaneDaily Edition
Confidence78%
Sources3
Repospydantic/pydantic-ai

Primary Evidence

  • Public API source: Pydantic AI OpenAI Codex provider guide
    • Shows: the public openai-codex: model/provider surface, its Codex-subscription access condition, the official-login prerequisite, a concise Agent model example, and documented backend limits.
  • Supporting definition or documentation: OpenAICodexProvider implementation
    • Shows: the provider’s source-level authentication and access behavior—read-only CLI credential loading by default, in-memory refresh, a dedicated authenticated client, and an HTTPS-host restriction for subscription credential injection.
  • Supporting test receipt: OpenAI Codex model test
    • Shows: a public recorded test of a streaming Codex tool roundtrip and an assertion that credential values do not appear in exported tracing data.

Evidence Limits

  • The source requires an eligible ChatGPT/Codex subscription and an official CLI or browser OAuth login. This reporting run did not perform either, so it does not establish account availability, charges, rate behavior, or a live model result.
  • The documented backend is streaming-only, forces store=false, has no device flow, and does not serve the token-count endpoint under subscription authentication. Treat persistent refresh credentials as application secrets and do not place them in agent prompts, logs, or repositories.
Letters & Corrections

Send a note to the desk

Corrections, missing context, or a follow-up lead.