Instrumentation

Overview

Pay-i instrumentation captures your GenAI provider calls and sends cost, token, and latency telemetry to Pay-i. Call payi_instrument() once at application startup. Then use @track or track_context() to add scoped metadata such as use cases, users, and limits.

FunctionPurpose
payi_instrument()Initialize instrumentation at startup and set global defaults
@trackAnnotate a function with metadata such as use_case_name and limit_ids
track_context()Annotate a block of code with runtime values such as user_id and use_case_step

Did this page help you?