Base URL: http://localhost:8000/api/v1
All endpoints require a Bearer token except auth endpoints. Obtain a token via the login/verify flow.
Request a magic link token.
{ "email": "user@example.com" }Response (202):
{ "message": "Check your email for a login link", "dev_token": "..." }In development, dev_token is returned directly. In production, the token would be sent via email.
Exchange a magic link token for a session JWT.
{ "token": "<dev_token>" }Response:
{
"access_token": "eyJ...",
"token_type": "bearer",
"user_id": "...",
"email": "user@example.com"
}Response: 204 No Content
List available providers and whether they are configured on the server.
Response:
[
{
"key": "zai",
"display_name": "Z.ai GLM Coding Plan",
"model": "zai-coding/glm-5",
"configured": true
}
]One-click tenant provisioning. Creates tenant, runs OpenClaw onboarding, configures webchat and model, starts container.
Request:
{
"slug": "acme",
"name": "Acme Corp",
"provider": "zai",
"secrets": {}
}slug— DNS-safe identifier (3-50 chars, lowercase alphanumeric and hyphens)name— display nameprovider— one ofzai,moonshot,minimax(default:zai)secrets— optional additional per-tenant secrets
Response (200):
{
"tenant_id": "550e8400-...",
"slug": "acme",
"status": "running",
"provider": "zai",
"model": "zai-coding/glm-5",
"url": "https://octw.example.com/acme/"
}Error responses:
- 400 — invalid provider or provider not configured on server
- 409 — slug already exists
Create a tenant without provisioning OpenClaw (use /provision for the full flow).
{
"slug": "acme",
"name": "Acme Corp",
"plan": "standard",
"isolation_mode": "standard",
"trusted_proxy_auth": true
}Response (201):
{ "tenantId": "...", "slug": "acme", "status": "stopped" }List tenants the authenticated user belongs to.
Get tenant details. Requires membership.
Update tenant (currently supports name). Requires tenant_admin role.
Delete tenant and all resources. Requires tenant_admin role. Response: 204.
List tenant members and their roles.
Add a member. Requires tenant_admin role.
{ "email": "user@example.com", "role": "tenant_user" }Roles: tenant_admin, tenant_user, tenant_viewer.
Remove a member. Requires tenant_admin role. Response: 204.
Secrets are encrypted at rest (AES-256-GCM envelope encryption). The API never returns secret values.
List secret metadata (names, types, timestamps — never values).
Create or update a secret. Requires tenant_admin role.
{
"value": "sk-...",
"type": "env",
"target_env_var": "OPENAI_API_KEY"
}Delete a secret. Requires tenant_admin role. Response: 204.
Rotate a secret (provide new value). Requires tenant_admin role.
{ "name": "OPENAI_API_KEY", "value": "sk-new-..." }Get tenant runtime state, container ID, last activity, and resource limits.
{
"tenant_id": "...",
"state": "running",
"container_id": "abc123...",
"last_activity_at": "2026-02-28T...",
"limits": { "mem_limit": "1536m", "cpu_quota": 100000, "pids_limit": 512 }
}States: running, paused, stopped, error, not_found.
Start the tenant container. Requires tenant_user or above.
Stop and remove the tenant container. Requires tenant_user or above.
Pause the container (memory retained, CPU released). Requires tenant_user or above.
Wake a paused or stopped tenant. Requires tenant_user or above.
Get container logs.
Query parameters:
since— Unix timestamptail— number of lines (default 200, max 5000)
These are used by octw-edge and should be restricted to internal access (mTLS in production).
Base URL: http://localhost:8000/internal/v1/tenants
All endpoints accept either a UUID or slug as the {identifier}.
| Method | Path | Description |
|---|---|---|
| POST | /{identifier}/ensure-running |
Wake tenant if not running |
| POST | /{identifier}/pause-if-idle |
Pause tenant |
| POST | /{identifier}/stop-if-idle |
Stop tenant |
| GET | /{identifier}/status |
Get container state and IP |
{ "state": "running", "ip": "172.18.0.5" }Prometheus-format metrics endpoint. No authentication required.
curl http://localhost:8000/metricsAvailable metrics:
| Metric | Type | Description |
|---|---|---|
octw_tenant_container_starts_total |
Counter | Tenant container start events (label: tenant_id) |
octw_tenant_container_stops_total |
Counter | Tenant container stop events (label: tenant_id) |
octw_tenant_wake_events_total |
Counter | Wake-on-request events (label: tenant_id) |
octw_tenant_pause_events_total |
Counter | Tenant pause events (label: tenant_id) |
octw_active_tenants |
Gauge | Currently running tenant containers |
octw_proxy_request_duration_seconds |
Histogram | Edge proxy request duration (labels: tenant_slug, method, status) |
octw_secret_operations_total |
Counter | Secret lifecycle operations (labels: tenant_id, operation) |
octw_auth_failures_total |
Counter | Authentication failures (label: reason) |
A Prometheus scrape config is provided at configs/prometheus.yml.
Health check endpoint on octw-api. No authentication required.
{ "status": "ok" }Health check endpoint on octw-edge.
{ "status": "ok", "service": "octw-edge" }