Skip to main content
Codex-Auth Logo

Codex-Auth

A Stealth Playwright proxy providing an OpenAI-compatible API layer over ChatGPT.

Python FastAPI Playwright License


Codex-Auth is a Python package that provides an OpenAI-compatible API proxy backed by a ChatGPT web session. By utilizing Stealth Playwright, it exposes a local API layer that can be connected to AI tools and IDEs like Cursor and OpenRouter.

📑 Table of Contents

✨ Features

  • 🎭 Stealth Automation: Uses playwright-stealth to navigate automated bot detection.
  • 🔄 OpenAI Compatible: Supports OpenAI's /v1/chat/completions and /v1/models endpoints.
  • 🖼️ Vision & Multimodal: Scrapes internal endpoints to report model vision capabilities.
  • Asynchronous Core: Built on FastAPI for non-blocking request handling.
  • 📦 CLI Tool: Includes the codex-auth CLI built with Typer & Rich for setup and execution.

🚀 Getting Started

Option 1: Python Developers (Recommended)

If you have Python installed, use pipx to install Codex-Auth globally in an isolated environment. This prevents dependency conflicts with your other Python packages.

pipx install codex-auth-proxy
codex-auth install

Option 2: Standalone Binary (Windows)

If you don't have Python installed, or just want a frictionless setup, download the compiled .exe:

  1. Go to the Releases page
  2. Download codex-auth.exe
  3. Open your terminal and run it directly to install the bundled browser:
codex-auth.exe install

💻 Usage

Codex-Auth provides a command-line interface for managing the proxy.

1. Authenticate

Before running the proxy server, you need to capture a valid ChatGPT session token.

codex-auth auth

This command launches a headless browser. Follow the prompts to log in to your account. Session tokens are saved to the local .codex directory.

2. Start the Proxy Server

Once authenticated, start the API server:

codex-auth start --port 8000

The proxy will listen on http://127.0.0.1:8000.

📸 Screenshots

Authentication Setup API Server Logs CLI Chat Interface

🔌 Connecting Tools

You can configure Codex-Auth as a custom OpenAI provider in standard AI tools.

Example configuration:

  • Base URL: http://127.0.0.1:8000/v1
  • API Key: sk-codex-dummy (The proxy accepts any string)

The proxy intercepts API requests and routes them through the authenticated ChatGPT web session.

🏗️ Architecture

graph LR
    A[AI Tool / IDE] -->|OpenAI API Request| B(FastAPI Server)
    B -->|Async Automation| C{Playwright Stealth}
    C -->|Web Session| D[(ChatGPT)]
  • FastAPI: Handles API routing.
  • Playwright: Drives the browser interaction.
  • Typer & Rich: Powers the CLI interface.

🤝 Contributors

  • @yutuknown - Creator & Lead Developer
  • Antigravity AI - AI Pair Programmer

📜 License

Distributed under the MIT License. See LICENSE for more information.

Download files

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

Source Distribution

codex_auth_proxy-0.2.0.tar.gz (337.0 kB view details)

Uploaded Source

Built Distribution

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

codex_auth_proxy-0.2.0-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

File details

Details for the file codex_auth_proxy-0.2.0.tar.gz.

File metadata

  • Download URL: codex_auth_proxy-0.2.0.tar.gz
  • Upload date:
  • Size: 337.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codex_auth_proxy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fc4a520337bf3a02965d7e4ef583c1b8ca6db75a5e851ee7295a3bc7b4569094
MD5 0a2a07448c96f42900b93aba8aafcbf8
BLAKE2b-256 b36901742b864f044e84028887ca49c76f7ac4df54684f90e1073f6144f5c256

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_auth_proxy-0.2.0.tar.gz:

Publisher: release.yml on yutuknown/codex-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codex_auth_proxy-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for codex_auth_proxy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ff9f60768ed4c8c6acc49c7de273b5483bafc19cbf09834fa9cef591e28fc4e
MD5 6317872613f04b122afa54c641dd5bec
BLAKE2b-256 577159c855326ff6c8264c0e998f84bdb0633872623a39a5af33d5cbc73e0528

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_auth_proxy-0.2.0-py3-none-any.whl:

Publisher: release.yml on yutuknown/codex-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page