Skip to content

Commit 76ab172

Browse files
lidge-junclaude
andcommitted
docs(readme): rewrite — accurate providers/adapters, OAuth, sidecars, docs link
Replace the stale README: correct 5-adapter/auth-mode table, OAuth + Ollama Cloud + the API-key catalog, the sidecars, the subagent picker, the full CLI list, and a link to the new docs site at lidge-jun.github.io/opencodex. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8072de9 commit 76ab172

1 file changed

Lines changed: 80 additions & 99 deletions

File tree

README.md

Lines changed: 80 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,132 @@
1-
# opencodex (ocx)
1+
# opencodex (`ocx`)
22

3-
Universal provider proxy for [OpenAI Codex](https://openai.com/codex) — use **any LLM** with Codex CLI, App, and SDK.
3+
**Universal provider proxy for [OpenAI Codex](https://openai.com/codex) — use any LLM with Codex CLI, App, and SDK.**
44

5-
Codex only speaks the Responses API (`/v1/responses`). opencodex sits between Codex and your LLM provider, translating protocols on the fly.
5+
📖 **[Full documentation →](https://lidge-jun.github.io/opencodex/)**
6+
7+
Codex only speaks the Responses API (`/v1/responses`). opencodex sits between Codex and your LLM
8+
provider, translating the protocol on the fly — streaming, tool calls, reasoning, and images included
9+
— in both directions.
610

711
```
8-
Codex CLI/App/SDK /v1/responsesopencodex Any Provider
9-
10-
Anthropic · Google · OpenRouter
11-
Groq · Ollama · Azure · OpenAI
12+
Codex CLI / App / SDK ──/v1/responses──▶ opencodex ──▶ Any provider
13+
14+
Anthropic · Google · xAI · Kimi · Ollama Cloud · Groq
15+
OpenRouter · Azure · DeepSeek · GLM · …and OpenAI itself
1216
```
1317

14-
## Quick Start
18+
## Quick start
1519

1620
```bash
1721
# Install
18-
bun install -g opencodex
22+
bun install -g opencodex # or: npm install -g opencodex
1923

20-
# Interactive setup (creates config + injects into Codex)
24+
# Interactive setup (writes config + injects into Codex)
2125
ocx init
2226

2327
# Start the proxy
2428
ocx start
2529

26-
# Use Codex normally — it routes through opencodex
27-
codex "Write a hello world in Python"
30+
# Use Codex normally — it now routes through opencodex
31+
codex "Write a hello world in Rust"
2832
```
2933

30-
## Supported Providers
34+
Target a specific routed model with the `provider/model` form:
3135

32-
| Provider | Adapter | Protocol |
33-
|----------|---------|----------|
34-
| OpenAI | `openai-responses` | Responses API (passthrough) |
35-
| Anthropic | `anthropic` | Messages API |
36-
| Google Gemini | `google` | Generative AI REST |
37-
| Azure OpenAI | `azure-openai` | Responses API + Azure auth |
38-
| OpenCode Go | `openai-chat` | Chat Completions |
39-
| OpenRouter | `openai-chat` | Chat Completions |
40-
| Groq | `openai-chat` | Chat Completions |
41-
| Ollama | `openai-chat` | Chat Completions |
42-
| LM Studio | `openai-chat` | Chat Completions |
43-
| vLLM | `openai-chat` | Chat Completions |
44-
| Any OpenAI-compatible | `openai-chat` | Chat Completions |
36+
```bash
37+
codex -m "anthropic/claude-opus-4-8" "Explain this stack trace"
38+
codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
39+
```
4540

46-
## CLI Commands
41+
## Highlights
42+
43+
- **Five adapters** cover Anthropic Messages, Google Gemini, Azure, the OpenAI Responses passthrough,
44+
and **every OpenAI-compatible Chat Completions** endpoint.
45+
- **OAuth, API key, or ChatGPT forward.** Log in with your xAI / Anthropic / Kimi account (tokens
46+
auto-refresh), forward your `codex login`, or paste a key (`${ENV_VARS}` supported). An 18-provider
47+
API-key catalog (incl. **Ollama Cloud**) is built in.
48+
- **Drops into Codex.** Injects a `[model_providers.opencodex]` table into `~/.codex/config.toml` and
49+
merges routed models into Codex's catalog and subagent picker — fully reversible.
50+
- **Sidecars.** Give non-OpenAI models real **web search** and **image understanding** via a
51+
`gpt-5.4-mini` over your ChatGPT login.
52+
- **Web dashboard** for providers, OAuth login, model selection, and request logs.
53+
54+
## Providers & adapters
55+
56+
| Provider | Adapter | Auth |
57+
|---|---|---|
58+
| OpenAI (ChatGPT login) | `openai-responses` | forward (no key) |
59+
| OpenAI (API key) | `openai-responses` | key |
60+
| Anthropic Claude | `anthropic` | oauth / key |
61+
| xAI Grok | `openai-chat` | oauth / key |
62+
| Kimi (Moonshot) | `openai-chat` | oauth / key |
63+
| Google Gemini | `google` | key |
64+
| Azure OpenAI | `azure` | key |
65+
| Ollama Cloud + 17-provider catalog | `openai-chat` | key |
66+
| Ollama / vLLM / LM Studio (local) | `openai-chat` | key (usually blank) |
67+
| Any OpenAI-compatible endpoint | `openai-chat` | key |
68+
69+
## CLI
4770

4871
```bash
49-
ocx init # Interactive setup
50-
ocx start [--port 10100] # Start proxy
51-
ocx stop # Stop proxy
52-
ocx status # Check proxy status
53-
ocx gui # Open web dashboard
72+
ocx init # interactive setup
73+
ocx start [--port 10100] # start the proxy
74+
ocx stop # stop + restore native Codex
75+
ocx restore # restore without stopping (alias: ocx eject)
76+
ocx sync # refresh models + re-inject into Codex
77+
ocx status # is the proxy running?
78+
ocx login <xai|anthropic|kimi> # OAuth login
79+
ocx logout <provider> # remove a stored login
80+
ocx gui # open the web dashboard
81+
ocx service <install|start|stop|status|uninstall> # run as a background service
5482
```
5583

5684
## Configuration
5785

58-
Config lives at `~/.opencodex/config.json`:
86+
Config lives at `~/.opencodex/config.json`. Minimal example:
5987

6088
```json
6189
{
6290
"port": 10100,
91+
"defaultProvider": "anthropic",
6392
"providers": {
6493
"anthropic": {
6594
"adapter": "anthropic",
6695
"baseUrl": "https://api.anthropic.com",
67-
"apiKey": "sk-ant-...",
68-
"defaultModel": "claude-sonnet-4-20250514"
96+
"authMode": "oauth",
97+
"defaultModel": "claude-sonnet-4-6"
6998
},
70-
"opencode-go": {
99+
"ollama-cloud": {
71100
"adapter": "openai-chat",
72-
"baseUrl": "https://opencode.ai/zen/go/v1",
73-
"apiKey": "sk-...",
74-
"defaultModel": "kimi-k2.5"
101+
"baseUrl": "https://ollama.com/v1",
102+
"apiKey": "${OLLAMA_API_KEY}",
103+
"defaultModel": "glm-5.2"
75104
}
76-
},
77-
"defaultProvider": "anthropic"
105+
}
78106
}
79107
```
80108

81-
`ocx init` automatically adds to your Codex config:
82-
83-
```toml
84-
# ~/.codex/config.toml
85-
model_provider = "opencodex"
86-
87-
[model_providers.opencodex]
88-
base_url = "http://localhost:10100/v1"
89-
wire_api = "responses"
90-
```
91-
92-
## Model Routing
93-
94-
opencodex automatically routes models to the right provider:
109+
See the **[Configuration reference](https://lidge-jun.github.io/opencodex/reference/configuration/)**
110+
for every field.
95111

96-
- `claude-*``anthropic` adapter
97-
- `gpt-*`, `o1-*`, `o3-*``openai` adapter
98-
- `gemini-*``google` adapter
99-
- Other models → default provider
112+
## Documentation
100113

101-
## Web Dashboard
102-
103-
```bash
104-
# Start proxy first
105-
ocx start
106-
107-
# In another terminal, start the GUI dev server
108-
cd gui && bun dev
109-
```
110-
111-
Dashboard features:
112-
- Real-time proxy status and uptime
113-
- Provider management (add/edit/remove)
114-
- Request log viewer with auto-refresh
115-
116-
## Architecture
117-
118-
```
119-
src/
120-
├── cli.ts # CLI entry (ocx command)
121-
├── server.ts # Bun.serve + routing + management API
122-
├── router.ts # Model → provider routing
123-
├── config.ts # Config management + PID
124-
├── bridge.ts # AdapterEvent → Responses SSE
125-
├── init.ts # Interactive setup
126-
├── codex-inject.ts # Codex config.toml injection
127-
├── types.ts # Core types
128-
├── responses/
129-
│ ├── parser.ts # Responses API → internal context
130-
│ └── schema.ts # Zod validation schemas
131-
└── adapters/
132-
├── base.ts # Adapter interface
133-
├── openai-chat.ts # Chat Completions (Tier 1)
134-
├── anthropic.ts # Anthropic Messages
135-
├── google.ts # Google Generative AI
136-
├── azure.ts # Azure OpenAI
137-
└── openai-responses.ts # Passthrough
138-
```
114+
The full developer documentation — architecture, every adapter, the request lifecycle, the sidecars,
115+
Codex integration, and the CLI/config reference — is an Astro site under [`docs-site/`](./docs-site)
116+
and published to **[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/)**.
139117

140118
## Development
141119

142120
```bash
143-
git clone https://github.com/user/opencodex.git
121+
git clone https://github.com/lidge-jun/opencodex.git
144122
cd opencodex
145123
bun install
146-
bun run dev # Start proxy in dev mode
124+
bun run dev # start the proxy in dev mode
125+
bun x tsc --noEmit # typecheck
147126
```
148127

128+
See **[Contributing](https://lidge-jun.github.io/opencodex/contributing/)**.
129+
149130
## License
150131

151132
MIT

0 commit comments

Comments
 (0)