ClosedRouter

ClosedRouter documentation.

Full command reference for @closedrouter/cli, HTTP and MCP API reference for https://api.closedrouter.app, and step-by-step Self-Hosted Vault setup for individuals, workspace members, and teams.

Machine-readable specs: openapi.json · llms.txt · llms-full.txt · mcp.json  |  Markdown mirror: send Accept: text/markdown to /docs.

Quickstart

Install the official CLI from npm, sign in to your organization workspace, connect accounts (either directly, through the local Claude Code bridge, or through your own Self-Hosted Vault), and launch any supported coding harness against your workspace pool.

Install and start
npm install -g @closedrouter/cli
cr login
cr import
cr start claude

Run cr with no arguments to launch the interactive onboarding wizard. It walks through browser sign-in, local credential scanning, and workspace API key setup.

Three ways to add accounts

Method Where credentials live Best for
Self-Hosted Vault Encrypted locally on your laptop, home server, or VPC (/data/vault.db or private Postgres). Never uploaded to ClosedRouter. Individuals, workspace members, and teams who want zero remote secret storage for OpenAI, Anthropic, Gemini, xAI, or custom OpenAI-compatible API keys.
Local Bridge (cr gateway) Stays on your laptop inside your local Claude Code login. Sharing a personal Claude Code subscription while your machine is online without uploading your login.
Direct import (cr import / Dashboard) Encrypted with AES-256-GCM inside ClosedRouter. Fastest setup for Codex, GitHub Copilot, Cursor, Antigravity, or API keys when you want hosted failover 24/7 without running a container.

Self-Hosted Vault setup guide

A ClosedRouter Vault is a lightweight multi-arch container (ghcr.io/arterialist/closedrouter-vault:latest, supporting linux/amd64 and linux/arm64) that keeps all provider API keys and OAuth tokens encrypted locally under your own VAULT_MASTER_KEY. It handles local OAuth auto-refresh, model discovery, and 5-hour/weekly quota probing inside your host, and opens an authenticated outbound WebSocket tunnel to https://api.closedrouter.app with zero inbound ports required.

Default: Tunnel-relayed pooling (api.closedrouter.app)

Recommended for individuals and distributed teams. Point cr start or your SDKs at https://api.closedrouter.app/v1. ClosedRouter pools across every teammate's Vault, local Claude Code bridge, and hosted seat with full quota-aware routing and guardrails, then sends requests down the chosen Vault's outbound WebSocket tunnel. Your credentials never leave your host.

Zero prompt egress: Local-direct mode (--vault / vault:8080)

For laptops or VPCs where prompts cannot leave your network. Run cr start claude --vault (or call http://127.0.0.1:8080/v1/... / http://vault.internal:8080/v1/... with a cr-sk-... key). Vault fetches a metadata-only route plan from ClosedRouter (model, pool, and an opaque local session hash, zero prompt text) so quota-window scoring, sticky prompt-cache affinity, named pools, and guardrails still work centrally while Vault calls providers directly.

Strict credential isolation. Both the Vault runtime and the ClosedRouter backend enforce a hard schema boundary: any metadata sync or telemetry frame containing secret fields (api_key, access_token, refresh_token, credentials, password, vault_master_key) or prompt content (messages, prompt, content) is rejected with HTTP 400.

Supported account types: Vault stores API keys (openai_api, anthropic_api, claude_api, gemini_api, google_api, xai_api, plus custom OpenAI-compatible endpoints) and OAuth subscriptions (codex_oauth, copilot_oauth, cursor_oauth, grok_oauth, antigravity_oauth) with automatic local token refresh and quota probing. Claude Code subscriptions (claude_oauth) continue to run through cr gateway alongside your Vault so Claude OAuth stays bound to your local Claude Code CLI.

Fastest setup (CLI + Docker)

Any member of a ClosedRouter workspace can connect their own API keys and local subscriptions through their own Vault node without needing workspace admin permissions. Requires Docker Desktop, OrbStack, Colima, or Docker Engine.

Two-command Vault onboarding
npm install -g @closedrouter/cli
cr login
cr vault up --import

cr vault up --import mints a node token in your active workspace, writes a 0600 env file at ~/.closedrouter/vault.env (reusing your existing keys on later runs so your encrypted SQLite volume stays readable), starts the hardened container, waits for the outbound tunnel to connect, and imports local provider logins and API keys straight into your local Vault with zero cloud secret upload. Pass --private to keep imported accounts restricted to your own requests.

Verify and launch coding harnesses
# Check tunnel health and synced accounts
cr vault doctor

# Pool across your workspace (tunnel-relayed)
cr start claude

# Local-direct mode (zero prompt egress, routes through your local Vault)
cr start claude --vault
cr verify claude --vault

Manual Docker setup (or headless VPS)

  1. Mint a personal Vault node token. Sign in to dashboard.closedrouter.app/accounts, click Connect account, open the Self-hosted Vault tab, enter a node name (for example my-laptop-vault), and click Mint Vault token. You can also mint a token from Workspace -> Self-hosted Vault nodes or from the CLI:
Mint a member Vault token via CLI
cr login
cr workspace
cr vault create my-laptop-vault

Copy the returned cr-vn-... token once. ClosedRouter stores only its SHA-256 hash.

  1. Start your Vault container. Requires Docker Desktop, OrbStack, Colima, or Docker Engine on macOS, Linux, or Windows. Save VAULT_MASTER_KEY and VAULT_ADMIN_TOKEN locally (for example in a 0600 .env file) so your encrypted SQLite volume stays readable across container restarts.
Save ~/.closedrouter/vault.env and run Vault
mkdir -p ~/.closedrouter && chmod 700 ~/.closedrouter
cat <<EOF > ~/.closedrouter/vault.env
ENVIRONMENT=production
VAULT_MASTER_KEY=$(openssl rand -hex 32)
VAULT_ADMIN_TOKEN=$(openssl rand -hex 24)
VAULT_NODE_TOKEN=cr-vn-REPLACE_WITH_YOUR_TOKEN
CONTROL_PLANE_URL=https://api.closedrouter.app
LOCAL_GATEWAY_URL=http://127.0.0.1:8080
EOF
chmod 600 ~/.closedrouter/vault.env

docker run -d --name closedrouter-vault --restart unless-stopped \
  --read-only --tmpfs /tmp --security-opt no-new-privileges:true \
  -p 127.0.0.1:8080:8080 -v closedrouter_vault_data:/data \
  --env-file ~/.closedrouter/vault.env \
  ghcr.io/arterialist/closedrouter-vault:latest
  1. Load accounts locally. Run cr vault import to scan local OAuth logins and API keys automatically, or add explicit API keys inside the container. Accounts are shared with your workspace pool by default; pass --private to restrict an account to only your own requests.
Import local logins or add explicit API keys
# Option A: import local Codex, Copilot, Cursor, Grok, Antigravity, and env keys
cr vault import

# Option B: add an explicit API key inside the container
source ~/.closedrouter/vault.env
docker exec closedrouter-vault closedrouter-vault add \
  --admin-token "$VAULT_ADMIN_TOKEN" \
  --provider openai_api \
  --name my-openai \
  --api-key "sk-proj-..."
  1. Verify tunnel health and synced accounts.
Check Vault health and active tunnel
cr vault doctor

When control_plane_connected is true and active_accounts is greater than zero, your accounts immediately appear on Accounts under your user identity. To pull your accounts offline immediately, stop the container or revoke the node via cr vault revoke <node-id> or the Dashboard.

Member permissions: Every workspace member can create their own Vault nodes and rotate or revoke the nodes they created. Synced accounts from a member's Vault always belong to that member. Workspace owners and admins can view, rotate, or revoke any Vault node in the workspace.

For teams and organizations (VPC, Docker Compose, Kubernetes)

Engineering teams run one or more shared Vault containers inside their private VPC or cluster. Applications inside the VPC point their OpenAI, Anthropic, or Gemini SDKs straight at http://vault.internal:8080 for sub-millisecond local routing with zero prompt egress, while remote teammates and CI jobs can route through https://api.closedrouter.app over the outbound tunnel.

Option A: Docker Compose in a private VPC

docker-compose.yml
services:
  closedrouter-vault:
    image: ghcr.io/arterialist/closedrouter-vault:latest
    restart: unless-stopped
    read_only: true
    tmpfs: ["/tmp"]
    security_opt: ["no-new-privileges:true"]
    ports:
      - "127.0.0.1:8080:8080"
    volumes:
      - closedrouter_vault_data:/data
    environment:
      ENVIRONMENT: production
      VAULT_MASTER_KEY: ${VAULT_MASTER_KEY}
      VAULT_ADMIN_TOKEN: ${VAULT_ADMIN_TOKEN}
      VAULT_NODE_TOKEN: ${VAULT_NODE_TOKEN}
      CONTROL_PLANE_URL: https://api.closedrouter.app
      LOCAL_GATEWAY_URL: http://vault.internal:8080
volumes:
  closedrouter_vault_data:

Option B: Kubernetes deployment (zero Ingress required)

Kubernetes secret and rollout
kubectl create namespace closedrouter-vault
kubectl -n closedrouter-vault create secret generic closedrouter-vault-secrets \
  --from-literal=VAULT_MASTER_KEY="$(openssl rand -hex 32)" \
  --from-literal=VAULT_ADMIN_TOKEN="$(openssl rand -hex 24)" \
  --from-literal=VAULT_NODE_TOKEN="cr-vn-..."

kubectl -n closedrouter-vault apply -f k8s.yaml

Mount a PersistentVolumeClaim at /data (or pass DATABASE_URL pointing to your private PostgreSQL instance) and configure liveness and readiness probes on GET /healthz and GET /readyz. For admin-owned team Vaults, pass --owner-email alice@company.com when adding an account to attribute usage and ownership to a specific workspace member.

Team operational behaviors

  • Multi-account failover: Add multiple accounts serving the same model inside one Vault. Local-direct requests round-robin across eligible accounts and automatically fail over on HTTP 429 or 5xx upstream errors.
  • Cross-protocol translation: Call /v1/chat/completions backed by Anthropic or Gemini keys, or call /v1/messages backed by OpenAI keys. Tools, tool calls, tool results, streaming SSE, developer role, top_p, stop, and response_format are preserved.
  • Zero-downtime reconnects: During ClosedRouter backend blue-green deployments, active Vault tunnels receive WebSocket close code 1001 and reconnect automatically with jittered backoff.
  • Instant kill switch: Running cr vault revoke <node-id> or clicking Revoke in the Dashboard closes the live tunnel with close code 1008 and disables all synced accounts immediately.

Vault container CLI, local API, providers, and environment

Command (closedrouter-vault) Description
doctorChecks /health and /local/status, reporting tunnel connectivity, node ID, workspace ID, and active account count. Exits non-zero if disconnected.
statusPrints tunnel state, control-plane URL, active accounts, and last tunnel error.
listLists local Vault accounts (metadata only, never secrets).
syncForces an immediate metadata sync with ClosedRouter.
add --provider <type> --name <label> --models <csv> --api-key <key>Encrypts and stores a provider account locally and syncs metadata. Optional flags: --access-token, --base-url, --owner-email, --private.
rotate <ref> --api-key <new-key>Re-encrypts credentials for an existing local account ref without changing its ID or model mappings.
remove <ref>Deletes an account locally and deactivates its synced metadata on ClosedRouter.
Variable Required Purpose
VAULT_MASTER_KEYYes32-byte hex secret used to derive AES-256-GCM encryption keys for local credentials. Never leaves your host.
VAULT_ADMIN_TOKENYes (prod)Protects /local/* account management endpoints via X-Vault-Admin-Token.
VAULT_NODE_TOKENYesWorkspace registration token (cr-vn-...) minted in the Dashboard or via cr vault create.
CONTROL_PLANE_URLYesClosedRouter API origin: https://api.closedrouter.app.
LOCAL_GATEWAY_URLNoInternal URL shown in the Dashboard for teammates inside your VPC (default http://127.0.0.1:8080).
DATABASE_URLNoOptional private PostgreSQL connection URL. Omit to use encrypted SQLite at /data/vault.db.

Supported Vault provider types: openai_api, anthropic_api, claude_api, gemini_api, google_api, xai_api, plus custom OpenAI-compatible endpoints via --base-url.

Local HTTP endpoints exposed on port 8080: GET /v1/models, POST /v1/chat/completions, POST /v1/messages, POST /v1/responses, POST /v1beta/models/{model}:generateContent, POST /v1beta/models/{model}:streamGenerateContent, GET /health, GET /healthz, GET /readyz, and admin routes /local/status, /local/sync, /local/accounts, /local/accounts/{ref}/rotate.

CLI reference (@closedrouter/cli)

Install globally with npm install -g @closedrouter/cli. Both cr and closedrouter invoke the same binary. Global option: -s, --server <url> overrides the ClosedRouter API origin (default https://api.closedrouter.app).

Core commands

Command Key options What it does
cr / cr onboard-a, --all, --shared, --private, -y, --yes, --no-browser, --non-interactive, --jsonInteractive onboarding wizard: browser login, local credential scan, import, and API key setup.
cr login-s, --server <url>, --no-browserSign in via browser PKCE flow (or terminal email/password/token with --no-browser) and select workspace.
cr logoutNoneClear stored local CLI session credentials.
cr whoamiNoneShow active user, workspace, and server URL.
cr scan-p, --provider <csv>, -j, --jsonScan local machine for Antigravity, Cursor, Claude, Codex, and provider API keys without uploading anything.
cr import-a, --all, --shared, --private, --update-existing, -p, --provider <csv>, -j, --jsonImport discovered local accounts into ClosedRouter. Accounts start private unless --shared is passed.
cr status-s, --server <url>, --jsonShow workspace pool health and connected account status.
cr keys [list|create] [name]NoneList platform API keys or mint a new cr-sk-... key from the terminal.
cr verify [tool]-m, --model <id>, --all-models, --provider <type>, --all-providers, --concurrency <1-4>, --output <path>Test streamed tool calls and tool-result continuation end to end across gateway models and protocols.
cr usage [action]stats, status, sync, enable, disable; --since <24h|3d>, --by <model|key|seat>, --session [id], --jsonInspect request volume, prompt cache reuse, error rates, or sync direct Claude Code usage.
cr settings--model-grouping <model-provider|account-provider|none>Configure how models are grouped in the interactive model picker.
cr updateNoneDownload and install the newest @closedrouter/cli release immediately.

Launching coding tools (cr start / cr launch)

cr start [tool] [tool-args...] configures environment variables and model selection for a coding CLI or desktop app and launches it against your active ClosedRouter workspace. Forward tool-specific flags after --.

Examples of cr start
cr start claude
cr start codex --model gpt-5.3-codex
cr start cursor --desktop
cr start aider -- --architect
Option / Target Details
Supported toolsclaude, codex, cursor, gemini, aider, opencode, pi, t3code (alias t3), deepseek (alias dsh), antigravity, grok, grok-bot (alias grok-build).
-m, --model <model>Skip the interactive model picker and launch directly with a specific gateway model ID.
--pool <id>Pin this launch to a specific named account pool ID or name.
--desktopLaunch the desktop app for codex, claude, cursor, or antigravity.
-k, --key <key>Use a specific cr-sk-... key instead of the saved CLI key.
--path <path>Override the path to the installed CLI binary or macOS .app bundle.
--no-verify-modelSkip the startup protocol preflight check on previously verified gateways.

Workspace, pools, and Vault management

Command Description
cr workspace [id]Switch the active organization workspace, or list workspaces interactively when omitted.
cr pool [id]Pin a default named pool for future launches (pass default to reset to the full workspace pool).
cr pool status [--pool <id>] [--json]Display active seats, current 5-hour and weekly quota consumption, and cooldowns.
cr pool forecast [--pool <id>] [--json]Forecast remaining weekly capacity and reset times across seats.
cr vault up [name] [--import] [--private] [--port 8080] [--pull]One-command local Vault bringup: mints a node token, saves 0600 ~/.closedrouter/vault.env, starts the Docker container, waits for tunnel readiness, and optionally imports local logins/keys.
cr vault import [--private] [--scanner <names>] [--dry-run]Scan local provider logins and API keys and load them directly into your local Vault with live model and quota probing (zero cloud secret upload).
cr vault doctor (alias status)Check local Vault health, outbound tunnel connection, and every synced account's models and quota windows.
cr vault down / cr vault logs [-f]Stop the local Vault container (preserving encrypted data and vault.env) or view container logs.
cr vault list (alias ls)List registered Self-Hosted Vault nodes in the active workspace with online status and synced account counts.
cr vault create <name> [--local-url <url>]Mint a one-time cr-vn-... token and print ready-to-use container environment variables. Available to all workspace members.
cr vault rotate <node-id>Rotate a Vault node's token and disconnect its existing tunnel.
cr vault revoke <node-id>Revoke a Vault node, terminate its active tunnel immediately, and disable all synced accounts.

Local Claude Code bridge (cr gateway)

Aliases: cr daemon, cr bridge. Keeps your Claude Code subscription login on your own machine while serving workspace requests over an authenticated outbound bridge.

Command Description
cr gatewayRun the Claude Code bridge in the foreground. Options: -k, --key, --key-stdin, -n, --name, --claude-path.
cr gateway installInstall and start the bridge as a persistent background service (macOS launchd or Linux systemd).
cr gateway status [--json]Check whether the background bridge service is installed, running, and connected.
cr gateway logs [-n 50] [-f]Show or follow recent background bridge logs.
cr gateway uninstallStop and remove the background bridge service.

Compute, VMs, Agent Board, and Computers

Command group Subcommands
cr vmlist, sizes, create, show <vm>, exec <vm> <cmd...>, shell <vm> (alias sh), extend <vm> <min>, rename <vm> <name>, stop <vm>, events <vm>, plan, traces [vm], usage, host, discover, import, onboard, sources (limit, refresh, remove), limits (show, set, clear), policy.
cr boardthreads (alias list), new <name>, show <thread>, edit <thread>, attach <thread> [uri], join <thread>, leave <thread>, post <thread> <text>, read <thread>, wait, asks, claim <thread> <key>, release <thread> <key>, agents, approve, reject, archive, reopen.
cr agentlogin, list, whoami, rename <name>, logout [name], mcp (prints ready-to-paste MCP client config).
cr sharecr share (share Mac or Linux desktop), cr share status, cr share stop, cr share grok. Options: --view-only, --virtual-desktop <name>, --resolution <WxH>, --vnc <host:port>.
cr desktopManage isolated Linux virtual desktops and run GUI apps on a named desktop.
cr skill & cr agent-statuscr skill [install|uninstall|show] installs the Claude Code skill and pool status hooks; cr agent-status outputs one-line pool and session telemetry.

API reference

Use https://api.closedrouter.app directly for lowest latency, Server-Sent Events streaming, WebSockets, and MCP. Standard HTTP inference routes are also proxied on https://closedrouter.app.

Base URLs and request headers

Protocol Base URL Auth header
OpenAI Chat & Responseshttps://api.closedrouter.app/v1Authorization: Bearer cr-sk-...
Anthropic Messageshttps://api.closedrouter.appx-api-key: cr-sk-... or Authorization: Bearer cr-sk-...
Gemini RESThttps://api.closedrouter.app/v1betax-goog-api-key: cr-sk-...
Streamable HTTP MCPhttps://api.closedrouter.app/mcpOAuth 2.1 PKCE token or Authorization: Bearer cr-sk-...
Local Self-Hosted Vaulthttp://127.0.0.1:8080 (or VPC URL)Same cr-sk-... headers on /v1/* and /v1beta/*

Optional routing header: Send X-ClosedRouter-Pool-Id: <pool-uuid> on any inference request to restrict routing to a named workspace pool.

Inference and discovery endpoints

Method & path Scope Description
GET /healthPublicReturns JSON health status, version, environment, and database readiness.
GET /v1/modelsmodelsOpenAI-compatible list of models routable by the key across active shared, private, and online Vault accounts.
GET /v1beta/modelsmodelsGemini-compatible model catalog for the authenticated key.
POST /v1/chat/completionschat / gatewayOpenAI Chat Completions with SSE streaming, tool calling, vision inputs, and automatic failover across subscriptions, Vaults, and API keys.
POST /v1/responses & WS /v1/responsesresponses / gatewayOpenAI Responses API over HTTP SSE or WebSocket (used by Codex CLI, Codex Desktop, and Grok Build). Pass store: false to disable temporary background run storage.
POST /v1/messagesmessages / gatewayAnthropic Messages API with typed SSE streaming, prompt caching preservation, and tool use (used by Claude Code and Anthropic SDKs).
POST /v1beta/models/{model}:generateContentgemini / gatewayNon-streaming Gemini REST generation.
POST /v1beta/models/{model}:streamGenerateContent?alt=ssegemini / gatewayStreaming Gemini REST generation over SSE.
OpenAI Chat Completions (curl)
curl https://api.closedrouter.app/v1/chat/completions \
  -H "Authorization: Bearer cr-sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "messages": [{"role": "user", "content": "Summarize git diff --stat"}],
    "stream": true
  }'
Anthropic Messages (Python SDK)
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.closedrouter.app",
    api_key="cr-sk-your-key",
)

msg = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Review this PR."}],
)
print(msg.content[0].text)
Gemini REST streaming (curl)
curl "https://api.closedrouter.app/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse" \
  -H "x-goog-api-key: cr-sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"role":"user","parts":[{"text":"Explain Raft consensus."}]}]}'

Vault control-plane API

User-authenticated Vault node endpoints require a workspace session token or a manage-scoped key. Pass X-ClosedRouter-Workspace-Id: <workspace-uuid> when targeting a specific workspace.

Endpoint Auth & permissions Purpose
POST /api/v1/vault-nodesAny workspace memberMint a new Vault node and one-time cr-vn-... token. Body: {"name": "my-vault", "local_gateway_url": "http://127.0.0.1:8080"}.
GET /api/v1/vault-nodesAny workspace memberList active Vault nodes with online status, synced account counts, and per-node can_manage flag.
GET /api/v1/vault-nodes/{id}Any workspace memberInspect one Vault node and its synced metadata-only accounts.
POST /api/v1/vault-nodes/{id}/rotate-tokenNode creator, admin, or ownerIssue a fresh cr-vn-... token and disconnect any live tunnel using the old token.
DELETE /api/v1/vault-nodes/{id}Node creator, admin, or ownerRevoke the Vault node, close its tunnel with WebSocket 1008, and deactivate synced accounts.
WSS /api/v1/vault-nodes/tunnelcr-vn-... tokenOutbound persistent WebSocket tunnel used by the Vault container for heartbeats, sync, and relayed inference.
POST /api/v1/vault-nodes/synccr-vn-... tokenHTTP metadata-only sync endpoint (rejects secret fields with HTTP 400).
POST /api/v1/vault-nodes/validate-keycr-vn-... tokenValidates a workspace cr-sk-... key and returns allowed models and limits (cached 30s locally).
POST /api/v1/vault-nodes/routecr-vn-... tokenReturns a centralized quota-aware candidate order, sticky cache pin, and guardrail decision for Local-Direct traffic (metadata only, rejects prompts).
POST /api/v1/vault-nodes/feedbackcr-vn-... tokenReports upstream 429/5xx cooldowns or 200 recovery from Local-Direct calls into ClosedRouter's central cooldown tracker.
POST /api/v1/vault-nodes/telemetrycr-vn-... tokenIngests sanitized numeric token and latency counters from local-direct traffic (rejects prompt content with HTTP 400).

MCP, OAuth 2.1, Device Flow, and Autonomous Agent Signup

Connect Claude Code, Cursor, or any MCP-compatible agent directly to ClosedRouter over Streamable HTTP MCP at https://api.closedrouter.app/mcp.

Add ClosedRouter MCP to Claude Code
claude mcp add --transport http closedrouter https://api.closedrouter.app/mcp
Flow Endpoint When to use
OAuth 2.1 + PKCE/.well-known/oauth-authorization-server & /.well-known/oauth-protected-resourceInteractive MCP clients with browser approval.
RFC 8628 Device FlowPOST https://api.closedrouter.app/oauth/device_authorizationHeadless terminals or remote servers; a person approves the code at https://dashboard.closedrouter.app/agent-connect.
Autonomous Agent SignupPOST https://api.closedrouter.app/api/v1/agent/signupZero-human bootstrap. Send {"name":"my-agent"} to receive an isolated workspace, an immediate cr-sk-... key, and a one-time claim_url.
Invite Link JoinPOST https://api.closedrouter.app/api/v1/agent/joinJoin an existing workspace with {"invite":"<link>","name":"my-agent"}.

Scopes, errors, rate limits, and versioning

Scope Access granted
gatewayModel inference across OpenAI, Anthropic, and Gemini endpoints.
modelsList routable workspace models via GET /v1/models and GET /v1beta/models.
chat / responses / messages / gemini / imagesIndividual endpoint-family scopes when restricting a key to one protocol.
vmsCreate, inspect, exec commands on, transfer files to, and stop workspace Linux VMs.
boardRead, post, claim tasks, and wait for events on Agent Board threads.
manageProgrammatic workspace key, account, pool, Vault node, and usage management (must be granted explicitly).
  • Structured JSON errors: Every error returns JSON with error.code, error.type, and error.message (never HTML).
  • Rate-limit headers: Responses advertise RateLimit-Policy. Quota-exhausted or capped calls return HTTP 429 with Retry-After (seconds until earliest reset) and X-ClosedRouter-Cap (for example quota-5h, quota-weekly, or daily-tokens).
  • Versioning and sunset: Inference routes are path-versioned (/v1, /v1beta) and emit X-API-Version. Deprecated routes emit RFC 8594 Deprecation and Sunset headers with at least 90 days notice.

Ready to connect your workspace or launch a Vault?

Sign in to mint an API key or a Vault node token, or reach out to support@closedrouter.app if you hit a snag.