OpenRouterModelPricing¶
This docs was updated at: 2026-02-23
com.paragon.responses.openrouter.OpenRouterModelPricing ยท Record
Pricing information for an OpenRouter model.
Prices are in USD per token. The OpenRouter API returns these as strings to handle arbitrary precision.
Methods¶
calculateCost¶
Calculates the total cost for a request given token counts.
Parameters
| Name | Description |
|---|---|
inputTokens |
number of input/prompt tokens |
outputTokens |
number of output/completion tokens |
Returns
total cost in USD, or null if pricing data is invalid
promptAsBigDecimal¶
Returns the prompt cost as a BigDecimal.
completionAsBigDecimal¶
Returns the completion cost as a BigDecimal.