Cosmos Agent
Cosmos Agent
An AI coding agent you call over HTTPS. Describe a task; Cosmos does the work on its own cloud computer and returns the result.
Cosmos Agent is Clatter Labs' AI agent for coding, available as an API. You send instructions in plain language. Cosmos plans the work, writes and runs code, uses a browser, keeps files, and reports back with an answer and any files it produced.
Start in five minutes
Create a key and run your first task.
API reference
Create, stream, read and cancel runs.
What a run can do
Each run works on your account's own cloud computer, with these tools:
| Tool | What Cosmos uses it for |
|---|---|
| Terminal and files | Install packages, run builds and tests, read and edit code |
| Browser | Open sites, click and type, check what a page really shows |
| Web search and fetch | Look up docs and references |
| Cloud Repos | Keep code in a repository, with history |
| Hosting | Deploy sites and APIs to <name>.clatterai.com, with DNS, a SQL database and key-value storage |
| Database and storage | Store data and assets, install skills |
| Sub-agents | Split a big job into parallel pieces |
| Memory | Remember what it learned for later runs |
| Connected apps | Use the connectors and MCP servers on your account |
| Outputs | Save files you get back with the run |
The run lifecycle
queued ─▶ running ─▶ completed
├─▶ failed (error.code: run_failed | out_of_credits)
└─▶ cancelled (POST /v1/runs/{id}/cancel)- Create a run with
POST /v1/runs. You get the run back immediately with statusrunning. - Follow it with the event stream (
GET /v1/runs/{id}/events) or pollGET /v1/runs/{id}. - Read the result:
outputis Cosmos's final answer;fileslists what it saved.
Runs keep going if you disconnect. A long task continues in segments past any single request's time limit, up to 150 steps.
Base URL and authentication
https://api.agent.clatterlabs.xyzEvery request sends two headers: your key as a bearer token and your Account ID.
Authorization: Bearer clsk_...
X-Clatter-Account: CL-XXXXXXXXSee Authentication for details.