How do I start my first Agent API run?
You can go from nothing to a finished run in about five minutes.
Steps#
- Sign in to the Console at console.clatterlabs.com with your Clatter Labs account. Copy your Account ID (it looks like
CL-7K2M9QXA) from the Home page. - Create an API key in API keys › Create key. Keep the
runs:writeandruns:readpermissions and the default rate limit (30 requests per minute). Copy the key now: it starts withclsk_and is shown only once. - Start a run:
curl https://api.agent.clatterlabs.xyz/v1/runs \
-H "Authorization: Bearer $CLATTER_API_KEY" \
-H "X-Clatter-Account: $CLATTER_ACCOUNT_ID" \
-H "Content-Type: application/json" \
-d '{"input": "Write hello.py that prints the date, run it, and tell me the output."}'
The API answers 201 right away with the run and its id.
- Watch it work by streaming
GET /v1/runs/RUN_ID/events, or fetchGET /v1/runs/RUN_IDevery few seconds. - Read the result:
outputholds the answer, andfileslists what Cosmos saved. Add?include=filesto get file contents.
If something goes wrong#
A 401 usually means the key or the X-Clatter-Account header is wrong. A 402 out_of_credits means your balance is empty. See the full Quickstart.
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.