The Replica API and Automations are the only sanctioned channels for programmatic use of Replicas. Scripting against the dashboard, automating the CLI, or driving interactive surfaces from headless browsers is prohibited under our Terms of Service.
Authentication
API keys are available on the Developer plan and above. See Billing for plan details. Generate an API key from Settings > API Keys in the dashboard. Include it as a Bearer token in requests:Quick Start
1. List Available Repositories
Before creating a replica, list the repositories available in your organization:2. Create a Replica
Thename field must not contain whitespace (e.g. fix-auth-bug, not fix auth bug).
repository_set_id instead of repository_ids to target a group of repositories.
Optional lifecycle_policy controls what happens when work is done:
default- workspace sleeps after inactivity (default)delete_when_done- workspace is deleted when the agent finishes (useful for CI/CD)delete_after_inactivity- workspace is deleted after a period of inactivity
3. Send a Follow-up Message
4. Check Status
include=environment to get detailed environment info, or include=diffs for full git diffs.
5. Stream Events (SSE)
Key Concepts
Repositories and Repository Sets
Workspaces are created from repositories that have been added to your organization. You can target:repository_ids- One or more specific repository UUIDsrepository_set_id- A named collection of repositories
GET /v1/replica/repositories and GET /v1/replica/repository-sets to discover available targets.
Chat Management
Each workspace can have multiple chat sessions with different coding agents:Plan Mode
Send a message in plan mode to get a plan before execution:Images
Attach images (screenshots, diagrams) to messages:Chat History
Read the message history for a chat (replaces the deprecated/read endpoint):
Hooks
View warm and start hook execution logs:Workspace Lifecycle
| Status | Description |
|---|---|
preparing | Workspace is being created and initialized |
active | Workspace is running and ready for messages |
sleeping | Workspace is paused (auto-wakes on interaction) |
waking: true. Organizations on the Team plan or higher with warm pools enabled can expect setup times under 10 seconds. Otherwise, expect 10-60 seconds depending on repository size.
Prerequisites
Before using the API:- Add your repository in the dashboard
- Configure credentials for your coding agent (Claude or Codex)
Use Cases
- CI/CD Integration - Trigger replicas from GitHub Actions or other pipelines
- Batch Operations - Create multiple replicas for parallel task execution
- Custom Workflows - Build internal tools that leverage AI coding agents
- Monitoring - Stream events and poll workspace state for dashboards