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-stealthto navigate automated bot detection. - 🔄 OpenAI Compatible: Supports OpenAI's
/v1/chat/completionsand/v1/modelsendpoints. - 🖼️ 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-authCLI 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:
- Go to the Releases page
- Download
codex-auth.exe - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc4a520337bf3a02965d7e4ef583c1b8ca6db75a5e851ee7295a3bc7b4569094
|
|
| MD5 |
0a2a07448c96f42900b93aba8aafcbf8
|
|
| BLAKE2b-256 |
b36901742b864f044e84028887ca49c76f7ac4df54684f90e1073f6144f5c256
|
Provenance
The following attestation bundles were made for codex_auth_proxy-0.2.0.tar.gz:
Publisher:
release.yml on yutuknown/codex-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_auth_proxy-0.2.0.tar.gz -
Subject digest:
fc4a520337bf3a02965d7e4ef583c1b8ca6db75a5e851ee7295a3bc7b4569094 - Sigstore transparency entry: 2195523227
- Sigstore integration time:
-
Permalink:
yutuknown/codex-auth@7c7f44feb7c3bf553cf670954c33892c81696dcd -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/yutuknown
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7c7f44feb7c3bf553cf670954c33892c81696dcd -
Trigger Event:
release
-
Statement type:
File details
Details for the file codex_auth_proxy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: codex_auth_proxy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ff9f60768ed4c8c6acc49c7de273b5483bafc19cbf09834fa9cef591e28fc4e
|
|
| MD5 |
6317872613f04b122afa54c641dd5bec
|
|
| BLAKE2b-256 |
577159c855326ff6c8264c0e998f84bdb0633872623a39a5af33d5cbc73e0528
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_auth_proxy-0.2.0-py3-none-any.whl -
Subject digest:
0ff9f60768ed4c8c6acc49c7de273b5483bafc19cbf09834fa9cef591e28fc4e - Sigstore transparency entry: 2195523240
- Sigstore integration time:
-
Permalink:
yutuknown/codex-auth@7c7f44feb7c3bf553cf670954c33892c81696dcd -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/yutuknown
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7c7f44feb7c3bf553cf670954c33892c81696dcd -
Trigger Event:
release
-
Statement type: