Skip to main content

ya-oauth-provider

Pydantic AI model/provider helpers that consume OAuth token sources from ya-oauth.

Codex model string

YA Agent SDK loads this package for model strings such as:

oauth@codex:gpt-5.5

The provider owns Codex request authentication and header alignment. It attaches the bearer token, ChatGPT account ID, optional FedRAMP marker, originator, underscore and hyphen variants of session/thread headers, SDK-provided x-session-id, and x-client-request-id. It omits the Codex version header by default to avoid coupling YA package versions to Codex CLI release gates.

Generic OpenAI Responses WebSocket transport remains in ya-agent-sdk as WebsocketResponsesModel. This package adds only Codex-specific authentication, headers, token refresh, and payload normalization, and refreshes once on HTTP 401 through the configured token source before retrying. Its OpenAI client, OAuth auth flow, and retry transport all use HTTPX2; callers must not inject a legacy httpx.AsyncClient. The SDK-created client closes with the model context and is recreated on re-entry. OAuth authentication buffers the request body once so Codex payload normalization and a possible 401 replay operate on identical bytes.

Proactive refresh

ya_oauth_provider.OAuthRefreshSupervisor refreshes configured OAuth token sources on startup and on a background interval. Runtime packages can use create_oauth_refresh_supervisor_for_models(...) to detect oauth@provider:model strings and maintain logged-in providers before the first model request needs a token refresh.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ya_oauth_provider-2.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ya_oauth_provider-2.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file ya_oauth_provider-2.1.0.tar.gz.

File metadata

  • Download URL: ya_oauth_provider-2.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ya_oauth_provider-2.1.0.tar.gz
Algorithm Hash digest
SHA256 5a421c53bb01a168dd23829cf714af4213344b1d70e5b6b460af7d248bd9488c
MD5 d70300ae2e97433d494d52563cda4a57
BLAKE2b-256 aaadc97d06b43e619574b7bcb2b8b52cbbeb1c8716dfa3b99e70cd547389c025

See more details on using hashes here.

File details

Details for the file ya_oauth_provider-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: ya_oauth_provider-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ya_oauth_provider-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d859000c8689a72832d302b805c8406fc2b319de2c42c0900f6713272466272b
MD5 eb9fd642f46bb1aa42b44f80c1db4329
BLAKE2b-256 6f0096af606db259ef7306bb0bcb04a379bcd8cde98ba4244c82fbb1834bdc28

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.21.0

2 files

1.20.1

2 files

1.20.0

2 files

1.19.2

2 files

1.19.1

2 files

1.19.0

2 files

1.18.0

2 files

1.17.1

2 files

1.17.0

2 files

1.16.3

2 files

1.16.2

2 files

1.16.1

2 files

1.16.0

2 files

1.15.0

2 files

1.14.2

2 files

1.14.1

2 files

1.14.0

2 files

1.13.1

2 files

1.13.0

2 files

1.12.3

2 files

1.12.2

2 files

1.12.1

2 files

1.12.0

2 files

1.11.2

2 files

1.11.1

2 files

1.11.0

2 files

1.10.4

2 files

1.10.3

2 files

1.10.2

2 files

1.10.1

2 files

1.10.0

2 files

1.9.1

2 files

1.9.0

2 files

1.8.0

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.93.0

2 files

0.92.0

2 files

0.91.2

2 files

0.91.1

2 files

0.91.0

2 files

0.90.0

2 files

0.89.0

2 files

0.88.0

2 files

0.87.1

2 files

0.87.0

2 files

0.86.0

2 files

0.85.5

2 files

0.85.4

2 files

0.85.3

2 files

0.85.2

2 files

0.85.1

2 files

0.85.0

2 files

0.84.1

2 files

0.84.0

1 file

0.83.0

2 files

0.82.0

2 files

0.81.0

2 files

0.80.3

2 files

0.80.2

2 files

0.80.1

2 files

0.80.0

2 files

0.79.0

2 files

0.78.0

2 files

0.77.0

2 files

0.76.2

2 files

0.76.1

2 files

0.76.0

2 files

0.75.0

2 files

0.74.1

2 files

0.74.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page