Skip to navigation

List workflow run credits

Lists the credits that the customer’s workflow runs spent between startsAt (included) and endsAt (excluded), day by day in timezone: each item is one day, newest first, with each run that spent credits that day, newest spend first. Filter by workflow or by creditCurrencies. The first and the last day count only the credits inside the period. {customer} takes the customer’s cus_ ID, your externalId, or one of its aliases.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Path parameters

customerstringRequired1-255 characters

The customer: its cus_ ID, your externalId, or one of its aliases.

Headers

Paid-BetaenumRequired

This endpoint is in the workflows=v1 beta. Send this header to use it.

Allowed values:

Query parameters

startsAtdatetimeRequired

The start of the period, included: any ISO 8601 timestamp. The first day counts only the credits from this time.

timezonestringRequired

The IANA time zone, such as Europe/Paris, that cuts the period into days.

creditCurrencieslist of stringsOptional

Only these credit currencies, by key, such as science_tokens: repeat it for several, up to 100. Leave it out for every currency. An empty value is invalid_request, and a key the account doesn’t have is reference_not_found.

cursorstringOptional

The nextCursor of the previous page. Omit it for the first page.

endsAtdatetimeOptional

The end of the period, excluded: any ISO 8601 timestamp after startsAt. Defaults to now. The last day counts only the credits before this time.

limitintegerOptional1-100Defaults to 10
How many runs to return, 1 to 100, across the days of the page. Defaults to 10.
workflowstringOptional1-255 characters

Only the runs of this workflow, by its wf_ ID. Leave it out for every workflow.

Response

200
objectenum

The type of object. Always list.

Allowed values:
asOfdatetime

When the first page of the list was read. Without endsAt, every page of the list ends at this time.

datalist of objects
The days on this page, newest first.
hasMoreboolean
Whether another page follows this one.
nextCursorstring or null

Send it as cursor to get the next page. Null on the last page.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error