Skip to main content
This page takes you from nothing to a thread you can watch working at capy.ai. Everything is copy-paste curl; the only prerequisites are a Capy account with a project set up and a terminal.

1. Mint an API key

In the app, go to Settings → API and create a key. The plaintext is shown exactly once (there’s no re-display, only revoke-and-remint), so export it now:

2. Find your project id

Threads live in projects, and the public API has no projects endpoint yet, so the id comes from the app: open any of your project’s pages and copy the whole route parameter after /project/ in the URL. Newly created projects use project_... ids; imported ones keep their original id.
Verify the key and the project together by listing threads; an empty page is a working setup:
A capy/Unauthorized means the key is wrong or revoked; a capy/ProjectNotFound means the id is wrong or the project isn’t reachable from this key’s organization.

3. Create a thread

requestId is an idempotency token you mint: retries with the same id return the same thread instead of starting a second billable run.
The response is the Thread projection, the same shape every thread read returns:
Save the id:

4. Poll the status

status is what you poll on: Poll every few seconds until the status leaves active and waiting. Threads run for minutes, not seconds; a real coding task takes as long as the work does.

5. Read the messages

The transcript is { items, cursor } of Message entries: your messages (source: "user"), the agent’s replies (source: "assistant"), and one-line tool activity (source: "tool" with the tool name, never raw arguments or results). When the agent opens a pull request, the PR link arrives in its assistant reply text. Page forward by passing the response’s cursor back as after; poll the same way to tail a live thread.

6. Reply

The response is an admit receipt, { "id": "...", "deduped": false }: the message landed and the agent wakes. By default a message interrupts what the agent is doing; pass "delivery": "queue" to wait for the current work to finish first.

You’re done

Open capy.ai: the thread you just created is on the Threads page, transcript and all, exactly as the API reported it. Everything the app shows rides the same platform you just drove with curl. Next: common flows for the task tree, reviews, and automation webhooks.