One API. Any Agent. Anywhere.
The harness that harnesses other harnesses! Run AI agents across multiple backends from a single API. Switch between Claude, Codex, OpenCode, Gemini, and Factory with one config change. Your code, prompts, and outputs stay on your infrastructure. Zero vendor lock-in.
- Multi-backend — Claude, Codex, OpenCode, Gemini, Factory behind one API
- Claude Managed Agents compatible — implements the Anthropic Managed Agents API
- Sandboxed environments — 11 providers: local (Docker, Podman, Apple Container, mvm/Firecracker) and cloud (Sprites, E2B, Fly, Vercel, Daytona, Modal)
- Multi-agent threads — agents can spawn other agents, max depth 3
- Self-hosted — runs on your infrastructure, data never leaves your machine
- CLI-first —
gateway quickstartwith interactive prompts, markdown rendering, and rich tool output - Built-in web UI — React + shadcn/ui dashboard at localhost:4000 with chat, settings, debug panel
- Open source — Apache 2.0 license, no CLA
The fastest way to get started — Claude Code walks you through everything:
git clone https://github.com/agentstep/gateway.git
cd gateway
claude
> /setup-gatewayThe /setup-gateway skill is included in the repo. It checks prerequisites, configures secrets, starts the server, and runs your first session.
docker run -p 4000:4000 -e ANTHROPIC_API_KEY=sk-ant-... ghcr.io/agentstep/gatewayOr with docker compose:
git clone https://github.com/agentstep/gateway.git
cd gateway
export ANTHROPIC_API_KEY=sk-ant-...
docker compose upServer starts at http://localhost:4000 with UI, API (/v1), and docs (/v1/docs).
- Node.js 22+
- At least one API key:
ANTHROPIC_API_KEY,OPENAI_API_KEY, orGEMINI_API_KEY
npm install -g @agentstep/gatewaygit clone https://github.com/agentstep/gateway.git
cd gateway
npm install
export ANTHROPIC_API_KEY=sk-ant-...
npm run devgateway quickstartCreates an agent + environment + session and drops you into an interactive chat.
| Package | npm | Description |
|---|---|---|
packages/agent-sdk |
@agentstep/agent-sdk |
Engine — backends, providers, DB, session management |
packages/gateway |
@agentstep/gateway |
CLI tool (gateway) |
packages/gateway-ui |
@agentstep/gateway-ui |
React + shadcn/ui web app (built into CLI) |
packages/gateway-hono |
@agentstep/gateway-hono |
Hono server adapter (used by gateway serve) |
packages/gateway-fastify |
@agentstep/gateway-fastify |
Fastify server adapter |
packages/gateway-next |
@agentstep/gateway-next |
Next.js integration |
The server packages are reference implementations. The hosted product (agentstep.com) uses @agentstep/agent-sdk directly.
Claude, Codex, OpenCode, Gemini, Factory.
Local: Docker, Apple Container, Apple Firecracker (mvm), Podman Cloud: Sprites (default), E2B, Vercel, Daytona, Fly, Modal
gateway agents create --name mybot --model claude-sonnet-4-6
gateway environments create --name dev --provider docker
gateway sessions create --agent <id> --environment <id>
gateway quickstart # one-command agent + env + session
gateway serve # start the API server
gateway chat <session-id> # interactive chat
gateway config set <key> <value> # configure CLIAll commands support --remote <url> for connecting to a remote server and -o json for JSON output.
npm install # install dependencies
npm run dev # start Hono dev server
npm run dev:next # start Next.js dev server
npm test # run tests
npm run typecheck # type checking