Connect an OpenAI-compat agent to the gateway

Paste Base URL + virtual key into any OpenAI-compatible BYO agent. Not for Cursor/Claude/Codex plan logins.

Prompt#

Point my OpenAI-compatible agent (OpenClaude, Command Code, Cursor BYOK, …) at Orchemax so it uses my OpenRouter / Groq API keys with rotation. (I am not on a Cursor / Claude / Codex plan for this seat.)

What the Chair does#

Nothing — this one is yours. There is no MCP tool for it: you paste env into the agent's own settings once from a human terminal.

CLI#

orch gateway                            # start the gateway first
orch gateway connect                    # or: connect openai / openclaude / …
orch gateway status

connect prints the OpenAI-compat block (aliases like openclaude do the same). Orchemax does not write per-CLI settings files for hundreds of agents — only connect opencode --allow-user-scope optionally writes OpenCode's JSON layout.

Paste into the agent:

  • Base URL → http://127.0.0.1:8788/v1
  • Models → GET http://127.0.0.1:8788/v1/models (pick a live orchemax/… id)
  • API key → prefer not pasting into OpenClaude settings.json when you launch with orch openclaude — Orchemax injects a session orch_wk_… key. A pasted orch_gk_… in settings overwrites that env and Free (concurrent=1) denies the seat's own chat as a fake "quota exhausted". For bare openclaude (without orch), paste the printed orch_gk_… into the profile/provider UI instead.

Expected response#

Exports for OPENAI_BASE_URL / OPENAI_API_KEY (and comments for GUI agents). Restart the agent (or open a new session) after pasting.

Gotchas#

  • Account seats stay on plan login. Cursor subscription, Claude Code plan, and Codex keep their vendor login — do not run gateway connect for those.
  • Two protocols only. OpenAI-compat (connect / openai) vs Anthropic Messages (connect anthropic). Unknown agent names default to OpenAI-compat.
  • Keys stay in machine-home keys.env. Only the virtual orch_gk_… is pasted into the agent.
  • OpenClaude: do not pin OPENAI_MODEL in settings.env. That value Object.assign's over the UI picker (e.g. always snaps back to orchemax/pareto). Put the choice in the top-level model field only; keep OPENAI_BASE_URL in env. See Common seat tune-ups.
  • OpenClaude skills live under .openclaude/skills/, not .claude/. orch openclaude seeds orch-chair / orch-worker there on launch. Optional user copy: orch chair install --target openclaude --scope user --allow-user-scope.