Create thread
bearerAuthAuthorizationBearer <token>An API key created in Capy under Settings → API.
application/json- body
requestId*string1 <= length <= 191projectId*stringtitle?stringmessage*stringenvironmentVariables?array<>Write-only environment variables for this thread and its descendants, encrypted at rest. Commands can read the values and outputs are not masked. A replayed requestId preserves the original variables.
model?The model to run. A named model that cannot run answers ModelSelection.Rejected and never falls back. Absent, the thread starts on the first default the key's principal can run: a human key's own default, else a service user's default, then the organization default, then Capy's default. The create response's modelDefault reports which one. When no default can run, the create answers ModelSelection.Rejected naming each default and why.
machineSize?string"small""medium""large""ultra""hyper""bigguy"device?authorId?stringvisibility?stringWho can see the thread: org for everyone at the organization, private for its owner and the people it is shared with. Absent, the owner's own default applies, else the organization's. private needs a human owner who may create private work, so a service key must name authorId.
"org""private"personal?booleanpullRequestAuthor?stringWho authors this thread's pull requests on GitHub: capy for the Capy GitHub App, user for the thread's acting human (the authorId member, or the key's creator for a service key). Commits and pushes keep the Git identity preference. Absent leaves the preference in charge; a replayed requestId keeps the original value.
"user""capy"Thread
application/json- response
id*stringprojectId*string|nullauthorId*string|nullpreviousAuthorId*string|nulltitle*string|nulltitleCustom*booleanstatus*string"working""waiting""idle""failed""archived"archived*booleanlastModelId*string|nullmodelDefault?On the create response when the request named no model: the model the thread starts on and the default that supplied it, with any default skipped because it could not run.
queuedAt*string|nulllinearIssue*|nullpullRequestAuthor*|Who authors this thread's pull requests on GitHub: capy for the Capy GitHub App, user for the thread's acting human. Null means the acting human's Git identity preference decides.
usage*createdAt*stringupdatedAt*stringlastActivityAt*string|nullhasUnreads*booleanmentionCount*integerowed*booleanneedsYou?booleanask?crewNeedsYou?integerparticipated?booleancrewMentionCount?integercaptain?crewCount?integermember*booleansubscribed?booleanpersonal?booleanvisibility?string"org""private"curl -X POST 'https://api.capy.ai/api/v1/threads' \ -H 'Content-Type: application/json' \ -d '{ "requestId": "string", "projectId": "string", "message": "string"}'{ "id": "string", "projectId": "string", "authorId": "string", "previousAuthorId": "string", "title": "string", "titleCustom": true, "status": "working", "archived": true, "lastModelId": "string", "modelDefault": { "modelId": "string", "source": "personal", "skipped": [ { "modelId": "string", "source": "personal", "reason": "string" } ] }, "queuedAt": "string", "linearIssue": { "key": "string", "url": "string" }, "pullRequestAuthor": "user", "usage": { "llmCredits": 0, "imageCredits": 0, "vmCredits": 0, "totalCredits": 0 }, "createdAt": "string", "updatedAt": "string", "lastActivityAt": "string", "hasUnreads": true, "mentionCount": 0, "owed": true, "needsYou": true, "ask": { "key": "string", "kind": "conversation", "text": "string", "causeKey": "string" }, "crewNeedsYou": 0, "participated": true, "crewMentionCount": 0, "captain": { "jamId": "string", "name": "string", "avatar": { "kind": "preset", "value": "string", "background": "string", "image": "string", "library": "string" } }, "crewCount": 0, "member": true, "subscribed": true, "personal": true, "visibility": "org"}