Agents and Gateways
ClawIDE runs any coding-agent CLI in a terminal pane, and can point each agent at a model gateway such as OpenRouter, a self-hosted LiteLLM or a local Ollama. Both features are free.

Agent CLIs
ClawIDE runs any agent CLI on your system, with no limit on how many. It ships one-click presets for 17 of them, plus a plain shell or any custom command. For each one it checks whether the binary is on your PATH, shows an Installed badge, and gives you a copyable install command for the rest.
| Agent | Binary | Gateway support | Install |
|---|---|---|---|
| Claude Code | claude | Anthropic-compatible | curl -fsSL https://claude.ai/install.sh | bash |
| Codex | codex | OpenAI-compatible Through a gateway, only OpenAI-family models are reliable. | npm i -g @openai/codex |
| Gemini CLI | gemini | None Can't use OpenAI- or Anthropic-style gateways. | npm i -g @google/gemini-cli |
| OpenCode | opencode | OpenAI-compatible | curl -fsSL https://opencode.ai/install | bash |
| Aider | aider | OpenAI-compatible | python -m pip install aider-install && aider-install |
| Goose | goose | OpenAI-compatible Install with the method in the Goose docs. | See the vendor's docs |
| Crush | crush | None Configured through its own config file, not env vars. | brew install charmbracelet/tap/crush |
| Qwen Code | qwen | OpenAI-compatible | npm i -g @qwen-code/qwen-code@latest |
| Amp | amp | None Has no bring-your-own base URL. | npm i -g @ampcode/cli |
| Cline | cline | None No env-based gateway configuration. | npm i -g cline |
| Kilo | kilo | None No env-based gateway configuration. | npm i -g @kilocode/cli |
| Cursor CLI | agent | None Has no bring-your-own base URL. | curl https://cursor.com/install -fsS | bash |
| Copilot CLI | copilot | OpenAI-compatible | npm i -g @github/copilot |
| Droid | droid | None No env-based gateway configuration. | curl -fsSL https://app.factory.ai/cli | sh |
| Kiro | kiro-cli | None Install with the method in the Kiro docs. | See the vendor's docs |
| OpenHands | openhands | OpenAI-compatible | uv tool install openhands --python 3.12 |
| Continue | cn | None No env-based gateway configuration. | npm i -g @continuedev/cli |
Choose an agent per pane from the pane’s provider selector. The default agent for new panes is set in Settings or in the setup wizard. Each CLI keeps its own login and configuration; ClawIDE doesn’t change your dotfiles.
Model gateways
A gateway sits between an agent and the model provider. Most gateways expose an Anthropic-compatible API, an OpenAI-compatible API, or both, so pointing an agent at one is a matter of setting the right environment variables for that pane.
| Gateway | Anthropic-compatible base URL | OpenAI-compatible base URL | Notes |
|---|---|---|---|
| OpenRouter | https://openrouter.ai/api | https://openrouter.ai/api/v1 | |
| Requesty | https://router.requesty.ai | https://router.requesty.ai/v1 | |
| LiteLLM | <your base URL> | <your base URL>/v1 | Self-hosted; base URL required. |
| Portkey | https://api.portkey.ai | https://api.portkey.ai/v1 | Anthropic mode needs extra headers (advanced). |
| Vercel AI Gateway | https://ai-gateway.vercel.sh | https://ai-gateway.vercel.sh/v1 | |
| Cloudflare AI Gateway | — | — | Base URL built from your account and gateway IDs. |
| DeepInfra | https://api.deepinfra.com/anthropic | https://api.deepinfra.com/v1/openai | |
| Fireworks | https://api.fireworks.ai/inference | https://api.fireworks.ai/inference/v1 | |
| Martian | — | https://api.withmartian.com/v1 | |
| Together AI | — | https://api.together.xyz/v1 | |
| Groq | — | https://api.groq.com/openai/v1 | |
| Ollama | http://localhost:11434 | http://localhost:11434/v1 | Runs locally. |
| LM Studio | http://localhost:1234 | http://localhost:1234/v1 | Runs locally. |
| Custom Anthropic-compatible | <your base URL> | — | |
| Custom OpenAI-compatible | — | <your base URL> |
Connect a gateway
- Open Settings β Gateways.
- On the gateway’s card, paste your API key. After you save, the key is only ever shown masked, for example
sk-oβ¦cdef. - For LiteLLM, Cloudflare and the custom endpoints, enter the base URL. You can also override the base URL of any other gateway.
- Click Test. ClawIDE requests the gateway’s model list with your key, with a 5-second timeout, and shows the result.
- In the agent list, pick a gateway for each agent that should use one. The dropdown only lists gateways that agent can talk to.
New panes for that agent pick up the gateway. Panes that were already running keep the environment they started with, so start a new session to switch.
What a pane receives
ClawIDE sets the variables on the pane’s tmux session (tmux new-session -e KEY=VALUE). They never appear in the command line, in ps output, in scrollback or in logs.
For Claude Code with an Anthropic-compatible gateway, for example OpenRouter:
ANTHROPIC_BASE_URL=https://openrouter.ai/api
ANTHROPIC_AUTH_TOKEN=<your key>
ANTHROPIC_API_KEY=
Agents that use the OpenAI-compatible API get their own variables:
| Agent | Variables |
|---|---|
| Aider | OPENAI_API_BASE, OPENAI_API_KEY |
| Goose | OPENAI_HOST, OPENAI_API_KEY, or GOOSE_PROVIDER=openrouter with OPENROUTER_API_KEY |
| Qwen Code | OPENAI_BASE_URL, OPENAI_API_KEY |
| Copilot CLI | COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_API_KEY |
| OpenHands | LLM_BASE_URL, LLM_API_KEY (OpenHands needs --override-with-envs) |
For OpenCode and Codex, Settings β Gateways shows the exact variables ClawIDE sets.
Limits
Gateway support depends on what each CLI allows:
- Codex through a gateway is only reliable with OpenAI-family models.
- Gemini CLI can’t use OpenAI- or Anthropic-style gateways.
- Amp and Cursor CLI have no bring-your-own base URL.
- Crush, Cline, Kilo, Droid and Continue aren’t configurable through environment variables.
- Portkey needs extra headers in Anthropic mode, so it’s marked advanced.
When an agent can’t use a gateway, the settings card explains why instead of applying a configuration that won’t work.
Where keys are stored
Keys live in ~/.clawide/secrets.json, created with mode 0600 and written atomically. Each key is stored under a namespaced name such as gateway:openrouter. Assignments and base URLs are saved in config.json as agent_gateways and gateway_settings; keys are never written there.
0600 file is readable only by your user account, but it isn’t encrypted. It protects keys from other users on the machine and from accidentally sharing config.json. It doesn’t protect against root or malware running as you.API
All endpoints are free. No response ever includes a raw key.
| Endpoint | Method | Description |
|---|---|---|
/api/agent-clis | GET | Agent catalog with installed, install, docs_url, gateway_wire and default for each agent |
/api/gateways | GET | Gateways with base URLs, configured and key_masked, plus current assignments |
/api/gateways/{id} | PUT | Save api_key and/or base_url. Returns 400 for an unknown gateway, a non-http(s) URL or a missing required base URL |
/api/gateways/{id} | DELETE | Remove the key and settings, and clear assignments that use the gateway. Returns 204 |
/api/gateways/assignments | PUT | Set {"<agent>": "<gateway>"}; an empty string clears it. Returns 400 for unknown ids or an incompatible agent |
/api/gateways/{id}/test | POST | Check the key against the gateway. Returns {"ok": bool, "message": string} |