openai-oauth 1.0.1 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,76 +1,42 @@
1
1
  # openai-oauth
2
2
 
3
- [GitHub](https://github.com/EvanZhouDev/openai-oauth) | [Legal](#legal)
3
+ [Docs](https://github.com/EvanZhouDev/openai-oauth#dev-proxy) | [GitHub](https://github.com/EvanZhouDev/openai-oauth) | [npm](https://www.npmjs.com/package/openai-oauth)
4
4
 
5
- OpenAI-compatible local endpoint backed by your ChatGPT account.
6
-
7
- ## Usage
5
+ Turn your ChatGPT account into an OpenAI-compatible local API.
8
6
 
9
7
  ```bash
10
- npx openai-oauth
11
- ```
8
+ > npx openai-oauth
12
9
 
13
- When startup succeeds, the CLI prints:
14
-
15
- ```text
16
10
  OpenAI-compatible endpoint ready at http://127.0.0.1:10531/v1
17
11
  Use this as your OpenAI base URL. No API key is required.
18
- Available Models: gpt-5.4, gpt-5.3-codex, ...
19
- ```
20
-
21
- If no auth file is available, it fails early and tells you to run:
22
-
23
- ```bash
24
- npx @openai/codex login
12
+ Available Models: gpt-5.5, gpt-5.4, ...
25
13
  ```
26
14
 
27
- ## Configuration
28
-
29
- | Config | CLI | Default | Description |
30
- | ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
31
- | Host binding | `--host` | `127.0.0.1` | Host interface the local proxy binds to. |
32
- | Port | `--port` | `10531` | Port the local proxy binds to. |
33
- | 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. |
34
- | 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. |
35
- | Upstream base URL | `--base-url` | `https://chatgpt.com/backend-api/codex` | Override the upstream Codex base URL. |
36
- | OAuth client id | `--oauth-client-id` | `app_EMoamEEZ73f0CkXaXp7hrann` | Override the OAuth client id used for refresh. |
37
- | OAuth token URL | `--oauth-token-url` | `https://auth.openai.com/oauth/token` | Override the OAuth token URL used for refresh. |
38
- | 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. |
39
-
40
- ## Features
41
-
42
- What currently works:
43
-
44
- - Working Endpoints:
45
- - `/v1/responses`
46
- - `/v1/chat/completions`
47
- - `/v1/models` (account-aware by default, or overridden with `--models`)
48
- - Streaming Responses
49
- - Toolcalls
50
- - Reasoning Traces
51
-
52
- ## Known Limitations
53
-
54
- What is intentionally not there yet:
55
-
56
- - Only LLMs supported by Codex are available. This lists updates over time and is dependent on your Codex plan.
57
- - Login flow is intentionally not bundled. Simply run `npx @openai/codex login` to create the auth file.
58
- - 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.
15
+ ## Package Notes
59
16
 
60
- ## How it Works
17
+ `openai-oauth` exposes an OpenAI-compatible local endpoint backed by your ChatGPT account.
61
18
 
62
- OpenAI'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.
19
+ Supported endpoints:
63
20
 
64
- By using the same Oauth tokens as Codex, we can effectively use OpenAI's API through Oauth instead of buying API credits.
21
+ - `/v1/responses`
22
+ - `/v1/chat/completions`
23
+ - `/v1/models`
65
24
 
66
- ## Legal
25
+ Common flags:
67
26
 
68
- This is an unofficial, community-maintained project and is not affiliated with, endorsed by, or sponsored by OpenAI, Inc.
27
+ | Config | Flag | Default |
28
+ | --- | --- | --- |
29
+ | Host binding | `--host` | `127.0.0.1` |
30
+ | Port | `--port` | `10531` |
31
+ | Model allowlist | `--models` | Account-specific Codex models discovered from ChatGPT |
32
+ | Auth file path | `--oauth-file` | `$CHATGPT_LOCAL_HOME/auth.json`, `$CODEX_HOME/auth.json`, `~/.chatgpt-local/auth.json`, or `~/.codex/auth.json` |
33
+ | Open browser | `--open` / `--no-open` | `--open` |
34
+ | Login timeout | `--login-timeout-ms` | `300000` |
69
35
 
70
- It uses your local Codex/ChatGPT authentication cache (auth.json, e.g. `~/.codex/auth.json`) and should be treated like password-equivalent credentials.
36
+ Login listens on loopback and uses `http://localhost:1455/auth/callback`, the local callback URL accepted by OpenAI OAuth.
71
37
 
72
- Use 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.
38
+ Advanced flags also exist for overriding the upstream Codex base URL, OAuth client id, OAuth token URL, and Codex API version.
73
39
 
74
- You are solely responsible for complying with OpenAI’s Terms, policies, and any applicable agreements; misuse may result in rate limits, suspension, or termination.
40
+ ## More
75
41
 
76
- Provided “as is” with no warranties; you assume all risk for data exposure, costs, and account actions.
42
+ [Learn more in the openai-oauth README.](https://github.com/EvanZhouDev/openai-oauth#readme)