@legioncodeinc/rflectr 0.1.0 → 0.1.2

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.
Files changed (69) hide show
  1. package/README.md +1 -5
  2. package/dist/cli.js +4 -1
  3. package/dist/cli.js.map +1 -0
  4. package/package.json +4 -1
  5. package/.markdown-link-check.json +0 -7
  6. package/AGENTS.md +0 -169
  7. package/assets/733630021_1421561133353555_3999689754075308337_n.jpg +0 -0
  8. package/assets/github-home-image.png +0 -0
  9. package/assets/og-image.jpg +0 -0
  10. package/assets/og-image.png +0 -0
  11. package/assets/og-image.psd +0 -0
  12. package/assets/rflectr-no-bg.png +0 -0
  13. package/assets/vertex-models.example.json +0 -14
  14. package/library/README.md +0 -39
  15. package/library/issues/README.md +0 -46
  16. package/library/issues/backlog/README.md +0 -26
  17. package/library/issues/completed/README.md +0 -13
  18. package/library/issues/in-work/README.md +0 -13
  19. package/library/knowledge/README.md +0 -34
  20. package/library/knowledge/private/README.md +0 -40
  21. package/library/knowledge/private/ai/README.md +0 -8
  22. package/library/knowledge/private/ai/model-discovery-classification.md +0 -81
  23. package/library/knowledge/private/ai/translation-layer.md +0 -88
  24. package/library/knowledge/private/architecture/README.md +0 -10
  25. package/library/knowledge/private/architecture/launch-flow-claude.md +0 -93
  26. package/library/knowledge/private/architecture/system-overview.md +0 -108
  27. package/library/knowledge/private/auth/README.md +0 -9
  28. package/library/knowledge/private/auth/oauth-device-flows.md +0 -95
  29. package/library/knowledge/private/data/README.md +0 -8
  30. package/library/knowledge/private/data/preferences-config.md +0 -87
  31. package/library/knowledge/private/data/provider-registry.md +0 -126
  32. package/library/knowledge/private/infrastructure/README.md +0 -7
  33. package/library/knowledge/private/infrastructure/server-gateway.md +0 -87
  34. package/library/knowledge/private/integrations/README.md +0 -8
  35. package/library/knowledge/private/integrations/harnesses.md +0 -87
  36. package/library/knowledge/private/integrations/local-proxy.md +0 -82
  37. package/library/knowledge/private/security/README.md +0 -9
  38. package/library/knowledge/private/security/credential-storage.md +0 -129
  39. package/library/knowledge/private/standards/documentation-framework.md +0 -154
  40. package/library/knowledge/public/README.md +0 -49
  41. package/library/knowledge/public/faqs/README.md +0 -7
  42. package/library/knowledge/public/faqs/troubleshooting.md +0 -92
  43. package/library/knowledge/public/guides/README.md +0 -13
  44. package/library/knowledge/public/guides/ai-agents.md +0 -273
  45. package/library/knowledge/public/guides/api-server.md +0 -108
  46. package/library/knowledge/public/guides/claude-desktop.md +0 -382
  47. package/library/knowledge/public/guides/codex.md +0 -296
  48. package/library/knowledge/public/guides/gemini-cli.md +0 -105
  49. package/library/knowledge/public/guides/model-compatibility.md +0 -80
  50. package/library/knowledge/public/guides/providers.md +0 -90
  51. package/library/knowledge/public/overview/README.md +0 -7
  52. package/library/knowledge/public/overview/what-is-rflectr.md +0 -71
  53. package/library/notes/README.md +0 -21
  54. package/library/requirements/README.md +0 -51
  55. package/library/requirements/backlog/README.md +0 -30
  56. package/library/requirements/completed/README.md +0 -14
  57. package/library/requirements/completed/prd-001-cli-core-launch-orchestration/prd-001-cli-core-launch-orchestration-index.md +0 -205
  58. package/library/requirements/completed/prd-001-cli-core-launch-orchestration/qa/.gitkeep +0 -0
  59. package/library/requirements/completed/prd-002-provider-registry/qa/.gitkeep +0 -0
  60. package/library/requirements/completed/prd-003-model-discovery-classification/qa/.gitkeep +0 -0
  61. package/library/requirements/completed/prd-004-translation-layer/qa/.gitkeep +0 -0
  62. package/library/requirements/completed/prd-005-local-proxy-catalog-routing/qa/.gitkeep +0 -0
  63. package/library/requirements/completed/prd-007-oauth-device-flows/qa/.gitkeep +0 -0
  64. package/library/requirements/completed/prd-011-claude-desktop-integration/qa/.gitkeep +0 -0
  65. package/library/requirements/in-work/README.md +0 -19
  66. package/library/requirements/reports/README.md +0 -31
  67. package/scripts/refresh-models-dev-cache.mjs +0 -34
  68. package/test-proxy.ts +0 -19
  69. package/test-split.js +0 -1
@@ -1,92 +0,0 @@
1
- # Troubleshooting
2
-
3
- > Category: FAQ | Version: 1.0 | Date: June 2026 | Status: Active
4
-
5
- Common issues when launching **Claude Code** through `rflectr claude`. For Claude Desktop gateway issues, see the [Claude Desktop guide](../guides/claude-desktop.md). For agent/headless issues, see [AI Agents & automation](../guides/ai-agents.md).
6
-
7
- ---
8
-
9
- ## "Not logged in · Please run /login" after picking a model
10
-
11
- **What you see:** Claude Code starts and shows the right model in the status bar (e.g. `moonshotai/kimi-k2.6`), but sending a message returns `Not logged in · Please run /login`.
12
-
13
- **Common cause — you chose "No" on the API key prompt.** When Claude Code detects an `ANTHROPIC_API_KEY` in the session (rflectr sets this for your chosen provider), it may ask:
14
-
15
- ```text
16
- Detected a custom API key in your environment
17
- Do you want to use this API key?
18
- 1. Yes
19
- 2. No (recommended)
20
- ```
21
-
22
- If you pick **No**, Claude Code remembers that and refuses to use the key. rflectr is routing through your provider correctly — Claude Code is blocking the key you rejected. This is **not** a rflectr bug and doesn't mean your provider is misconfigured.
23
-
24
- **Fix — approve the key in Claude Code's config.** Claude Code stores your answer in `~/.claude.json` under `customApiKeyResponses`.
25
-
26
- 1. Quit Claude Code.
27
- 2. Open `~/.claude.json`.
28
- 3. Find the key suffix shown in the prompt (the last part of the masked key, e.g. `iFYB03v8xy4E-xJEYpN8`).
29
- 4. Move that suffix from `rejected` to `approved`:
30
-
31
- ```json
32
- "customApiKeyResponses": {
33
- "approved": ["anything", "iFYB03v8xy4E-xJEYpN8"],
34
- "rejected": []
35
- }
36
- ```
37
-
38
- 5. Save and run `rflectr claude` again.
39
-
40
- > 💡 **Easier next time:** choose **Yes** when the prompt appears — Claude Code remembers approved keys and won't ask again.
41
-
42
- **If you use Claude Max / Pro elsewhere:** you may also have a real Anthropic key in your shell (`~/.zshrc`, etc.). That's fine for other tools. rflectr replaces `ANTHROPIC_API_KEY` in the Claude Code child process with your **provider** key (OpenCode, Nvidia, Groq, …). Pick **Yes** when launching through rflectr.
43
-
44
- ---
45
-
46
- ## Provider works in `rflectr models` but not in `providers list`
47
-
48
- Zen and Go are **cloud builtins** — they appear when you have an OpenCode API key, even if they aren't saved in `~/.rflectr/providers.json`. `rflectr providers list` shows them tagged `· cloud builtin`. Imported BYOK providers (Anthropic, Nvidia, Groq, …) come from the registry file.
49
-
50
- ---
51
-
52
- ## OpenCode import saved placeholder API keys
53
-
54
- If you ran `rflectr providers import` on an older build and see refresh failures for Anthropic (`anything`) or Vertex (`a`), those came from **OpenCode's config**, not Claude Desktop.
55
-
56
- **Current behavior:** import validates keys before saving to the keychain:
57
-
58
- - Placeholders like `anything`, `a`, `ollama` → **not saved** (models still imported).
59
- - Real keys → probed against the provider API before save.
60
- - Vertex / Bedrock / Azure → key not saved (gcloud / AWS auth).
61
-
62
- **To clean up an old placeholder:** re-run import (choose **Use imported** for each provider), or remove the provider and import again:
63
-
64
- ```bash
65
- rflectr providers import
66
- ```
67
-
68
- ---
69
-
70
- ## Use `--trace` for proxy / API errors
71
-
72
- If a model fails mid-session (not the login prompt above):
73
-
74
- ```bash
75
- rflectr claude --trace
76
- ```
77
-
78
- After exit, rflectr prints errors from `~/.rflectr/logs/claude-debug.log` (secrets redacted in the summary). The proxy also logs to `~/.rflectr/logs/proxy-debug.log` when `--trace` is set.
79
-
80
- ---
81
-
82
- ## Still stuck?
83
-
84
- 1. `rflectr providers list` — confirm the provider is there and enabled.
85
- 2. `rflectr claude --dry-run` — preview provider, model, and endpoint without launching.
86
- 3. Open a GitHub issue with the provider name, model id, and (redacted) error text.
87
-
88
- ---
89
-
90
- ## Related guides
91
-
92
- - [Claude Desktop](../guides/claude-desktop.md) · [Codex](../guides/codex.md) · [AI Agents](../guides/ai-agents.md) · [Providers](../guides/providers.md)
@@ -1,13 +0,0 @@
1
- # Guides
2
-
3
- Step-by-step guides for each rflectr surface. New here? Read [What is rflectr?](../overview/what-is-rflectr.md) first.
4
-
5
- | Guide | Use it to… |
6
- |---|---|
7
- | [providers.md](providers.md) | See every provider, its base URL, and gotchas; add or import providers. |
8
- | [claude-desktop.md](claude-desktop.md) | Point Claude Desktop (Cowork + Code) at a local rflectr gateway, and revert cleanly. |
9
- | [codex.md](codex.md) | Run the OpenAI Codex CLI or desktop app on any registry model. |
10
- | [gemini-cli.md](gemini-cli.md) | Run the Google Gemini CLI on any registry model (experimental). |
11
- | [api-server.md](api-server.md) | Run the local Anthropic/OpenAI-compatible gateway (`rflectr server`). |
12
- | [ai-agents.md](ai-agents.md) | Drive rflectr from scripts, CI, and agents with boot flags and clean stdout. |
13
- | [model-compatibility.md](model-compatibility.md) | Understand why a model is hidden, and how to change that. |
@@ -1,273 +0,0 @@
1
- # AI Agents & Automation
2
-
3
- > Category: Guide | Version: 1.0 | Date: June 2026 | Status: Active
4
-
5
- rflectr is built so **AI agents** (scripts, CI, alef-agent, Cursor subagents, …) can launch Claude Code, OpenAI Codex, or Google Gemini CLI against your provider registry **without interactive wizards**, with **clean machine-readable stdout** when needed.
6
-
7
- For the full machine-readable reference — including your live provider/model list — run:
8
-
9
- ```bash
10
- rflectr --ai
11
- rflectr --ai --install # install SKILL.md to agent skill dirs
12
- ```
13
-
14
- ---
15
-
16
- ## Quick reference
17
-
18
- | Goal | Command |
19
- |---|---|
20
- | Agent reference | `rflectr --ai` |
21
- | Install agent skill | `rflectr --ai --install` |
22
- | Claude one-shot (text) | `rflectr claude --provider <id> --model <id> -p "prompt"` |
23
- | Claude NDJSON stream | `rflectr claude --provider <id> --model <id> -p "…" --output-format stream-json` |
24
- | Codex one-shot (text) | `rflectr codex --provider <id> --model <id> exec "prompt"` |
25
- | Codex JSONL events | `rflectr codex --provider <id> --model <id> exec --json "prompt"` |
26
- | Gemini one-shot (text) | `rflectr gemini --provider <id> --model <id> -p "prompt"` |
27
- | Gemini NDJSON stream | `rflectr gemini --provider <id> --model <id> -p "…" -o stream-json` |
28
- | Model slug | `--model zen__deepseek-v4-flash-free` (= `--provider zen --model deepseek-v4-flash-free`) |
29
- | List providers/models | `rflectr providers list` or read `~/.rflectr/providers.json` |
30
-
31
- ---
32
-
33
- ## Boot flags (`--provider` / `--model`)
34
-
35
- rflectr consumes these flags **before** spawning the child. They are **not** passed through.
36
-
37
- | Flag | Purpose |
38
- |---|---|
39
- | `--provider <id>` | Registry provider id (`groq`, `google`, `zen`, `go`, …). |
40
- | `--model <id>` | Model id from that provider's cache. |
41
- | `--model <provider>__<model-id>` | Slug form — provider embedded in the model string. |
42
-
43
- ### When the wizard is skipped
44
-
45
- - **Claude (`rflectr claude`):** both `--provider` and `--model` set, **or** print mode (`-p` / `--print`) with saved prefs from a prior interactive launch.
46
- - **Codex (`rflectr codex`):** both flags set, **or** non-interactive args (`exec` or a positional prompt) with saved prefs.
47
- - **Gemini (`rflectr gemini`):** both flags set, **or** non-interactive args (`-p`, `-i`, or a positional query) with saved prefs.
48
-
49
- > In CI / headless loops, **always pass `--provider` and `--model`** — never rely on saved prefs alone.
50
-
51
- ### Examples
52
-
53
- ```bash
54
- # Claude — explicit boot
55
- rflectr claude --provider groq --model llama-3.3-70b-versatile -p "Summarize README.md"
56
- # Claude — slug
57
- rflectr claude --model zen__deepseek-v4-flash-free -p "Review this diff"
58
-
59
- # Codex — explicit boot
60
- rflectr codex --provider openai --model gpt-5.4 exec "implement feature X"
61
- # Codex — slug
62
- rflectr codex --model zen__deepseek-v4-flash-free exec "fix the test"
63
-
64
- # Gemini — explicit boot
65
- rflectr gemini --provider google --model gemini-2.5-flash -p "Review this file"
66
- # Gemini — slug
67
- rflectr gemini --model zen__deepseek-v4-flash-free -p "Refactor the module"
68
- ```
69
-
70
- ---
71
-
72
- ## Clean stdout for NDJSON / JSONL
73
-
74
- When an agent parses **every line on stdout as JSON**, rflectr must not print boot UI (intro, spinner, proxy banners) on stdout. It detects machine-readable mode and **suppresses all boot UI on stdout** — messages still go to **stderr**.
75
-
76
- | Agent | Trigger | Child output |
77
- |---|---|---|
78
- | Claude | `-p` + `--output-format stream-json` or `json` | NDJSON (one object per line) |
79
- | Claude | `-p` + `--input-format stream-json` | NDJSON |
80
- | Codex | `exec --json` | JSONL event stream |
81
- | Gemini | `-p` + `-o stream-json` or `json` | NDJSON |
82
-
83
- > **Claude `--verbose`** is required by Claude Code for `stream-json` in print mode. rflectr **auto-adds `--verbose`** when it's missing.
84
-
85
- **Verify clean stdout:**
86
-
87
- ```bash
88
- rflectr claude --provider zen --model deepseek-v4-flash-free \
89
- -p "PONG" --output-format stream-json 2>/dev/null \
90
- | node -e "process.stdin.on('data',d=>d.toString().split('\n').filter(Boolean).forEach(l=>JSON.parse(l))); console.log('ok')"
91
- ```
92
-
93
- Interactive TTY launches (`rflectr claude` with no `-p`) still show the normal human UI.
94
-
95
- ---
96
-
97
- ## Codex sandbox (network for shell tools)
98
-
99
- `rflectr codex` defaults to **`danger-full-access`** — written into the launch profile (`sandbox = "danger-full-access"`) and passed on spawn as `-s danger-full-access` (needed on macOS even when in the profile). This lets Codex shell tools reach the network (`curl`, `nlm`, npm, MCP CLIs).
100
-
101
- ```bash
102
- rflectr codex -s workspace-write exec "task" # override for one session
103
- rflectr codex --dangerously-bypass-approvals-and-sandbox exec "x" # bypass entirely (Codex flag)
104
- ```
105
-
106
- `rflectr codex-app` does **not** change your personal `~/.codex/config.toml` sandbox. See [Codex § Sandbox](codex.md#sandbox-and-network-cli).
107
-
108
- ---
109
-
110
- ## Provider discovery
111
-
112
- **Machine-readable catalog (recommended for agents):**
113
-
114
- ```text
115
- ~/.rflectr/providers.json
116
- → providers[].id
117
- → providers[].modelsCache.models[].id
118
- → providers[].enabled
119
- ```
120
-
121
- ```bash
122
- rflectr providers refresh-models # refresh all stale lists
123
- rflectr providers refresh-models groq # refresh one provider
124
- ```
125
-
126
- **Built-in cloud providers** (not in `providers.json`): `zen` and `go`, both requiring `OPENCODE_API_KEY`.
127
-
128
- **Preview without launching:**
129
-
130
- ```bash
131
- rflectr claude --dry-run --provider groq --model llama-3.3-70b-versatile
132
- rflectr codex --config --provider zen --model deepseek-v4-flash-free
133
- ```
134
-
135
- ---
136
-
137
- ## Tool calling & MCP
138
-
139
- **Claude Code** — pass tool flags **after** rflectr's boot flags (they go to Claude):
140
-
141
- ```bash
142
- rflectr claude --provider google --model gemini-2.5-flash \
143
- -p "How many notebooks?" \
144
- --output-format stream-json \
145
- --allowed-tools mcp__notebooklm-mcp__notebook_list
146
- ```
147
-
148
- **Codex** — MCP servers come from your Codex config (`~/.codex/config.toml`), not rflectr. With default `danger-full-access`, network-blocked MCP/CLI errors should be resolved; MCP must still be configured in Codex.
149
-
150
- ---
151
-
152
- ## Multi-model agent loops
153
-
154
- ```bash
155
- for model in llama-3.3-70b-versatile mixtral-8x7b-32768; do
156
- rflectr claude --provider groq --model "$model" -p "Same prompt for all models"
157
- done
158
-
159
- for model in deepseek-v4-flash-free qwen3.6-plus-free; do
160
- rflectr codex --provider zen --model "$model" exec --json "Same task"
161
- done
162
-
163
- for model in gemini-2.5-flash gemini-2.5-pro; do
164
- rflectr gemini --provider google --model "$model" -p "Same task"
165
- done
166
- ```
167
-
168
- Boot flags use **single-model launch** (the favorites catalog is skipped) — better for one-shot jobs. Use `rflectr models` + interactive launch for mid-session `/model` switching.
169
-
170
- ---
171
-
172
- ## Zen / Go cloud providers
173
-
174
- For Claude `-p` and Codex `exec` against OpenCode Zen or Go:
175
-
176
- - Pass `--provider zen` or `--provider go` explicitly in agent configs.
177
- - Ensure `OPENCODE_API_KEY` is in the environment or OS keychain (rflectr resolves it before launch).
178
-
179
- ---
180
-
181
- ## Codex proxy notes (DeepSeek / reasoning models)
182
-
183
- Non-OpenAI models routed through rflectr's Codex proxy use the Responses API adapter. **Reasoning content** from thinking models (e.g. DeepSeek) is round-tripped on tool loops, so turn 2+ doesn't fail with missing `reasoning_content`.
184
-
185
- ---
186
-
187
- ## alef-agent integration
188
-
189
- alef-agent shells out to CLI backends and parses **NDJSON/JSONL on stdout**. Use rflectr as the **wrapper executable** with boot flags prepended.
190
-
191
- **Claude backend (stream-json):**
192
-
193
- ```bash
194
- rflectr claude --provider <id> --model <id> -p "<prompt>" \
195
- --output-format stream-json [--verbose] \
196
- [--max-turns, --permission-mode, --allowed-tools, …]
197
- ```
198
-
199
- **Codex backend (exec --json):**
200
-
201
- ```bash
202
- rflectr codex --provider <id> --model <id> exec --json "<prompt>" [codex flags]
203
- ```
204
-
205
- **Gemini backend (stream-json):**
206
-
207
- ```bash
208
- rflectr gemini --provider <id> --model <id> -p "<prompt>" -o stream-json [gemini flags]
209
- ```
210
-
211
- ### Checklist
212
-
213
- 1. **Executable:** `rflectr` on `PATH` (`npm link` after dev builds).
214
- 2. **Always set** `--provider` + `--model` (or a slug on `--model`).
215
- 3. **Claude:** use `--output-format stream-json`; rflectr adds `--verbose` if needed.
216
- 4. **Codex:** use `exec --json` — **not** `-p` (in Codex, `-p` means profile).
217
- 5. **Gemini:** use `-o stream-json` or `-o json` with `-p`.
218
- 6. **Parse stdout only** — boot/errors go to stderr in machine-readable mode.
219
- 7. **Codex network:** the default sandbox is already full access; no extra `-s` needed.
220
- 8. **Discovery:** run `rflectr --ai` or read `providers.json` to populate model lists.
221
- 9. **Skill:** `rflectr --ai --install` drops `rflectr-cli/SKILL.md` into agent skill dirs.
222
-
223
- ### Stdout contract
224
-
225
- ```text
226
- stderr → rflectr boot/errors (safe to log; ignore for parsing)
227
- stdout → child NDJSON/JSONL only (when stream-json / exec --json)
228
- exit → rflectr exit code (non-zero on launch/config errors)
229
- ```
230
-
231
- The full alef section is also embedded at the bottom of `rflectr --ai`.
232
-
233
- ---
234
-
235
- ## Agent rules of thumb
236
-
237
- **Do:**
238
-
239
- - Run `rflectr --ai` when unsure.
240
- - Use `--provider` + `--model` for every headless invocation.
241
- - Use Claude `-p` / Codex `exec` for one-shots that must exit.
242
- - Read `providers.json` for authoritative model ids.
243
- - Send machine-readable flags so stdout stays parseable.
244
-
245
- **Don't:**
246
-
247
- - Rely on interactive wizards in CI or agent loops.
248
- - Pass `--provider` / `--model` to Claude/Codex/Gemini directly — rflectr consumes them.
249
- - Use Codex `-p` for print mode (it's `--profile` in Codex).
250
- - Expect the favorites catalog in print/exec mode — use explicit boot flags.
251
- - Edit `~/.claude/settings.json`, `~/.gemini/config/config.json`, or `~/.codex/config.toml` from rflectr — it uses env + temporary overlays.
252
-
253
- ---
254
-
255
- ## Troubleshooting (agents)
256
-
257
- | Symptom | Fix |
258
- |---|---|
259
- | JSON parse error on first stdout lines | Missing `--output-format stream-json` (Claude) or `exec --json` (Codex). |
260
- | `Print mode requires --provider and --model` | Add boot flags, or run interactive once to save prefs. |
261
- | `requires an interactive terminal` (Codex) | Add `--provider` and `--model`. |
262
- | Zen/Go "Not logged in" | Set `OPENCODE_API_KEY`; pass `--provider zen` explicitly. |
263
- | Codex shell network blocked | Should be default; confirm `rflectr codex --config` shows `sandbox = "danger-full-access"`. |
264
- | DeepSeek tool loop 400 | Update rflectr — reasoning round-trip fix in the Codex proxy. |
265
- | Stale overlay after crash | `rflectr codex --restore`. |
266
-
267
- See [Troubleshooting](../faqs/troubleshooting.md) for general rflectr issues.
268
-
269
- ---
270
-
271
- ## Related guides
272
-
273
- - [Codex](codex.md) · [Gemini CLI](gemini-cli.md) · [Providers](providers.md) · [Troubleshooting](../faqs/troubleshooting.md)
@@ -1,108 +0,0 @@
1
- # API Server
2
-
3
- > Category: Guide | Version: 1.0 | Date: June 2026 | Status: Active
4
-
5
- `rflectr server` runs a local gateway that bridges your model backends (OpenCode Zen, Go, registry providers, or Vertex AI) to any client that speaks the Anthropic or OpenAI API. Both formats are served on one port.
6
-
7
- ---
8
-
9
- ## Start the server
10
-
11
- ```bash
12
- rflectr server # registry / Zen / Go providers
13
- rflectr server --vertex # Claude on Google Vertex AI via gcloud ADC
14
- ```
15
-
16
- The server runs an interactive wizard (password setup, which providers to expose, optional favorites-only catalog, discovery-id masking) and then listens. Default port: **17645**.
17
-
18
- ```text
19
- Rflectr server running
20
- Anthropic: http://127.0.0.1:17645/anthropic
21
- OpenAI: http://127.0.0.1:17645/openai/v1
22
- Network (en0):
23
- Anthropic: http://192.168.68.70:17645/anthropic
24
- OpenAI: http://192.168.68.70:17645/openai/v1
25
- API key: saved, rotate with `rflectr server --setup`
26
- Catalog: favorite models only
27
- ```
28
-
29
- ---
30
-
31
- ## Reading the model catalog
32
-
33
- On startup the server prints every exposed model with **two identifiers**:
34
-
35
- ```text
36
- Google Gemini
37
- gemini-3.5-flash
38
- anthropic: anthropic-google__gemini-3.5-flash
39
- openai: gemini-3.5-flash
40
-
41
- OpenCode Go
42
- Kimi K2.7 Code
43
- anthropic: anthropic-go__kimi-k2.7-code
44
- openai: kimi-k2.7-code
45
- ```
46
-
47
- | Identifier | Use it when your client expects… |
48
- |---|---|
49
- | `anthropic:` | Anthropic-format requests (Anthropic SDK, Claude Code, Claude Desktop). |
50
- | `openai:` | OpenAI-format requests (OpenAI SDK, OpenAI-compatible extensions). |
51
-
52
- ---
53
-
54
- ## Endpoints
55
-
56
- | Method + path | Purpose |
57
- |---|---|
58
- | `GET /health` | Liveness check. |
59
- | `GET /anthropic/v1/models` · `GET /openai/v1/models` | List exposed models. |
60
- | `POST /anthropic/v1/messages` | Anthropic Messages relay. |
61
- | `POST /openai/v1/chat/completions` | OpenAI Chat Completions relay. |
62
-
63
- Base URLs for clients:
64
-
65
- - **Anthropic:** `http://127.0.0.1:17645/anthropic`
66
- - **OpenAI:** `http://127.0.0.1:17645/openai/v1`
67
-
68
- > ⚠️ **Do not append `/v1` to the Anthropic base URL** — the Anthropic SDK adds API paths itself.
69
-
70
- ---
71
-
72
- ## Connecting a client
73
-
74
- Most OpenAI-compatible tools just need a base URL and (optionally) the server password as the API key. Example — **[THE AI Counsel](https://github.com/legioncodeinc/the-ai-counsel)**:
75
-
76
- 1. Open **Settings → LLM API Keys → Custom OpenAI-Compatible Endpoint**.
77
- 2. **Display Name:** anything descriptive (e.g. `Rflectr Server`).
78
- 3. **Base URL:**
79
- - Same machine: `http://127.0.0.1:17645/openai/v1`
80
- - Another device on your LAN: `http://<server-ip>:17645/openai/v1` (use an IP printed at startup).
81
- 4. **API Key:** the server password if one is set, otherwise leave empty.
82
- 5. Click **Connect** to fetch the gateway's models.
83
-
84
- ---
85
-
86
- ## Vertex AI mode
87
-
88
- `rflectr server --vertex` exposes Claude on Google Vertex AI using your local `gcloud` Application Default Credentials — no OpenCode key needed.
89
-
90
- | Env var | Purpose |
91
- |---|---|
92
- | `ANTHROPIC_VERTEX_PROJECT_ID` or `GOOGLE_CLOUD_PROJECT` | Your GCP project. |
93
- | `GOOGLE_CLOUD_LOCATION` or `CLOUD_ML_REGION` | Region (default `global`). |
94
-
95
- Optional model catalog override: `~/.rflectr/vertex-models.json` (see `assets/vertex-models.example.json`).
96
-
97
- ---
98
-
99
- ## Auth
100
-
101
- - **Local mode:** any non-empty bearer token / `x-api-key` works.
102
- - **Network mode:** the wizard sets a **server password** — it's the only gate once the port is reachable beyond localhost, so treat it as a secret.
103
-
104
- ---
105
-
106
- ## Related guides
107
-
108
- - [Claude Desktop setup](claude-desktop.md) (uses this gateway) · [Providers](providers.md) · [Troubleshooting](../faqs/troubleshooting.md)