How Paygentic Works

Metering built around agents, not seats.

Record what each agent does, keep the cost attached to the customer and workflow that caused it, and send invoices out without maintaining billing code of your own.

The path from action to invoice

Four layers, one responsibility apiece. Your application stays clear of billing logic.

AI App
Your product emits one usage event for each agent action
Paygentic SDK
Three lines of code, then the event is checked and queued
Paygentic API
Deduplication, metering, and rate rules run at scale here
Customer Invoice
The finished invoice reaches Stripe or whichever provider you use

Three handoffs, each one durable

An event passes through intake, metering, and billing output. No stage depends on another staying up.

01

Events arrive

The SDK call reaches the ingest endpoint, where Paygentic attaches an idempotency key, checks the schema, and confirms receipt inside 50ms.

import paygentic

paygentic.event(
  "agent.action",
  quantity=1,
  customer_id="cust_42",
  metadata={"model": "gpt-4o"}
)
02

Meters do the math

Counts build against the meters you configured. Tiered rates, volume discounts, and overage caps are resolved on the server as events come in.

# billing_rule.json
{
  "meter": "agent.action",
  "tiers": [
    {"up_to": 100000, "unit_price": 0.000},
    {"up_to": 5000000, "unit_price": 0.001},
    {"up_to": null, "unit_price": 0.0008}
  ]
}
03

Invoices go out

When the interval closes, Paygentic totals the period and sends a webhook to Stripe, Paddle, or the billing system downstream of you.

# Outbound webhook payload
{
  "event": "invoice.ready",
  "customer_id": "cust_42",
  "period": "2026-09",
  "amount_cents": 4980,
  "events_total": 4980000
}

SDK Integration

A few lines, then you are live

Install the package, add your key, and send a first event. Nothing else is required before metering begins.

  • Python, Node.js, Go, and Ruby SDKs
  • REST API for any language or framework
  • Every event carries an idempotency key by default
# Install
pip install paygentic

# Authenticate
export PAYGENTIC_API_KEY="pk_live_..."

# Fire an event
import paygentic

paygentic.event(
  "agent.action",
  quantity=1,
  customer_id="cust_aiapp_42",
  metadata={
    "model": "gpt-4o",
    "tokens": 2847
  }
)

Multi-Agent Tracing

See where the work and the cost go

Spawned sub-agents inherit the trace of the parent workflow. Paygentic follows that chain and puts each event against the customer who started it, without allocation formulas.

  • Nested trace IDs carried through automatically
  • Cost split by agent for each customer
  • Works with LangChain, CrewAI, and AutoGen
# Orchestrator fires parent event
paygentic.event(
  "workflow.start",
  customer_id="cust_42",
  trace_id="tr_8f2a1b"
)

# Sub-agent references same trace
paygentic.event(
  "agent.action",
  customer_id="cust_42",
  trace_id="tr_8f2a1b",
  metadata={"agent": "summarizer"}
)

Your first event takes minutes.

Add the SDK, send one event, and watch usage appear. There is no billing plumbing to build first.