Skip to main content

Module codex

Module codex 

Source
Expand description

ChatGPT/Codex subscription auth for OpenAI reviewers.

Reuses the OAuth token the Codex CLI stores in ~/.codex/auth.json (read-only; never written back), refreshing the short-lived access token in-memory via the refresh token. Requests go to the Codex subscription endpoint, which speaks the OpenAI Responses API with several backend-specific quirks (see CodexClient::send).

Research-only: third-party use of the Codex OAuth client is arguably against OpenAI’s ToS, mirroring the posture of the Antigravity Gemini path.

Structs§

CodexClient

Functions§

auth_available
True when a usable Codex CLI OAuth token file is present (CODEX_HOME or ~/.codex/auth.json). Used by init detection; reuses the same parse the client does, so API-key-mode files (which the client rejects) don’t surface as a codex provider.
shared_client
Process-wide shared Codex client (retry-wrapped), built once on first use.