Skip to navigation

Retrieve a run

Revenue, model cost and margin for one run, built from the events and costs that carry its run_id. Prepaid credits are valued at the cost basis of the grants they were drawn from. has_margin says whether the run has a margin: a confirmed charge and a traced cost. When it is false, margin and margin_percent are null, and the revenue and cost fields still show what is known.

Authentication

AuthorizationBearer

A secret key (rl_sk_test_..., rl_sk_live_...) or a restricted key with limited scopes (rl_rk_test_..., rl_rk_live_...). A restricted key can carry agent: true and an expires_at, and is what a coding agent should hold. Keys end in a checksum so secret scanners can recognize them. People create, roll and revoke keys in the dashboard; GET /v1/api_keys lists them, masked.

Path parameters

run_idstringRequired
The run ID you sent on events and costs.

Response

The run summary.
object"run"
run_idstring
currencystring
revenue_confirmedstring
Decimal minor units. "0" when the run has no confirmed charge.
revenue_pendingstring
Decimal minor units.
revenue_reversedstring
Decimal minor units.
coststring
Decimal minor units. "0" when no cost was traced.
has_marginboolean

true when the run has at least one confirmed charge and at least one traced cost (costs_count above zero). It is what the has_margin filter selects on.

marginstring or null

Decimal minor units: revenue_confirmed minus cost. null when has_margin is false. It can be negative, a loss.

margin_percentstring or null

margin as a share of confirmed revenue. null when has_margin is false. The share is negative for a loss, and can be below -1.

events_countinteger
costs_countinteger
first_seen_atdatetime
last_seen_atdatetime
livemodeboolean
customerstringOptional
agent_idslist of stringsOptional

Errors

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