Skip to main content
If you already pay for Claude Max, a ChatGPT plan that includes Codex, Google Antigravity, or xAI Grok, you can point CORE at your subscription instead of buying separate API credits. The CoreBrain Gateway ships a subscription proxy that exposes an OpenAI-compatible API and translates to each provider under the hood.
Subscription plans are licensed for interactive use. Providers can rate-limit or revoke tokens if they detect headless usage. Fine for personal self-host; risky if you’re serving other users. When in doubt, use real API keys.

Four steps

1. Deploy the gateway

The LLM proxy ships with the container image, so pick one of the container deployments: Both paths end with a Base URL and a gwk_... security key. Keep both handy — you’ll paste them into the UI in step 2 and reuse the same security key as the BYOK API key in step 4.

2. Add the gateway in the UI

In the CORE webapp: Sidebar → Gateways → + New gateway. Pick the deployment kind you used in step 1 (Docker or Railway), then paste the URL and security key.

3. Log in to your subscription

Pick the gateway you just added when prompted. Follow the printed OAuth URL — for Claude / Codex / Antigravity the browser redirect is caught automatically; for xAI you’ll type a short device code shown in the terminal. Repeat with --login codex, --login antigravity, or --login xai for other providers.

4. Wire it into CORE

In the webapp: Settings → Models → + New API key. Choose OpenAI and fill in:
  • Base URLhttps://<your-gateway-host>/llmproxy/v1
  • API key — the same security key from step 1
Then pick a model with the 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 login command:
The proxy auto-rotates access tokens as long as the refresh token stays valid; when it doesn’t, re-login. Tokens live on the gateway’s persistent volume, so container restarts never blow them away.

Under the hood

The gateway embeds CLIProxyAPI, which handles the OAuth flow for each subscription and re-shapes the requests into each provider’s native protocol behind a single OpenAI-compatible surface at /llmproxy/v1. That’s why one Base URL + one API key covers Claude, Codex, Antigravity, and xAI. Other proxies exposing the same OpenAI-compatible shape work with the same wire-up if you’d rather run them yourself:
  • 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.