This guide shows you how to integrate cost tracking with Signals in your AI product workflow. By linking these two together, you can:
Before you begin, make sure you have:
Note: This feature is currently available in Python and Node.js SDKs.
In a typical AI product workflow, your event processing logic might look like this:
To link AI costs with signals, you need to:
This allows Paid to track your business outcomes and attribute costs accordingly.
The Paid SDK can automatically instrument your AI provider calls so that costs are tracked without any manual bookkeeping. Call initialize_tracing and autoinstrument once at startup, then wrap your business logic in a trace. Supported providers include OpenAI, Anthropic, Gemini, Bedrock, LangChain, OpenAI Agents, and Instructor.
Here’s the recommended pattern for integrating cost tracking with signals using the SDK:
Let’s walk through a complete example of an AI SDR product that processes email replies and sends signals via the SDK.
Most AI products run in an event loop, processing events continuously. Here’s how to integrate signal tracking in that pattern:
Each business outcome should have one signal:
Always include idempotency keys to prevent duplicate signals:
If signals aren’t showing up:
ingested: 1If you’re seeing duplicate signals:
idempotencyKey to your signals{event_type}_{entity_id}_{timestamp})#paid-developers on Slack