@yan06/openai-oauth
v2.0.2
Published
Free OpenAI API access with your ChatGPT account.
Maintainers
Readme
openai-oauth
Turn your ChatGPT account into an OpenAI-compatible local API.
> npx @yan06/openai-oauth
OpenAI-compatible endpoint ready at http://127.0.0.1:10531/v1
Use this as your OpenAI base URL. No API key is required.
Available Models: gpt-5.6-sol, gpt-5.6-terra, ...
[d] Run in background [q] QuitPress d to keep it running in the background or q to quit. You can also manage it directly:
npx @yan06/openai-oauth --detach
npx @yan06/openai-oauth status
npx @yan06/openai-oauth logs --follow
npx @yan06/openai-oauth stopPackage Notes
openai-oauth exposes an OpenAI-compatible local endpoint backed by your ChatGPT account.
Supported endpoints:
/v1/responses/v1/chat/completions/v1/images/generations/v1/images/edits/v1/models
Image generation uses JSON requests. Image editing uses the standard OpenAI multipart request with one or more image fields. Both return base64 image data and usage metadata.
curl http://127.0.0.1:10531/v1/images/generations \
-H "Content-Type: application/json" \
-d '{"model":"gpt-image-2","prompt":"A tiny house in a forest","quality":"low"}'Common flags:
| Config | Flag | Default |
| --- | --- | --- |
| Host binding | --host | 127.0.0.1 |
| Port | --port | 10531 |
| Model allowlist | --models | Account-specific Codex models discovered from ChatGPT |
| Auth file path | --oauth-file | $CODEX_HOME/auth.json or ~/.codex/auth.json |
| Open browser | --open / --no-open | --open |
| Login timeout | --login-timeout-ms | 300000 |
Binding --host beyond loopback exposes the proxy to your network. Anyone who can reach that port can make requests with your ChatGPT account.
Login listens on loopback and uses http://localhost:1455/auth/callback, the local callback URL accepted by OpenAI OAuth.
The CLI resolves the latest published Codex client version automatically. Advanced flags also exist for overriding it, the upstream Codex base URL, OAuth client id, and OAuth token URL.
