Skip to content

GET /v1/runs ​

Summary ​

List runs created by the authenticated user. Results are ordered by creation time (newest first) and use cursor-based pagination. You can filter by status and date range.

HTTP Request ​

http
GET /v1/runs?limit=10&status=succeeded&since=1700000000&until=1710000000

Query parameters ​

ParameterTypeRequiredDefaultDescription
limitintegerNo10Number of runs to return. Min 1, max 50.
startingAfterstringNo—Cursor for forward pagination. Returns runs created before this run ID.
endingBeforestringNo—Cursor for backward pagination. Returns runs created after this run ID.
statusstringNo—Filter by run status: queued, running, succeeded, or failed.
sinceintegerNo—Unix timestamp. Only return runs created at or after this time.
untilintegerNo—Unix timestamp. Only return runs created before this time.

WARNING

You cannot use startingAfter and endingBefore in the same request. If since is provided, it must be less than until.

Response ​

Success (200 OK) ​

Returns a JSON object whose status is "SUCCESS" and a data object containing:

FieldTypeDescription
rowsarray of objectsList of runs.
rows[].runIdstringIdentifier of the run.
rows[].promptVersionIdstringIdentifier of the prompt version used.
rows[].outputsarray of objectsOutput items. See Output item types.
rows[].runStatusstringStatus of the run. See Run status.
rows[].creditsinteger | nullCredits consumed. null if the run was free.
rows[].runNamestringDisplay name of the run.
rows[].createdAtstring (ISO 8601)When the run was created.
hasMorebooleantrue if more results are available beyond this page.

Example response ​

json
{
  "status": "SUCCESS",
  "data": {
    "rows": [
      {
        "runId": "01234567-89ab-cdef-0123-456789abcdef",
        "promptVersionId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
        "outputs": [{ "type": "text", "data": "Generated blog post content…" }],
        "runStatus": "succeeded",
        "credits": 150,
        "runName": "Blog post writer",
        "createdAt": "2025-11-03T10:15:30.000Z"
      }
    ],
    "hasMore": false
  }
}

Pagination ​

Use cursor-based pagination to iterate through results:

bash
# First page
curl "https://api.betterprompt.me/v1/runs?limit=10" \
  -H "Authorization: Bearer $BETTERPROMPT_API_KEY"

# Next page — use the last runId from the previous response
curl "https://api.betterprompt.me/v1/runs?limit=10&startingAfter=<LAST_RUN_ID>" \
  -H "Authorization: Bearer $BETTERPROMPT_API_KEY"

Continue paginating until hasMore is false.

Error responses ​

HTTP statusstatus codeDescription
422VALIDATION_ERRORInvalid parameters (e.g. both cursors, invalid UUID).

See also ​