Base URL
api.declaw.ai.
Protocol
Declaw Cloud (api.declaw.ai) requires HTTP/2. Clients that connect with HTTP/1.1 will receive a 464 status code from the load balancer. All official SDKs (Python, TypeScript, Go) and the CLI handle this automatically — no configuration needed.
If you are calling the API directly (without an SDK), ensure your HTTP client supports HTTP/2. For example, curl must be invoked with --http2, and Python’s httpx must be initialized with http2=True.
Enterprise on-prem deployments may accept HTTP/1.1 depending on your load balancer configuration.
Authentication
All requests require anX-API-Key header. See Authentication
for details.
Request Format
All request bodies must be JSON. Set theContent-Type: application/json header on
every POST and PATCH request.
413 Request Entity Too Large. The binary streaming endpoint (/files/raw) has a higher limit of 500 MiB to support large file transfers.
Response Format
All responses are JSON. Successful responses return the resource object or an operation result directly at the top level. There is no top-leveldata wrapper.
Error Format
Errors return a JSON object with a singlemessage field explaining the problem.
HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Resource created |
400 | Invalid request — check the message field |
401 | Missing or invalid API key |
404 | Resource not found |
410 | Sandbox has been killed |
464 | HTTP/1.1 client — upgrade to HTTP/2 (see Protocol) |
500 | Internal server error |
502 | The in-VM envd daemon is unreachable |
503 | Orchestrator unavailable (VM could not be created) |
Resource IDs
All resource IDs use a short-prefix format:| Resource | Format | Example |
|---|---|---|
| Sandbox | sbx- + 8 chars | sbx-a1b2c3d4 |
| Snapshot | snap- + 8 chars | snap-a1b2c3d4 |
Pagination
TheGET /sandboxes endpoint returns a next_token field alongside the
sandboxes array. A null value means there are no further pages. Future
endpoints that return large lists will follow the same cursor-based pagination
pattern.
Timestamps
All timestamps are returned in ISO 8601 format in UTC, for example:2024-01-15T10:30:00Z.
Path Parameters
Path parameters use snake_case, for example:API Groups
The API is organized into three resource groups:Sandbox
Create, inspect, pause, snapshot, and kill sandbox VMs.
Command
Run commands synchronously or with streaming. Manage background processes.
Filesystem
Read, write, list, rename, and watch files inside a sandbox.