Credits
Introduction
Credits let you offer prepaid balances to customers. Instead of billing purely on usage after the fact, you can sell credit bundles upfront and deduct from them as your AI agents perform work.
A typical credits workflow:
- Create credit currencies to represent different unit types (e.g., “API Credits”, “Compute Hours”)
- Attach credit benefits to products so that orders grant credits to customers
- Query balances via the API to enforce limits or display remaining credits in your app
Prerequisites
- A Paid API key and the Paid SDK installed in the service that checks balances or sends signals.
- A credit currency configured in Settings > Credit currencies.
- A product or plan with a credit benefit, plus an active order or checkout-completed purchase that grants credits to the customer.
- Signals that match the product’s credit-backed pricing rule if you want Paid to deduct credits automatically.
Core Concepts
Credit Currencies
A credit currency defines a unit of value. Each organization can have multiple currencies for different billing dimensions.
Credit Balances
A balance represents how many credits a customer has for a given currency. Balances are grouped by:
- Currency: which credit currency the balance is for
- Recipient: whether credits belong to the
organization(shared across all users) or a specificseat
Each balance includes:
Querying Credit Balances
Use the API to check a customer’s current credit balances. This is useful for:
- Enforcing credit limits before performing work
- Displaying remaining balances in your app
- Building low-balance alerts
Node.js
Python
cURL
Response
The customer ID parameter accepts both display IDs (
cus_xxx) and UUIDs.
Listing Credit Currencies
Retrieve all credit currencies configured for your organization:
Node.js
Python
cURL
To include archived currencies, pass includeArchived=true:
Example: Enforcing Credit Limits
A common pattern is to check a customer’s credit balance before performing work:
Dynamic Credit Consumption
By default, each signal deducts the fixed credit cost defined in your product’s pricing rule. To consume a variable number of credits per signal, configure your pricing rule with a quantity mapping that reads from signal data, then pass the quantity value in each signal.
With a quantity mapping configured, the credit deduction becomes quantity x creditCost. If the credit cost is 1 and the signal sends quantity: 5, that signal deducts 5 credits. Without the mapping, every signal deducts the fixed credit cost regardless of what you send in data.
This is useful when different actions consume different amounts of credit. For example, a simple query might cost 1 credit while a complex multi-step workflow costs 10.
See First signals for full examples in all SDKs and How credit balances work for the complete set of consumption strategies.
Setting Up Credits
To configure credits for your organization:
- Navigate to Settings in the Paid dashboard
- Create a credit currency with a name and key
- Add credit benefits to a product’s pricing configuration
- Create an order for a customer. Credits are granted when the order activates
Once credits are granted, you can query balances via the API as shown above.