openai-oauth 1.0.2 → 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 +23 -57
- package/dist/chunk-XZLFK5NT.js +1441 -0
- package/dist/cli.js +197 -78
- package/dist/index.d.ts +13 -50
- package/dist/index.js +3 -1
- package/package.json +26 -6
- package/dist/chunk-2AENSHRT.js +0 -22829
package/README.md
CHANGED
|
@@ -1,76 +1,42 @@
|
|
|
1
1
|
# openai-oauth
|
|
2
2
|
|
|
3
|
-
[GitHub](https://github.com/EvanZhouDev/openai-oauth) | [
|
|
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
|
-
|
|
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.
|
|
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
|
-
##
|
|
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
|
-
|
|
17
|
+
`openai-oauth` exposes an OpenAI-compatible local endpoint backed by your ChatGPT account.
|
|
61
18
|
|
|
62
|
-
|
|
19
|
+
Supported endpoints:
|
|
63
20
|
|
|
64
|
-
|
|
21
|
+
- `/v1/responses`
|
|
22
|
+
- `/v1/chat/completions`
|
|
23
|
+
- `/v1/models`
|
|
65
24
|
|
|
66
|
-
|
|
25
|
+
Common flags:
|
|
67
26
|
|
|
68
|
-
|
|
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
|
-
|
|
36
|
+
Login listens on loopback and uses `http://localhost:1455/auth/callback`, the local callback URL accepted by OpenAI OAuth.
|
|
71
37
|
|
|
72
|
-
|
|
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
|
-
|
|
40
|
+
## More
|
|
75
41
|
|
|
76
|
-
|
|
42
|
+
[Learn more in the openai-oauth README.](https://github.com/EvanZhouDev/openai-oauth#readme)
|