spawndocs

Connect your agents

Wire Claude Code, Codex, and Codex Desktop to the spawn gateway with one command. The change is fully reversible.

Connecting an agent to spawn means pointing it at the local gateway instead of its provider's default endpoint. spawn enable does this for you, and the change is fully reversible. Run spawn disable to revert it.

Run spawn start to bring the gateway up before using your agent. It listens on localhost:8787 by default. See the CLI for the full lifecycle.

Wire everything at once

The fastest path wires every supported agent in one step, riding your Pro/Max and ChatGPT logins by default:

Terminal
spawn enable            # wires claude-code + codex (CLI and Desktop), subscription auth
spawn enable --api-keys # same, but uses your own provider API keys instead
spawn start             # run the gateway, then use your agents as usual

To wire a single agent, name it. Add --api-keys to either to use API keys instead of the default subscription login:

Terminal
spawn enable claude-code     # wire Claude Code only
spawn enable codex           # wire Codex (CLI and Desktop) only

Either auth mode is first-class. See the gateway for the difference.

Claude Code

Wire it with:

Terminal
spawn enable claude-code            # ride your Claude Pro/Max login (default)
spawn enable claude-code --api-keys # use your ANTHROPIC_API_KEY instead

Claude Code reads its endpoint from the ANTHROPIC_BASE_URL environment variable. spawn enable claude-code sets it in env inside ~/.claude/settings.json, which Claude Code loads on every start, so the wiring works from any terminal (PowerShell, cmd, bash, zsh, fish, GUI launchers), on any OS:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:8787"
  }
}

spawn never touches ANTHROPIC_API_KEY or your login itself. By default your Claude Pro/Max session is forwarded, so no API key is needed. With --api-keys, your own key keeps flowing straight through the gateway to Anthropic.

Restart claude after enable (or disable) so it picks up the change; it only reads settings.json at startup.

Codex

Wire it with:

Terminal
spawn enable codex            # ride your ChatGPT login (default)
spawn enable codex --api-keys # use your OPENAI_API_KEY instead

Codex reads a custom model provider from ~/.codex/config.toml. spawn enable codex adds a spawn provider pointed at the gateway and makes it active, backing up your previous setting so disable can restore it:

~/.codex/config.toml (subscription, the default)
model_provider = "spawn"

[model_providers.spawn]
name = "spawn"
base_url = "http://localhost:8787/v1"
wire_api = "responses"
requires_openai_auth = true
~/.codex/config.toml (--api-keys)
model_provider = "spawn"

[model_providers.spawn]
name = "spawn"
base_url = "http://localhost:8787/v1"
wire_api = "responses"
env_key = "OPENAI_API_KEY"

requires_openai_auth = true tells Codex to attach its own ChatGPT login token, so no key is needed; env_key instead tells Codex to send the named environment variable as the key. By default your ChatGPT session is forwarded to the Codex backend. With --api-keys, your own OPENAI_API_KEY flows through the gateway to OpenAI untouched.

Codex Desktop

Codex Desktop reads the same ~/.codex/config.toml as the CLI, so wiring Codex covers the desktop app too, with nothing extra to do. After spawn enable codex, restart Codex Desktop so it picks up the active spawn provider.

Reverting

Every wiring is reversible. To undo it:

Terminal
spawn disable             # revert all agents
spawn disable claude-code # or revert just one

This removes ANTHROPIC_BASE_URL from ~/.claude/settings.json and restores your previous Codex model_provider.

Both auth modes are first-class: by default spawn rides an existing Pro/Max or ChatGPT subscription, or pass --api-keys to use your own API keys. See the gateway for how each works, and Configuration for the auth.mode field in ~/.spawn/config.json.

On this page