API Reference — Postpaid Wallets
API Reference — Postpaid Wallets
Check accrued postpaid usage and report billable events. Endpoints live on the Control Plane API at https://cp-api.withpaygent.com and authenticate with your paygent-api-key header.
Prerequisites
Postpaid wallets are created in the dashboard only (Customer → Wallet → Postpaid). The agent indicator must use CREDITS billing with the same credit currency as the wallet. See Credits & Wallets.
Authentication
API key in header only
Pass paygent-api-key as an HTTP header, not as a query parameter.
Get postpaid accrual
GET /api/v1/wallet/balance returns all wallets for a customer. For postpaid wallets, use postpaid_used and postpaid_limit only—do not use available (it stays 0).
Example response (postpaid)
Postpaid response fields
Send usage (accrue postpaid)
POST /api/v2/usage reports usage and accrues credits on the postpaid wallet when the indicator is priced in CREDITS. Processing is async via Kafka; balance updates within a few seconds.
Alternatively use the Python SDK: client.send_usage(agent_id, customer_id, indicator, usage_data). For local testing, set client.base_url to your Control Plane host.
Postpaid integration flow
GET /api/v1/wallet/balance— readpostpaid_usedandpostpaid_limit.- If under the limit (or limit is 0), perform the LLM / API work.
POST /api/v2/usage— accrue usage on the postpaid wallet.- Customer is invoiced at period end;
postpaid_usedresets to 0.
Not supported via API
Postpaid wallet creation and top-up are not available on the public API. Use the dashboard to create postpaid wallets.
Prepaid wallets: Prepaid Wallets API
