---
name: agentslot
description: Understand, configure, operate, and troubleshoot AgentSlot — isolated BYOK cloud hosting for AI API keys with fixed static outbound IPs, free local bridges, and one unified multi-protocol inference gateway (Anthropic Messages, OpenAI Responses, Chat Completions). Use when a user wants to learn about AgentSlot, install or run the agentslot CLI, connect Claude Code / Codex / Cursor / OpenCode / Cline / Magpie / Python / TypeScript SDKs to AgentSlot, host or manage API key instances, configure route groups or access points, bridge local model servers (Ollama / vLLM / LM Studio) via agentslot-bridge, or diagnose AgentSlot gateway errors.
license: MIT
metadata:
  homepage: https://agentslot.ai
  console: https://app.agentslot.ai
  gateway: https://api.agentslot.dev
  docs: https://agentslot.ai/docs/
  llms_txt: https://agentslot.ai/llms.txt
  repository: https://github.com/agentslot-ai/cli
---

# AgentSlot

AgentSlot hosts your own official AI API keys and authorized developer endpoints inside hardened, isolated cloud containers with fixed city static outbound IPs, and exposes them alongside optional local bridges through one unified multi-protocol inference gateway (`https://api.agentslot.dev`).

- **BYOK only**: AgentSlot does not sell or resell AI models, tokens, or third-party subscriptions. Users bring their own official API keys, OpenRouter OAuth keys, custom OpenAI-compatible endpoints, or self-hosted local model servers.
- **Zero prompt storage**: Prompts, system instructions, files, and model responses stay strictly in memory; only request metadata (timing, token counts, model names, error classes) is recorded.
- **Three token prefixes (never mix them up)**:
  - `asl_...` — **Gateway Access Point token** (`AGENTSLOT_API_KEY`). Sent to `https://api.agentslot.dev/v1/*`.
  - `aslp_...` — **Control Plane Personal API Token** (`AGENTSLOT_TOKEN`). Sent to `https://app.agentslot.ai/api/v1/*` via `Authorization: Bearer`.
  - `aslb_...` — **Local Bridge tunnel token** (`AGENTSLOT_BRIDGE_TOKEN`). Used only by `agentslot-bridge`.

## Step 0: Install and Inspect via CLI

Install the zero-dependency native `agentslot` CLI if not already in `PATH`:

```bash
curl -fsSL https://agentslot.ai/install.sh | sh
```

Windows PowerShell:

```powershell
irm https://agentslot.ai/install.ps1 | iex
```

Always prefer `--json` when calling `agentslot` from an agent so outputs and errors are structured and deterministic:

```bash
agentslot info --json      # Live endpoints, protocols, seat tiers and free bridge rules
agentslot doctor --json    # Check CLI, auth state, gateway reachability, models and local tools
agentslot schema           # Full machine-readable command & flag catalog
```

## Decision Router

Pick the shortest path matching the user's goal:

| User goal | First commands | Reference to load |
|---|---|---|
| Understand AgentSlot pricing, architecture, protocols | `agentslot info --json` and `agentslot guide` | [references/gateway-api.md](references/gateway-api.md) |
| Connect Claude Code, Codex, Cursor, OpenCode, Cline, Magpie, or SDKs | `agentslot doctor --json`, `agentslot models --json`, `agentslot setup <client> --dry-run --json` | [references/clients.md](references/clients.md) |
| Sign in and manage cloud instances, API keys, route groups, access points, billing | `agentslot auth status --json` or `agentslot auth login --no-browser` | [references/cli.md](references/cli.md) |
| Connect local Ollama / vLLM / LM Studio or local API keys over free bridge slots | `agentslot instances create --tier bridge --alias <name> --json` | [references/bridge.md](references/bridge.md) |
| Diagnose `401`/`413`/`503`/failover/credential errors | `agentslot errors --json` and `agentslot ping --json` | [references/errors.md](references/errors.md) |

## Non-Negotiable Safety Rules for Agents

1. **Never leak secrets in argv or chat**: Never pass raw API keys or `aslp_`/`asl_`/`aslb_` tokens via CLI flags if stdin or env vars are available. Use `--api-key-env <ENV_VAR>`, `--api-key-stdin`, or `--token-stdin`. Never repeat raw tokens back into user-visible logs or committed files.
2. **Preview before modifying user config files**: Before running `agentslot setup <client> --write`, run `--dry-run --json` first and confirm with the user unless they explicitly asked to write their local settings file.
3. **Never hang waiting for interactive input**: Always pass `--no-input` or `--json` and explicit flags (use `--yes` for destructive actions only after user confirmation).
4. **Device login in headless/agent environments**: Run `agentslot auth login --no-browser --json`, present the `verification_url_complete` and 8-character `user_code` to the user, and wait for them to approve it in `https://app.agentslot.ai/cli-auth`. Alternatively, users can mint a Personal API Token (`aslp_...`) in **Console → Settings → CLI 与 API 令牌** and export `AGENTSLOT_TOKEN`.

## Fast Verification Checklist

After connecting any client or creating an instance:

```bash
agentslot models --json
agentslot ping --model <model-id> --json
```

Confirm HTTP `200`, non-empty model list, and a valid `AgentSlot-Request-Id` response header.

## References

- [references/cli.md](references/cli.md) — Complete `agentslot` CLI command reference, auth flows, JSON contract and exit codes.
- [references/clients.md](references/clients.md) — Exact config layouts for Claude Code, Codex, OpenCode, Cursor, Cline, Roo Code, Windsurf, Cherry Studio, Magpie, Python and TypeScript SDKs.
- [references/gateway-api.md](references/gateway-api.md) — Multi-protocol inference API, model routing prefixes, session affinity and failover rules.
- [references/bridge.md](references/bridge.md) — Local bridge slots, `agentslot-bridge` installation, connecting local servers and troubleshooting.
- [references/errors.md](references/errors.md) — Gateway and Console API error codes with exact recovery actions.
