API reference
POST /pricing/estimate-cost
Estimate the processing cost of compressing a given input-token volume at a target ratio.
/api/pricing/estimate-costPublicEstimate processing cost for a given input-token volume and target compression ratio.
Public, unauthenticated endpoint used by the pricing calculator. Given a compression model, a number of input tokens, and a target ratio, it returns the estimated processing cost and how many tokens would survive compression. For your account's actual quotas and per-tier limits, see Rate limits & tiers and GET /billing/tiers.
Request body
compression_modelstringOptional"latte_v1"input_tokensintegerRequiredcompression_rationumberOptional0.5Response
successbooleandataobjectinput_tokensintegerEchoed input volume.
compressed_tokensintegerEstimated token count after compression.
tokens_savedintegerinput_tokens − compressed_tokens.
compression_rationumberEchoed removal fraction (0 to 1).
processing_cost_usdnumberEstimated cost in USD for the compression step alone.
modelstringModel used for the estimate.
input_price_per_1mnumberInput price per 1M tokens at the time of the estimate.
Status codes
200Estimate returned.OK422Field validation failure:Unprocessable Entityinput_tokens <= 0, ratio outside 0 to 1, or unknowncompression_model(thefieldproperty names the offender).429Per-IP rate limit on this public endpoint.Too Many Requests500Internal pricing-service failure.Internal Server Error