API Endpoints

Agents

Spawn Agent

POST /api/v1/agents/spawn
Authorization: Bearer sx-...

{
  "task": "Refactor the auth module",
  "repo_url": "https://github.com/org/repo",
  "model": "azure/gpt-4-1-teacher",
  "max_tokens": 8192
}

List Agents

GET /api/v1/agents
GET /api/v1/agents?status=running

Get Agent

GET /api/v1/agents/{agent_id}

Stop Agent

DELETE /api/v1/agents/{agent_id}

Billing

Get Usage

GET /api/v1/billing/usage
GET /api/v1/billing/usage/breakdown?days=30

Get Dashboard

GET /api/v1/billing/dashboard

Get Plans

GET /api/v1/billing/plans

Create Checkout Session

GET /api/v1/billing/checkout/{plan}?billing_period=monthly

Auth Keys

List Keys

GET /api/v1/auth/keys

Create Key

POST /api/v1/auth/keys
{ "name": "my-app", "expires_at": "2027-01-01T00:00:00Z" }

Revoke Key

DELETE /api/v1/auth/keys/{key_id}