API Reference
LobsterCage provides a REST API for managing cages, environment variables, billing, and API keys programmatically.
Base URL
https://api.lobstercage.ai/v1Authentication
All requests require a Bearer token in the Authorization header:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.lobstercage.ai/v1/cagesYou can authenticate with either:
- API key — Created via
lobster apikeys createor the dashboard - Clerk JWT — Issued by the dashboard’s auth flow
Endpoints overview
Cages
| Method | Path | Description |
|---|---|---|
GET | /cages | List all cages |
POST | /cages | Create a new cage |
GET | /cages/{cageId} | Get cage details |
PUT | /cages/{cageId} | Update cage config |
DELETE | /cages/{cageId} | Destroy a cage |
POST | /cages/{cageId}/start | Start a cage |
POST | /cages/{cageId}/stop | Stop a cage |
POST | /cages/{cageId}/hibernate | Hibernate a cage |
Environment variables
| Method | Path | Description |
|---|---|---|
GET | /cages/{cageId}/env | List env var names |
PUT | /cages/{cageId}/env | Set env vars |
DELETE | /cages/{cageId}/env/{name} | Delete an env var |
Tunnels
| Method | Path | Description |
|---|---|---|
POST | /cages/{cageId}/tunnel | Create a tunnel token (ssh, shell, port) |
POST | /cages/{cageId}/observe | Create an observer token |
POST | /cages/{cageId}/port-forward | Create an HTTP proxy token |
Billing
| Method | Path | Description |
|---|---|---|
GET | /billing/status | Current balance and usage |
POST | /billing/portal | Get Stripe portal URL |
API Keys
| Method | Path | Description |
|---|---|---|
GET | /apikeys | List API keys |
POST | /apikeys | Create an API key |
DELETE | /apikeys/{keyId} | Revoke an API key |
Events
| Method | Path | Description |
|---|---|---|
GET | /cages/{cageId}/events | List cage audit events |
Error format
All errors return JSON with a consistent shape:
{
"error": {
"code": "CAGE_NOT_FOUND",
"message": "Cage with id 'abc123' not found"
}
}Rate limiting
API requests are rate-limited per API key using a sliding window. Current limits are returned in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1700000000