1. Install the SDK
agentmeter-ai, but the runtime import is agentmeter.
2. Create a telemetry API key
Sign in to the AgentMeter dashboard and create a telemetry-scoped API key. Store the plaintext key asAGENTMETER_API_KEY in your runtime secret store. The key is shown once.
3. Initialize the SDK
TypeScript
Python
https://api.agentmeter.com. Self-hosted deployments can pass an endpoint override.
4. Attribute calls to a customer and step
TypeScript
Python
5. Check the dashboard
After events arrive, use the dashboard to review:- Total cost and cost by customer.
- Expensive agent steps.
- Unknown pricing tasks that need a pricing rule.
- Rule events, warnings, and alerts.
Production checklist
- Use opaque
customer_idvalues. - Use stable
step_namelabels such asretrieve_context,evaluate, orsummarize. - Do not send prompts, completions, emails, phone numbers, or raw messages in telemetry metadata.
- Configure pricing for any non-LLM metrics before relying on margin reports.