Docs
Runs

List runs

GET
/v1/runs

Authorization

BearerAuth
AuthorizationBearer <token>

API key (csk_live_…)

In: header

Query Parameters

page?integer

Page number

Default1
Range1 <= value <= 10000
limit?integer

Items per page

Default20
Range1 <= value <= 100
status?|

Filter by run status (comma-separated)

search?string

Search runs by prompt text

Lengthlength <= 200
template?string

Filter by template slug

Lengthlength <= 50
model?string

Filter by AI model

Value in"sonnet" | "opus" | "haiku"
outputTypes?string

Filter by output type (comma-separated)

sortBy?string

Sort field

Default"createdAt"
Value in"createdAt" | "costUsd"
order?string

Sort order

Default"desc"
Value in"asc" | "desc"

Response Body

application/json

application/json

curl -X GET "https://api.cospec.io/v1/runs"
{
  "data": [
    {
      "id": "string",
      "repo": "string",
      "branch": "string",
      "prompt": "string",
      "model": "sonnet",
      "status": "pending",
      "failReason": "error",
      "templateSlug": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "completedAt": "2019-08-24T14:15:22Z",
      "outputs": [
        {
          "type": "text",
          "eventId": "string"
        }
      ],
      "usage": {
        "totalCostUsd": 0
      }
    }
  ],
  "pagination": {
    "page": 0,
    "limit": 0,
    "total": 0,
    "totalPages": 0
  },
  "meta": {
    "activeCount": 0,
    "hasEverRun": true
  }
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "requestId": "string"
}