Documentation

Integrate event-level metering and usage-based billing into your AI product. Built for developers shipping agentic workflows at scale.

Welcome to Paygentic

Paygentic is an AI-native event metering and billing platform. You send usage events from your agent workflows, we handle deduplication, aggregation, and billing period math. Your customers get accurate invoices and real-time spend visibility.

This documentation covers everything from a five-minute integration to multi-agent attribution patterns at scale.

How it works

The integration has three parts:

  1. Send events from your AI workflows using the Paygentic SDK or REST API. Every action your agents take that you want to bill for becomes an event.
  2. Define meters that aggregate events into usage totals. A meter maps event types to a billable quantity.
  3. Attach pricing to meters. Paygentic handles invoice generation, overage calculation, and Stripe passthrough.

Quick start paths

Key concepts

Events

An event is a single billable action from your agent, such as a model call, a tool execution, or a document processed. Events carry an idempotency key, a customer ID, and a payload of dimensions your meters can filter on.

Meters

A meter aggregates events into a running count or sum for a billing period. You define which event types feed a meter and which payload fields to sum or count. Multiple meters can consume the same event stream with different aggregation rules.

Multi-agent attribution

When an orchestrator spawns sub-agents, Paygentic traces cost back through the call graph using a trace_id on each event. This lets you report per-workflow costs even when individual agents share a model provider account.

Authentication

All API requests use bearer token authentication. Your API key is available in the dashboard under Settings > API Keys. Pass it as the Authorization header:

Authorization: Bearer pyg_live_xxxxxxxxxxxxxxxxxxxxxx

Use test-mode keys (pyg_test_ prefix) for local development. Test events never affect invoice totals.

Environments

Environment Base URL Key prefix Invoice impact
Live https://api.getpaygentic.org/v1 pyg_live_ Yes
Test https://api.getpaygentic.org/v1 pyg_test_ No

Rate limits

The event ingestion endpoint accepts up to 1,000 events per second per account by default. Batch ingestion (up to 500 events per request) is recommended for agent workloads that generate bursts of events. Contact support to raise limits for higher-volume deployments.

Support

For questions not covered here, reach us at [email protected] or open a thread in the developer community on Discord.