Usage tracking
Every model call costs tokens. See how the SDK counts requests and tokens for a run, how to read the numbers per request, why each run in a session has its own count, and what a checkpoint does with usage.
9 minPro
Checking your access…
Inside this lesson
- An animation you play, pause and step through, with each part saying what it is doing.
- The real code beside it, with the lines for each step lit up.
- Practice mode, where you route each message yourself, and a short quiz.
- About 9 minutes.
Written from the official documentation
In this module: Observe, test and ship
- TracingSee every step of a run.Pro
- Custom traces, spans and processorsGroup runs in one trace, hide sensitive data and export elsewhere.Pro
- Usage trackingCount requests and tokens per run, per request and per session.Pro
- Testing without provider callsScripted models for agents, sandbox, realtime and voice tests.Pro