v1
latestOpenAPI 3.1.02026-08-042453938.9 KBCharges
Estimate costs from existing usage
Estimate costs from existing usage events without creating charges.
Queries usage events in the specified period and calculates what they would cost based on pricing plans. Supports custom pricing overrides for "what-if" scenarios.
Use cases:
- Budget planning and forecasting
- Cost allocation previews
- Retroactive pricing analysis
- Comparing pricing strategies
The response includes per-usage-type line items with quantity, unit price, and estimated cost. Notes indicate which usage types used custom pricing, default pricing, or had no pricing plan available.
post/v1/cost-estimate/from-usage
Request body
Example request
{
"periodStart": "2024-01-01T00:00:00.000Z",
"periodEnd": "2024-01-31T23:59:59.999Z",
"defaultUnitPrice": "0.001",
"customPricing": {
"api_call": "0.005",
"token": "0.0001"
}
}Response
Cost estimate with line item breakdown