Usage Service
Usage Facts and Metering Model
Understand the boundary between AI technical usage, Credits accounting, and usage_id.
The usage view combines two independent fact sources:
AIServicestores final technical metering for an AI execution, including tokens, image count, video seconds, and audio seconds.CreditsServicestores applied Credits charges.
A stable usage_id links the facts, but neither is derived from the other. An execution may have technical usage without a charge, and token counts cannot be used to reconstruct Credits.
Daily AI fields
execution_count: AI executions, including failed or cancelled executions without final metering.metered_request_count: requests with trusted final metering.input_tokens,output_tokens,reasoning_tokens, andtotal_tokens: token details returned by the AI service.image_count,video_seconds, andaudio_seconds: media usage.
A stream is finalized only after it succeeds, fails, or is cancelled. If final metering is unavailable, the execution is still counted without inventing token or media values.
Daily Credits fields
The query includes only accounting records where kind = charge, status = applied, and Credits are positive:
used: Credits consumed.charge_count: applied charge count.
Top-ups, refunds, pending transactions, and failed transactions do not appear in the consumption heatmap.