Cost-Only & Revenue-Only Tracking

Most integrations track both provider cost and customer revenue by sending usage with an indicator. Paygent also supports tracking cost only (no billing) or revenue only (no usage payload) when that better matches your product.

Tracking Modes

FeatureCost-OnlyRevenue-Only
Use whenYou need LLM/provider cost visibility without charging the customerYou bill from indicator pricing and do not send token/usage telemetry
SDK method (Python)send_usage() without an indicatorsend_indicator()
Requires usage_dataYes — tokens, model, providerNo
Requires indicatorNo — omit or pass empty stringYes
Writes cp_data (cost table)YesNo
Writes billing_events (revenue table )NoYes
Dashboard analyticsCost metrics onlyRevenue metrics only

Cost-Only (no indicator)

Send usage telemetry with agent_id, customer_id, and usage_data, but leave the indicator empty. Paygent records provider cost in cp_data and does not create billing_events.

Manual tracking (Python)

cost_only_manual.py
1from paygent_sdk import Client, UsageData
2import os
3
4paygent = Client(api_key=os.environ["PAYGENT_API_KEY"])
5
6usage_data = UsageData(
7    service_provider="OpenAI",
8    model="gpt-4o",
9    prompt_tokens=1200,
10    completion_tokens=400,
11    total_tokens=1600,
12)
13
14# No indicator → cost tracking only (no billing_events)
15paygent.send_usage(
16    agent_id="internal-qa-agent",
17    customer_id="acme-corp",
18    usage_data=usage_data,
19)
20
21# Equivalent 3-arg style (indicator position holds usage_data):
22# paygent.send_usage("internal-qa-agent", "acme-corp", usage_data)

Automatic tracking (Python)

With paygent_sdk.init(), omit paygent_indicator on the LLM call. Usage is still captured; revenue billing is skipped.

cost_only_automatic.py
1import paygent_sdk
2from openai import OpenAI
3
4paygent_sdk.init(api_key=os.environ["PAYGENT_API_KEY"])
5client = OpenAI()
6
7response = client.chat.completions.create(
8    model="gpt-4o",
9    messages=[{"role": "user", "content": "Summarize this document"}],
10    paygent_agent_id="doc-summarizer",
11    paygent_customer_id="acme-corp",
12    # paygent_indicator omitted → cost-only
13)

When to use cost-only

  • • Internal agents where you want margin visibility but no customer billing
  • • Shadow / evaluation traffic before you enable priced indicators
  • • Cost observability for free-tier or pilot customers

Revenue-Only (no usage payload)

Use send_indicator() when you want to bill from dashboard indicator pricing without sending tokens, model, or provider usage. Paygent creates billing_events directly and does not write a cp_data row.

revenue_only.py
1from paygent_sdk import Client
2import os
3
4paygent = Client(api_key=os.environ["PAYGENT_API_KEY"])
5
6# Fire-and-forget: customer upsert + revenue event run on a background thread
7paygent.send_indicator(
8    agent_id="sales-agent",
9    customer_id="acme-corp",
10    indicator="meeting-booked",
11    meta_tags={"source": "crm_webhook"}
12    )

Prerequisites

  • • The agent must exist in Paygent and have pricing configured for the indicator
  • agent_id, customer_id, and indicator are all required
  • send_indicator() is available in the Python SDK today

When to use revenue-only

  • • Outcome billing from your app (webhooks, CRM events, human approvals)
  • • Fixed-fee actions where provider token cost is irrelevant or tracked elsewhere
  • • Voice-style indicator billing without attaching LLM usage to the same event

Full tracking (cost + revenue)

This is the default path: send usage with an indicator. Paygent records provider cost and applies your indicator pricing for revenue.

full_tracking.py
1paygent.send_usage(
2    agent_id="support-agent",
3    customer_id="acme-corp",
4    indicator="ticket-resolved",
5    usage_data=usage_data,
6)

What you will see in the dashboard

Agent and customer analytics adapt to the data you send:

  • Cost-only — cost breakdowns and usage; no revenue, profit, or margin cards
  • Revenue-only — revenue breakdowns and indicator totals; no cost or margin cards
  • Both — full profitability view (cost, revenue, net profit, margin)

Mixed environments

An organization can run all three modes at once — for example, internal agents on cost-only, customer-facing agents on full tracking, and CRM webhooks on revenue-only. The UI shows the relevant metrics per agent or customer based on what was actually recorded.

Need help? Contact us at support@withpaygent.com