Cost traces
Prerequisites
- Have your API key ready.
- [Optional] Configure Customers and Products with external ids. Or programmatically via API endpoints: Create product, Create customer.
Capture your AI call
To capture the AI call, there are 2 steps:
- Let Paid autoinstrument your AI libraries at the initialization of your application (preferably in the main thread).
- Wrap your AI call in the Paid tracing context. Whether they’re wrapped directly or somewhere down the stack does not matter.
- If the AI call is not wrapped, the cost trace is still recorded, though unattributed to a customer or product.