Quickstart
Install the package, initialize the agent, and make the first proxied model call.
Proxy Helpers
Review the key flow and patched-client behavior.
Runtime Events
Review the event methods before composing hybrid flows.
Hybrid tracing
- Sync
- Async
Prompt caching-aware usage
cacheReadTokens for tokens served from cache and cacheCreationTokens for tokens written into cache when your runtime exposes those values.
Self-hosted overrides
Event IDs you should understand
| Field | When to set it |
|---|---|
span_id | Use the same value across tool_call_request() and tool_call_response() |
step_id | Set it only if your framework already has stable ordered steps |
parent_step_id | Use it when you want explicit tree structure instead of backend inference |
idempotency_key | Set it when retries or queue replay could submit the same event twice |
Common mistakes
- Calling
trace()methods without stabletrace_idvalues across the same workflow. - Mixing manual
llm_response()events with proxied model responses for the same model turn when you only wanted one representation. - Forgetting to reuse
span_idacross tool request and response events. - Overriding URLs request-by-request instead of setting
proxy_base_urlandanalyse_base_urlonce on theWhyOpsclient.