Skip to content

Commit 1c91aa5

Browse files
committed
docs(readme): document the chatgpt subscription provider
1 parent 0be36e4 commit 1c91aa5

3 files changed

Lines changed: 99 additions & 6 deletions

File tree

README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ llm-stream is a Rust library and CLI tool for streaming interactions with Large
99
## Features
1010

1111
- Streaming support for various LLM providers
12+
- Sign in with a ChatGPT subscription — reach GPT models without a metered `OPENAI_API_KEY`
13+
- Reasoning-model support: effort levels and optional reasoning summaries
1214
- Easy-to-use API for integrating LLM capabilities into Rust applications
1315
- Command-line interface for quick interactions with LLMs
1416

@@ -20,7 +22,7 @@ To use llm-stream in your Rust project, add the following to your `Cargo.toml`:
2022

2123
```toml
2224
[dependencies]
23-
llm-stream = "0.1.0"
25+
llm-stream = "0.5.0"
2426
```
2527

2628
### CLI Tool
@@ -86,6 +88,70 @@ For more CLI options and usage information, run:
8688
llm-stream --help
8789
```
8890

91+
### ChatGPT subscription
92+
93+
`llm-stream` can reach GPT models through a ChatGPT subscription instead of a metered
94+
`OPENAI_API_KEY`. Sign in once, in a browser:
95+
96+
```bash
97+
llm-stream --login # opens a browser; prints: signed in as you@example.com (plus)
98+
llm-stream --login-status # who is signed in, and how long the access token has left
99+
llm-stream --logout # deletes the stored credentials
100+
```
101+
102+
Then talk to it with `--api chatgpt` (aliases: `chat-gpt`, `codex`):
103+
104+
```bash
105+
llm-stream --api chatgpt "say PONG"
106+
llm-stream --api chatgpt --model gpt-5.6-sol --reasoning-effort high "explain this diff"
107+
llm-stream --api chatgpt --reasoning-summary "what is 17 * 23?"
108+
```
109+
110+
| Flag | What it does |
111+
| --- | --- |
112+
| `--login` | Browser sign-in (OAuth 2.0 + PKCE). Stores credentials at `~/.config/llm-stream/auth.json`, mode `0600`. |
113+
| `--login-status` | Prints the signed-in account, plan, and remaining access-token lifetime. Refreshes nothing. |
114+
| `--logout` | Deletes the stored credentials. Succeeds whether or not any existed. |
115+
| `--models` | Asks the server which models this account may use. Spends a little quota — see below. |
116+
| `--reasoning-effort <low\|medium\|high\|xhigh>` | How hard the model should think. Also settable per preset, or as `reasoning_effort` in `config.toml`. |
117+
| `--reasoning-summary` | Streams the model's reasoning summary to **stderr**, then a `---` rule, then the answer on stdout. The model decides whether to produce a summary at all. |
118+
119+
This endpoint ignores `--temperature`, `--top-p`, and `--top-k`; use `--reasoning-effort`
120+
instead. It does not use `--api-key` or `--api-env`. Passing any of them prints a warning
121+
to stderr and continues.
122+
123+
Answers always go to stdout and everything else to stderr, so `llm-stream --api chatgpt
124+
"..." | cat` gives you the answer and nothing else.
125+
126+
#### Which models work
127+
128+
The server decides, per plan and per rollout, so `llm-stream` ships **no local allowlist**:
129+
`--model` is passed through verbatim and the server's own refusal is what you see. Ask your
130+
own account:
131+
132+
```bash
133+
llm-stream --models
134+
```
135+
136+
It probes one model at a time and prints a table. Each accepted probe opens a real request
137+
and spends a small amount of your subscription's Codex allowance, so it warns you before it
138+
starts.
139+
140+
Accepted on a Plus account on **2026-07-28**: `gpt-5.6-sol` (the default), `gpt-5.6-terra`,
141+
`gpt-5.6-luna`, `gpt-5.5`, `gpt-5.4`. Refused on the same account: `gpt-5.3`, `gpt-5.1`,
142+
`gpt-5-codex`. **That list will drift.** It is a snapshot of one account on one day, not a
143+
contract — and a model missing from it is still worth trying with `--model`.
144+
145+
#### What this actually talks to
146+
147+
This provider posts to `https://chatgpt.com/backend-api/codex/responses`, an **undocumented
148+
endpoint internal to OpenAI's Codex CLI**. It is not a public API and there is no
149+
specification to appeal to. OpenAI may change, gate, or block it at any time without notice,
150+
and using it from a client other than Codex is a gray area under OpenAI's terms of use.
151+
Requests draw on your ChatGPT subscription's Codex allowance, not on a metered API key.
152+
153+
Use it knowing that.
154+
89155
## Contributing
90156

91157
Contributions are welcome! Please feel free to submit a Pull Request.

crates/llm_stream/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,27 @@ echo -n "What is the capital of" | llm-stream - "France?"
4646
4747
### Configuration ⚙️
4848

49-
`llm-stream` uses a TOML configuration file to manage settings, API keys, and other customizations. The default configuration file is located at `~/.config/llm-stream.toml`.
49+
`llm-stream` uses a TOML configuration file to manage settings, API keys, and other customizations. The default configuration file is located at `~/.config/llm-stream/config.toml`. Run `llm-stream --config` to print the path in use, or `llm-stream --dir` for the directory.
50+
51+
### ChatGPT subscription 🔐
52+
53+
Reach GPT models through a ChatGPT subscription instead of an `OPENAI_API_KEY`:
54+
55+
```bash
56+
llm-stream --login # browser sign-in, once
57+
llm-stream --api chatgpt "say PONG" # stream an answer
58+
llm-stream --models # which models this account may use
59+
llm-stream --api chatgpt --reasoning-effort high "explain this diff"
60+
```
61+
62+
Credentials are stored at `~/.config/llm-stream/auth.json` with mode `0600`.
63+
`--login-status` shows who is signed in; `--logout` removes the credentials.
64+
65+
This provider rides an **undocumented endpoint internal to OpenAI's Codex CLI**, which
66+
OpenAI may change or block without notice, and it spends your subscription's Codex
67+
allowance rather than a metered API key. See the
68+
[project README](https://github.com/cloudbridgeuy/llm-stream#chatgpt-subscription) for the
69+
full details, the verified model list, and the caveats.
5070

5171
### Presets
5272

lib/llm_stream/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ This library provides a streamlined approach to interacting with Large Language
77

88
## Supported Providers
99

10-
- **OpenAI:** Access the powerful GPT models through OpenAI's API.
10+
- **OpenAI:** Access the GPT models through OpenAI's API.
1111
- **Anthropic:** Utilize Anthropic's Claude models for various language tasks.
1212
- **Google:** Integrate Google's Gemini family of models.
13-
- **Mistral:** Leverage Mistral's language models for advanced capabilities.
14-
- **GitHub Copilot:** Access code-generation capabilities powered by GitHub Copilot.
13+
- **Mistral:** Leverage Mistral's language models, including a fill-in-the-middle endpoint.
14+
- **DeepSeek:** Stream both the answer and the model's reasoning.
15+
- **Groq:** Low-latency inference over open models.
16+
- **Ollama:** Talk to models running locally.
17+
- **Jina:** Embeddings and reranking.
18+
- **ChatGPT (subscription):** Reach GPT models with a ChatGPT subscription's OAuth
19+
credentials instead of a metered API key, over OpenAI's private Responses endpoint.
20+
Undocumented and subject to change without notice — see the
21+
[project README](https://github.com/cloudbridgeuy/llm-stream#chatgpt-subscription).
1522

1623
## Key Features
1724

@@ -26,7 +33,7 @@ Add the following dependency to your `Cargo.toml` file:
2633

2734
```toml
2835
[dependencies]
29-
llm-stream = "0.1.3"
36+
llm-stream = "0.5.0"
3037
```
3138

3239
## Usage

0 commit comments

Comments
 (0)