v1

latestOpenAPI 3.1.02026-08-042453938.9 KB
Charges

Estimate costs from hypothetical usage

Estimate costs from hypothetical usage without creating charges.

Takes a list of usage items (type + quantity) and calculates what they would cost based on your pricing plans. Useful for "what-if" scenarios, budget planning, or previewing costs before usage occurs.

Use cases:

  • Pre-execution cost preview for AI agents
  • Budget planning with different pricing scenarios
  • Customer-facing cost calculators
  • Comparing pricing strategies side by side
post/v1/cost-estimate/hypothetical

Request body

defaultUnitPricestring

Default unit price (USDC) for usage types without a pricing plan

customPricingobject

Custom pricing overrides: usageType → unitPrice. Takes precedence over DB pricing plans.

Example request

{
  "items": [
    {
      "usageType": "api_call",
      "quantity": 10000,
      "unitPriceOverride": "0.005"
    }
  ],
  "defaultUnitPrice": "0.001",
  "customPricing": {
    "api_call": "0.005",
    "token": "0.0001"
  }
}

Response

Cost estimate with line item breakdown

businessIdstring
subtotalUsdcstring
estimatedTotalUsdcstring
currency'USDC'
isEstimatetrue
generatedAtstring date-time
notesstring[]