Docs
Runs

Get a run

GET
/v1/runs/{id}

Authorization

BearerAuth
AuthorizationBearer <token>

API key (csk_live_…)

In: header

Path Parameters

id*string

Run ID

Response Body

application/json

application/json

application/json

curl -X GET "https://api.cospec.io/v1/runs/string"
{
  "id": "string",
  "organizationId": "string",
  "templateId": "string",
  "templateSlug": "string",
  "repo": "string",
  "branch": "string",
  "prompt": "string",
  "model": "sonnet",
  "guardrails": {
    "timeoutSeconds": 0,
    "maxTurns": 0,
    "maxCostUsd": 0
  },
  "envVars": {
    "property1": "string",
    "property2": "string"
  },
  "status": "pending",
  "failReason": "error",
  "outputs": [
    {
      "type": "text",
      "eventId": "string",
      "content": "string"
    }
  ],
  "usage": {
    "totalCostUsd": 0,
    "agent": {
      "costUsd": 0,
      "numTurns": 0,
      "durationSeconds": 0,
      "inputTokens": 0,
      "outputTokens": 0,
      "cacheReadTokens": 0,
      "cacheCreationTokens": 0,
      "contextWindowSize": 0,
      "effectiveContextTokens": 0
    },
    "sandbox": {
      "costUsd": 0,
      "durationSeconds": 0,
      "ratePerMinuteUsd": 0,
      "waived": true
    }
  },
  "error": {
    "code": "string",
    "message": "string",
    "detail": "string"
  },
  "createdAt": "2019-08-24T14:15:22Z",
  "startedAt": "2019-08-24T14:15:22Z",
  "completedAt": "2019-08-24T14:15:22Z",
  "cancelRequestedAt": "2019-08-24T14:15:22Z",
  "callbackUrl": "string",
  "callbackStatus": "pending",
  "metadata": {
    "property1": "string",
    "property2": "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"
}