Skip to content

Your first agent

This walkthrough assumes you have cloudscode running locally (see Installation).

Every workload in cloudscode lives inside a tenant. Create one through the dashboard or the API:

Terminal window
curl -X POST http://localhost:8787/tenants \
-H 'content-type: application/json' \
-d '{"name":"acme","plan":"hobby"}'

The response includes a tenant_id you’ll use for all subsequent calls.

cloudscode never ships with a vendor key. You bring your own:

Terminal window
curl -X POST http://localhost:8787/byok \
-H "x-tenant-id: <tenant_id>" \
-H 'content-type: application/json' \
-d '{"provider":"anthropic","api_key":"sk-ant-..."}'

Keys are encrypted at rest and scoped to the tenant. See the BYOK guide for the full provider list.

Terminal window
curl -X POST http://localhost:8787/instances \
-H "x-tenant-id: <tenant_id>" \
-H 'content-type: application/json' \
-d '{"runtime":"openclaw","image":"cloudscode/openclaw:latest"}'

The instance comes back with a live_view_url — open it in your browser to watch the agent in real time.

Terminal window
curl -X POST http://localhost:8787/conversations \
-H "x-tenant-id: <tenant_id>" \
-H 'content-type: application/json' \
-d '{"instance_id":"...","message":"build me a hello-world Hono API"}'

That’s it. The runtime now owns the loop. Watch it run, replay it later from /replay/:id, or hook a webhook to be notified on completion.