HeadlinesBriefing favicon HeadlinesBriefing.com

OpenAI OAuth Tool Lets You Access API for Free

Hacker News •
×

A new open-source tool called openai-oauth lets developers access OpenAI's API without paying for credits by using their ChatGPT account credentials. Created by EvanZhouDev, the tool works by creating a localhost proxy that authenticates through OAuth tokens stored in your local ChatGPT or Codex cache files. Users can simply run npx openai-oauth to start a local server that provides OpenAI-compatible endpoints.

openai-oauth offers two main interfaces: a command-line tool for quick setup and a Vercel AI SDK provider for integration into applications. The CLI creates a proxy at http://127.0.0.1:10531/v1 that supports endpoints like /v1/chat/completions and /v1/models. The provider version allows developers to import and use OpenAI models directly in their code with functions like createOpenAIOAuth(). Both versions share the same core OAuth transport settings and can be configured for host binding, port selection, and model access.

Currently, the tool supports only the LLMs available through OpenAI's Codex API, meaning access is limited to models your ChatGPT account has permissions for. The project explicitly warns users not to run it as a hosted service or share access tokens. Since it uses OAuth credentials that are essentially password-equivalent, it should only be used for personal experimentation on trusted machines. The tool is community-maintained and unaffiliated with OpenAI, provided 'as is' with no warranties.