Client setup
Point Claude Code, Codex, Cursor and other tools at the AgentSlot gateway.
Every example uses asl_your_access_point_token as a placeholder. Copy the real configuration from the access point page in the dashboard, which fills in your token.
Claude Code
Claude Code uses the Anthropic Messages protocol. Set the gateway address and your access token in your shell, or add them to ~/.claude/settings.json to keep them across sessions:
export ANTHROPIC_BASE_URL="https://api.agentslot.dev"
export ANTHROPIC_AUTH_TOKEN="asl_your_access_point_token"Model names are the ones listed for your instances. If an Anthropic model is served through a different provider, the gateway maps the name to that provider's identifier.
Codex
Codex uses the OpenAI Responses protocol. Add a provider to ~/.codex/config.toml:
model = "your-model-id"
model_provider = "agentslot"
[model_providers.agentslot]
name = "AgentSlot"
base_url = "https://api.agentslot.dev/v1"
env_key = "AGENTSLOT_API_KEY"
wire_api = "responses"Then export the token:
export AGENTSLOT_API_KEY="asl_your_access_point_token"Tools that use Chat Completions
Cursor, Cline, Roo Code, Cherry Studio, OpenCode and most other editors accept an OpenAI-compatible provider. Use these values:
| Setting | Value |
|---|---|
| Base URL | https://api.agentslot.dev/v1 |
| API key | Your access point token |
| Model | A model ID from your instances, as returned by /v1/models |
Where each tool keeps the setting:
Open Settings, then Models. Enter the key under OpenAI API Key and turn on Override OpenAI Base URL.
Magpie
Magpie manages the models of several coding agents from one place on your computer. Add AgentSlot to it as a remote Magpie:
magpie provider add remote-magpie asl_your_access_point_token url=https://api.agentslot.dev id=agentslotKeep https:// in the address: Magpie uses plain HTTP for an address without a scheme.
List the models it added. Models of the access point's default route group appear as agentslot/<model> and go to an instance chosen by the route group's order and strategy; each instance's own models appear as agentslot/<instance alias>/up/<model> and go to that instance only. The access point's model rules apply to both names:
magpie modelsThen give an agent one of them, for example Claude Code:
magpie claude agentslot/your-model-idThe list tells Magpie which protocols each model is served in natively, so Magpie sends requests in one of them and a request is converted at most once.
Test the connection
This command checks the token, the routing and one instance in a single request:
curl -sS https://api.agentslot.dev/v1/chat/completions \
-H "Authorization: Bearer $AGENTSLOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "your-model-id", "messages": [{"role": "user", "content": "ping"}], "max_tokens": 8}'If it fails, the response names the error type; see Errors.
Choosing models per access point
By default an access point can use every model its route group serves. To keep a CI pipeline on a single model, or hide expensive models from a shared machine, add model rules on the access point. Rules accept wildcards, for example claude-*.