API automation

Control Pixcode from scripts, dashboards, CI, and remote tools.

Pixcode exposes REST and WebSocket-powered automation. Generate a scoped `px_` API key, then run or schedule NanoClaw tasks, inspect projects, stream task events, and use the admin-only production agent loop from external clients.

Pixcode desktop API and CLI workspace
Use the same authenticated Pixcode workspace from the browser, or call its documented API from scripts and CI.

Authentication

New Pixcode API keys start with `px_`. Older `ck_` keys remain accepted for compatibility, but new documentation and examples should use `px_`. Keys can carry least-privilege scopes such as `projects:read`, `tasks:write`, or `system:update`. The legacy `orchestration:read`/`orchestration:write` scope names are retained only for the maintained `/api/production-agent-loop/*` admin surface; the former `/api/orchestration/*` routes are retired.

curl http://localhost:3001/api/projects \
  -H "Authorization: Bearer px_your_key_here"
curl http://localhost:3001/api/projects \
  -H "X-API-Key: px_your_key_here"

Browser EventSource/WebSocket clients should call POST /api/auth/stream-ticket and use the returned one-shot ?streamTicket=... value. Raw ?token= and ?apiKey= query credentials are disabled by default.

Run a one-shot agent task

`POST /api/nanoclaw/run` is the maintained non-interactive entry point for a multi-CLI agent run. The legacy `POST /api/agent` route remains available for compatibility with older CI integrations.

curl http://localhost:3001/api/nanoclaw/run \
  -H "Authorization: Bearer px_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "agentType": "codex",
    "projectId": "my-app",
    "prompt": "Review the current diff and list release risks."
  }'

Task and production automation

NanoClaw exposes immediate runs, schedules, task lifecycle, channels, agents, conversations, and SSE events. The production agent loop is admin-only and covers review queues, CI repair plans, background jobs, workspace checkpoints, and desktop release policy.

Run

POST /api/nanoclaw/run starts one multi-CLI task and returns structured status/log data.

Schedule

POST /api/nanoclaw/tasks supports one-shot, interval, and cron schedules.

Lifecycle

Pause, resume, update, cancel, or delete a task with the /api/nanoclaw/tasks/:id routes.

Production loop

Use /api/production-agent-loop/* for admin review and CI automation.

The pre-1.55 /api/orchestration/* workflow family is retired. Use NanoClaw or the production agent loop for new integrations.

Common integration ideas

Full OpenAPI reference: openapi.yaml.