Skip to content
Get started

List task runs

GET/api/promptly/tasks/{taskId}/runs

Retrieve run history for a specific task

Path ParametersExpand Collapse
taskId: string
formatuuid
Query ParametersExpand Collapse
limit: optional number

Maximum number of runs to return

maximum100
ReturnsExpand Collapse
id: optional string
formatuuid
completedAt: optional string
formatdate-time
costCents: optional number

Cost in cents

createdAt: optional string
formatdate-time
deliveryStatus: optional "pending" or "delivered" or "failed"
Accepts one of the following:
"pending"
"delivered"
"failed"
durationMs: optional number

Execution time in milliseconds

error: optional string

Error message if failed

output: optional string

AI-generated output

startedAt: optional string
formatdate-time
status: optional "pending" or "running" or "completed" or "failed"
Accepts one of the following:
"pending"
"running"
"completed"
"failed"
taskId: optional string
formatuuid
tokensUsed: optional number

Total tokens consumed

List task runs

curl https://0ct.com/api/promptly/tasks/$TASK_ID/runs \
    -H "Authorization: Bearer $0CT_API_KEY"
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "completedAt": "2019-12-27T18:11:19.117Z",
    "costCents": 0,
    "createdAt": "2019-12-27T18:11:19.117Z",
    "deliveryStatus": "pending",
    "durationMs": 0,
    "error": "error",
    "output": "output",
    "startedAt": "2019-12-27T18:11:19.117Z",
    "status": "pending",
    "taskId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "tokensUsed": 0
  }
]
Returns Examples
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "completedAt": "2019-12-27T18:11:19.117Z",
    "costCents": 0,
    "createdAt": "2019-12-27T18:11:19.117Z",
    "deliveryStatus": "pending",
    "durationMs": 0,
    "error": "error",
    "output": "output",
    "startedAt": "2019-12-27T18:11:19.117Z",
    "status": "pending",
    "taskId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "tokensUsed": 0
  }
]