{"_id":"@brrock/openai-oauth","name":"@brrock/openai-oauth","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@brrock/openai-oauth","version":"1.0.1","description":"Free OpenAI API access with your ChatGPT account.","type":"module","bin":{"openai-oauth":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts src/cli.ts --format esm --dts --outDir dist --clean","dev":"bun ./src/cli.ts","typecheck":"tsc --noEmit","test":"vitest run","test:live":"LIVE_CODEX_E2E=1 vitest run test/live.e2e.test.ts"},"dependencies":{"ai":"6.0.116","yargs":"^17.7.2"},"devDependencies":{"@ai-sdk/openai":"3.0.41","@types/node":"20.17.24","@types/yargs":"^17.0.33","openai-oauth-core":"workspace:*","openai-oauth-provider":"workspace:*","typescript":"latest","vitest":"latest","zod":"^3.25.76"},"author":{"name":"EvanZhouDev"},"license":"AGPL-3.0-only","bugs":{"url":"https://github.com/EvanZhouDev/openai-oauth/issues"},"homepage":"https://github.com/EvanZhouDev/openai-oauth#readme","gitHead":"3dfdbda7d03b7e44e9985b87715c96b8e14b3d32","_id":"@brrock/openai-oauth@1.0.1","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-iTzXClHSQPjOR4MJSgQvJdfvhceE5gbUh1FAduZ9LknPjF01LuVDqoNWQhHwIE4LB2YrLUn9z7jLhJAxP8YvwA==","shasum":"92ee6b4e50a72f537a213e2782e8c560fd128924","tarball":"https://registry.npmjs.org/@brrock/openai-oauth/-/openai-oauth-1.0.1.tgz","fileCount":6,"unpackedSize":873217,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDqoVs05yKq/UyTCbBU3v6ABgLu18HdLfyq1Ca9Kau3VAIgRmU64WG9Y+UVKbl8gdYlNi590jvF9IzSx6qqEgZQSME="}]},"_npmUser":{"name":"brrock","email":"brduck@duck.com"},"directories":{},"maintainers":[{"name":"brrock","email":"brduck@duck.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openai-oauth_1.0.1_1777576495724_0.5018822497311368"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-30T19:14:55.656Z","1.0.1":"2026-04-30T19:14:55.892Z","modified":"2026-04-30T19:14:56.067Z"},"maintainers":[{"name":"brrock","email":"brduck@duck.com"}],"description":"Free OpenAI API access with your ChatGPT account.","homepage":"https://github.com/EvanZhouDev/openai-oauth#readme","author":{"name":"EvanZhouDev"},"bugs":{"url":"https://github.com/EvanZhouDev/openai-oauth/issues"},"license":"AGPL-3.0-only","readme":"# @brrock/openai-oauth\n\n[GitHub](https://github.com/EvanZhouDev/openai-oauth) | [Legal](#legal)\n\nOpenAI-compatible local endpoint backed by your ChatGPT account.\n\n## Usage\n\n```bash\nnpx @brrock/openai-oauth\n```\n\nWhen startup succeeds, the CLI prints:\n\n```text\nOpenAI-compatible endpoint ready at http://127.0.0.1:10531/v1\nUse this as your OpenAI base URL. No API key is required.\nAvailable Models: gpt-5.4, gpt-5.3-codex, ...\n```\n\nIf no auth file is available, it fails early and tells you to run:\n\n```bash\nnpx @openai/codex login\n```\n\n## Configuration\n\n| Config            | CLI                 | Default                                                                                                                                                 | Description                                                                                                                        |\n| ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| Host binding      | `--host`            | `0.0.0.0`                                                                                                                                               | Host interface the local proxy binds to. Defaults to all IPv4 interfaces so the proxy works from `localhost` and your LAN IP.     |\n| Port              | `--port`            | `10531`                                                                                                                                                 | Port the local proxy binds to.                                                                                                     |\n| Model allowlist   | `--models`          | Account-specific Codex models discovered from ChatGPT                                                                                                   | Comma-separated list of model ids exposed by `/v1/models`. When omitted, the CLI mirrors the models your account can actually use. |\n| Codex API version | `--codex-version`   | Local `codex --version`, then `@openai/codex` latest from npm, then `0.111.0`                                                                          | Override the Codex API client version used for model discovery.                                                                    |\n| Upstream base URL | `--base-url`        | `https://chatgpt.com/backend-api/codex`                                                                                                                 | Override the upstream Codex base URL.                                                                                              |\n| OAuth client id   | `--oauth-client-id` | `app_EMoamEEZ73f0CkXaXp7hrann`                                                                                                                          | Override the OAuth client id used for refresh.                                                                                     |\n| OAuth token URL   | `--oauth-token-url` | `https://auth.openai.com/oauth/token`                                                                                                                   | Override the OAuth token URL used for refresh.                                                                                     |\n| Auth file path    | `--oauth-file`      | `--oauth-file` path if provided, otherwise `$CHATGPT_LOCAL_HOME/auth.json`, `$CODEX_HOME/auth.json`, `~/.chatgpt-local/auth.json`, `~/.codex/auth.json` | Override where the local OAuth auth file is discovered.                                                                            |\n\n## Features\n\nWhat currently works:\n\n- Working Endpoints:\n  - `/v1/responses`\n  - `/v1/chat/completions`\n  - `/v1/models` (account-aware by default, or overridden with `--models`)\n- Streaming Responses\n- Toolcalls\n- Reasoning Traces\n\n## Known Limitations\n\nWhat is intentionally not there yet:\n\n- Only LLMs supported by Codex are available. This lists updates over time and is dependent on your Codex plan.\n- Login flow is intentionally not bundled. Simply run `npx @openai/codex login` to create the auth file.\n- There is no stateful replay support on the CLI `/v1/responses` endpoint. The proxy is stateless and expects callers to send the full conversation history.\n\n## How it Works\n\nOpenAI's Codex CLI uses a special endpoint at `chatgpt.com/backend-api/codex/responses` to let you use special OpenAI rate limits tied to your ChatGPT account.\n\nBy using the same Oauth tokens as Codex, we can effectively use OpenAI's API through Oauth instead of buying API credits.\n\n## Legal\n\nThis is an unofficial, community-maintained project and is not affiliated with, endorsed by, or sponsored by OpenAI, Inc.\n\nIt uses your local Codex/ChatGPT authentication cache (auth.json, e.g. `~/.codex/auth.json`) and should be treated like password-equivalent credentials.\n\nUse only for personal, local experimentation on trusted machines; do not run as a hosted service, do not share access, and do not pool or redistribute tokens.\n\nYou are solely responsible for complying with OpenAI’s Terms, policies, and any applicable agreements; misuse may result in rate limits, suspension, or termination.\n\nProvided “as is” with no warranties; you assume all risk for data exposure, costs, and account actions.\n","readmeFilename":"README.md","_rev":"1-7abb9c045f41c7f11429ce8e2abe194e"}