Choose an agent
Run these clients in your project directory with tokspur serving on the same Mac. Aider and OpenCode use Chat Completions directly. Claude Code needs the local gateway for Messages, and Codex needs it for Responses.
The model doing the work is tokspur’s local model. Using a Claude Code or Codex client does not run Anthropic or OpenAI model weights locally.
OpenCode
Add this provider to your opencode.json. Export TOKSPUR_API_KEY with the key setup, then start opencode --model tokspur/tokspur. Merge the entry into any existing configuration.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"tokspur": {
"npm": "@ai-sdk/openai-compatible",
"name": "tokspur",
"options": {
"baseURL": "http://127.0.0.1:18081/v1",
"apiKey": "{env:TOKSPUR_API_KEY}"
},
"models": {
"tokspur": {
"name": "tokspur",
"limit": { "context": 65536, "output": 8192 }
}
}
}
}
}Claude Code
Start the local gateway first. In the shell where its key is available, launch Claude Code with these settings for this session:
ANTHROPIC_BASE_URL=http://127.0.0.1:18082 \
ANTHROPIC_AUTH_TOKEN="$TOKSPUR_GATEWAY_KEY" \
ANTHROPIC_MODEL=tokspur \
ANTHROPIC_DEFAULT_HAIKU_MODEL=tokspur \
ANTHROPIC_DEFAULT_SONNET_MODEL=tokspur \
ANTHROPIC_DEFAULT_OPUS_MODEL=tokspur \
ANTHROPIC_DEFAULT_FABLE_MODEL=tokspur \
CLAUDE_CODE_SUBAGENT_MODEL=tokspur \
claude --model tokspurKeep tasks text-only, use a fresh session and check its model with /status. The gateway translates the request format. It does not provide Claude-specific capabilities or make the client’s other network features local. Keep agent permissions in place.
Codex CLI
Start the gateway, then save this as ~/.codex/tokspur.config.toml. This named profile is for Codex CLI 0.134.0 or later and keeps the usual provider configuration separate.
model = "tokspur"
model_provider = "tokspur-local"
model_context_window = 65536
model_auto_compact_token_limit = 49152
web_search = "disabled"
[model_providers.tokspur-local]
name = "tokspur local gateway"
base_url = "http://127.0.0.1:18082/v1"
env_key = "TOKSPUR_GATEWAY_KEY"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
request_max_retries = 0
stream_max_retries = 0
[features]
apps = false
plugins = false
multi_agent = false
memories = false
goals = falsecodex --profile tokspurUse a fresh local session. Retain your existing approval and sandbox settings. The profile disables connected apps, plugins, subagents, memory and background goals for this local route, keeping its function tools within the API’s bounded schema and context limits. The Responses bridge covers ordinary text and function calls. Hosted tools and other Responses features need their own support. Run the connection checks before a longer task.
Try a task
Start in a small test repository. Ask the agent to read a file, make a small edit and run its tests. Confirm that tool results return to the conversation and that cancelling releases the active request. Run agents in turn because the engine serialises generation.
For an editor panel, configure the client or extension that owns the request. A terminal profile does not automatically configure the editor’s built-in assistant. Return to connection checks for errors and streaming.