← all repositories
EvanZhouDev/openai-oauth

Turn your ChatGPT login into a local OpenAI API endpoint

An unofficial proxy that borrows your ChatGPT/Codex OAuth tokens to serve a local OpenAI-compatible API, bypassing API credit billing.

1.3k stars TypeScript Inference · ServingCoding Assistants
openai-oauth
Not currently ranked — collecting fresh signals.
star history

What it does openai-oauth is a local proxy and Vercel AI SDK provider that reads the OAuth tokens already cached by OpenAI’s Codex CLI. It binds to 127.0.0.1 and forwards requests to ChatGPT’s backend Codex endpoint, presenting an OpenAI-compatible interface. You can point a standard client at the localhost URL or import the provider directly into a Vercel AI SDK project.

The interesting bit The value is entirely in the accounting. OpenAI maintains a separate chatgpt.com/backend-api/codex endpoint with rate limits tied to your ChatGPT account rather than API billing. This project is essentially a credential-reuse router: it reads your local auth file and presents that endpoint as the standard API, letting you use allowances you already have instead of buying credits.

Key highlights

  • Exposes /v1/chat/completions, /v1/responses, and /v1/models with support for streaming, tool calls, and reasoning traces.
  • Discovers which Codex models your account actually has access to rather than hardcoding a list.
  • Ships as both a standalone CLI proxy and a drop-in Vercel AI SDK provider package.
  • Defaults to strict localhost binding and reads from standard Codex/ChatGPT auth paths like ~/.codex/auth.json.
  • Offers deep configurability for upstream URLs, OAuth client IDs, and token endpoints, suggesting the authors expect the backend to shift.

Caveats

  • The project is unofficial and carries an unusually forceful legal disclaimer: do not host it publicly, do not share tokens, and do not pool access; misuse risks account suspension.
  • It does not handle the initial login flow itself; you need an existing local auth cache from the official Codex CLI.
  • The CLI /v1/responses endpoint is stateless, so callers must supply the full conversation history on every request.

Verdict Worth a look if you already use ChatGPT and want to experiment with the OpenAI API without a separate API billing account. Skip it if you need a hosted, multi-user, or production-grade solution—the authors explicitly warn against all three.

Frequently asked

What is EvanZhouDev/openai-oauth?
An unofficial proxy that borrows your ChatGPT/Codex OAuth tokens to serve a local OpenAI-compatible API, bypassing API credit billing.
Is openai-oauth open source?
Yes — EvanZhouDev/openai-oauth is open source, released under the Apache-2.0 license.
What language is openai-oauth written in?
EvanZhouDev/openai-oauth is primarily written in TypeScript.
How popular is openai-oauth?
EvanZhouDev/openai-oauth has 1.3k stars on GitHub.
Where can I find openai-oauth?
EvanZhouDev/openai-oauth is on GitHub at https://github.com/EvanZhouDev/openai-oauth.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.