Session Usage
GET
/v1/sessions/{session_id}/usage
const url = 'https://agents.lumalabs.ai/v1/sessions/example/usage';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://agents.lumalabs.ai/v1/sessions/example/usage \ --header 'Authorization: Bearer <token>'What a session and every session it started cost, by stage and by job.
Each stage line carries its credits with the LLM tokens and calls behind
them, and each job line carries its credits and whether they are still an
estimate. total_credits is the session total.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”session_id
required
Session Id
string
Responses
Section titled “ Responses ”Successful Response
Media typeapplication/json
SessionUsageRollup
Payload for GET /v1/sessions/{id}/usage and the BFF mirror.
object
jobs
Jobs
Array<object>
JobUsageWhat one generation dispatch cost.
Deliberately not a job state: GET /v1/sessions/{id}/jobs owns that
answer and derives it from the artifacts, so a second, weaker copy here
would be a drift surface. The two join on job_id.
session_id
required
Session Id
string
stages
Stages
Array<object>
StageUsageRollup line for one stage bucket of a session.
object
cache_creation_input_tokens
Cache Creation Input Tokens
integer
cache_read_input_tokens
Cache Read Input Tokens
integer
credits
required
Credits
integer
event_count
required
Event Count
integer
generation_count
required
Generation Count
integer
input_tokens
required
Input Tokens
integer
llm_call_count
required
Llm Call Count
integer
output_tokens
required
Output Tokens
integer
stage
required
Stage
string
total_credits
required
Total Credits
integer
unresolved_event_count
required
Unresolved Event Count
integer
Example
{ "stages": [ { "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0 } ]}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}