Usage endpoints let you track and bill metered consumption. Each customer has a credit balance per product — you deduct credits as they use your service, grant credits when they top up, and refund credits when needed. Only works withDocumentation Index
Fetch the complete documentation index at: https://docs.stellartools.dev/llms.txt
Use this file to discover all available pages before exploring further.
metered products.
The credit balance object
Unique identifier for this balance record.
The customer this balance belongs to.
The product this balance is tied to.
Current available credits.
Total credits consumed to date.
Total credits granted to date.
ISO 8601 timestamp.
ISO 8601 timestamp.
Get balance
GET /customers/{customer_id}/credits/{product_id}
Returns the current credit balance for a customer on a given product.
Ingest usage
POST /customers/{customer_id}/credits/{product_id}/transaction
Deduct, refund, or grant credits. Pass dry_run: true to check if the customer has enough credits without committing anything.
Body
Raw usage amount in the product’s native unit (e.g. tokens, requests). Converted to credits automatically based on the product’s
units_per_credit setting.One of
deduct, refund, or grant.If
true, checks credit sufficiency without making any changes. Returns is_sufficient and remaining_balance instead of the normal response.Optional description of why this transaction occurred.
Arbitrary key-value data to attach to the transaction.

