Runs
Create a run
Start an AI agent run on a GitHub repository using a specified template.
Authorization
BearerAuth AuthorizationBearer <token>
API key (csk_live_…)
In: header
Request Body
application/json
repo*string
GitHub repository in owner/repo format or full URL
Length
1 <= lengthbranch?string
Git branch to clone
prompt*string
Task prompt for the AI agent
Length
1 <= length <= 50000template*string
Template slug to use for the sandbox
Length
1 <= lengthguardrails?
Guardrails to limit agent execution
model?string
AI model to use
Default
"sonnet"Value in
"sonnet" | "opus" | "haiku"env?
Environment variables to inject into the sandbox
callbackUrl?string
URL to POST results to on completion/failure
Format
uriLength
length <= 2048metadata?|
User-defined key-value metadata echoed in responses and webhooks. Max 4 KB, 50 keys.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.cospec.io/v1/runs" \ -H "Content-Type: application/json" \ -d '{ "repo": "string", "prompt": "string", "template": "string" }'{
"id": "string",
"status": "pending",
"createdAt": "2019-08-24T14:15:22Z"
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"requestId": "string"
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"requestId": "string"
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"requestId": "string"
}