Get Runs Spend
What each listed run paid, priced from the ledger at read time. Not filtered by who may read the run: the spend dashboard already shows everyone’s, and this is the same figure per run.
GET
/api/v1/runs/spendAuthorization
AuthorizationBearer token · headerrequiredor
AuthorizationOAuth2 access token · headerrequiredQuery parameters
idsstring[]requiredThe runs a list is showing
max items 100
Responses
200Successful Response
successbooleandefault: true
dataRunsSpend | anyShow propertiesHide properties
Any of:
RunsSpend
runsobjectrequiredany
anymessagestring | anyShow propertiesHide properties
Any of:
string
stringany
anyerrorsstring[] | anyShow propertiesHide properties
Any of:
string[]
Array of
stringstringany
any422Validation Error
detailValidationError[]Show propertiesHide properties
Array of
ValidationErrorlocstring | integer[]requiredShow propertiesHide properties
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequiredtypestringrequiredinputanyctxobjectRequest
curl -X GET "/api/v1/runs/spend?ids=string" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("/api/v1/runs/spend?ids=string", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});import requests
response = requests.get(
"/api/v1/runs/spend?ids=string",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)Response
{
"success": true,
"data": {
"runs": {
"property1": {
"usd": 0,
"credits": 0,
"calls": 0,
"unpriced_calls": 0
},
"property2": {
"usd": 0,
"credits": 0,
"calls": 0,
"unpriced_calls": 0
}
}
},
"message": "string",
"errors": [
"string"
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}