AI Briefing
KO

openai-oauth - Use the OpenAI API for free with a ChatGPT account

·2026.04.16 09:31

Key point

An unofficial tool that spins up an OpenAI-compatible API proxy using ChatGPT OAuth tokens.

Details

An open-source project has been introduced that lets you call the OpenAI API using a ChatGPT account's OAuth token, without needing separate API credits.

With a single command, npx openai-oauth, it spins up a local proxy server and instantly creates an OpenAI-compatible endpoint at http://127.0.0.1:10531/v1. You can use /v1/responses, /v1/chat/completions, and /v1/models without a separate API key, and streaming, tool calling, and reasoning traces all work.

It's also provided as a Vercel AI SDK Provider, allowing you to call models in TypeScript with createOpenAIOAuth(). Only LLMs supported by Codex can be used as models, which are automatically discovered based on the account's Codex plan, and can also be manually specified with --models.

However, this proxy is stateless, so you must send the entire conversation history yourself on each call. The login flow is not bundled, and you need to create the auth file with npx @openai/codex login. The token is stored at ~/.codex/auth.json, and expiration renewal is handled automatically thanks to the ensureFresh default.

Since this project is an unofficial community project unrelated to OpenAI, the auth cache should be treated as a password-level credential. The author recommends using it only for personal local experimentation, and also notes the possibility of account suspension or termination in case of misuse.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.