Your first agent
This walkthrough assumes you have cloudscode running locally (see Installation).
1. Create a tenant
Section titled “1. Create a tenant”Every workload in cloudscode lives inside a tenant. Create one through the dashboard or the API:
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.
2. Add a key (BYOK)
Section titled “2. Add a key (BYOK)”cloudscode never ships with a vendor key. You bring your own:
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.
3. Boot a runtime instance
Section titled “3. Boot a runtime instance”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.
4. Send a message
Section titled “4. Send a message”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.