The whole setup, four steps
1. Deploy the gateway
Pick one of Railway, Docker, or native. The gateway image bundles CLIProxyAPI, so nothing extra to install. On first boot it prints a public URL and agwk_... security key.
2. Register the gateway in CORE
In the CORE webapp: Sidebar → Gateways → + New gateway. Paste the URL and security key.3. Install the CLI and log in to your workspace
4. Log in to each subscription
One command per subscription. The CLI drives the OAuth flow end-to-end and lands tokens directly on the gateway.- Claude / Codex / Antigravity — CLI prints an OAuth URL. Open it, approve, and the CLI’s local server catches the redirect and forwards it to the gateway. Nothing to type back.
- xAI — CLI prints a URL and a short code. Open the URL, type the code on the page, done.
--gateway <name-or-id> if you have multiple gateways registered.
Wire the proxy into CORE
In the CORE webapp, open Workspace Settings → Models → API Keys, click + Add API key, choose OpenAI, and fill in:- Base URL —
https://<your-gateway-host>/llmproxy/v1 - API key — the same
COREBRAIN_GATEWAY_SECURITY_KEYvalue from step 1
openai/ prefix. Examples:
Get the exact list of available models by hitting the proxy’s model endpoint:
When a token expires
Just re-run the same command:Structured outputs & tool calling
Under the hood, CORE routes structured-extraction calls (memory ingestion, label classification, etc.) via OpenAI-compatible tool calling. Claude’s grammar-constrained sampling makes this reliable even for empty content — the model will call the tool with empty arrays rather than respond with prose refusals like “there’s nothing to extract.”Alternatives
The steps above use the built-in CLIProxyAPI inside the gateway. Other options exposing an OpenAI-compatible/v1/chat/completions surface work with the same BYOK wire-up:
- Vercel AI Gateway — first-party pass-through for Claude Max via
ANTHROPIC_BASE_URL. No self-hosting. - ai-cli-proxy-api — variant that supports Factory and Amp CLIs alongside ChatGPT Plus/Pro and Claude Pro/Max.
