Set Model PricesBeta
Set your own price for a model to change how Haystack Enterprise Platform calculates LLM costs, for example when you negotiated a rate or use a model without a public price.
About This Task
We calculate costs from the tokens a model used and the model's price. A custom price replaces the model's default price, either in all workspaces or in one workspace. A workspace price takes precedence over a price for all workspaces. One price applies at a time: a new price ends the one that's running when the new one starts.
You must be an Organization Admin to set model prices.
Add a Price
- In Haystack Enterprise Platform, go to the Cost Management page, where you can see the LLM costs calculated from your token usage.
- Click Custom prices, then click Add price.
- In Model, enter the model name exactly as it appears on your calls, or pick one from your usage.
- In Provider, enter the lower-case provider ID, for example
anthropicoropenai. The provider decides how cached tokens are billed. - Under Applies to, choose All workspaces or One workspace. If you choose one workspace, select it.
- Enter the Input price and the Output price in dollars per million tokens. Enter 0 for a model that's free.
- Under Starts, choose when the price starts:
- From the beginning recalculates all past usage of the model.
- Today keeps the cost of calls made before today.
- On a date starts the price on that date. If the date is in the past, usage from that date is recalculated.
- Optional: In Ends, pick the last day the price applies. After that day, the default price applies.
- Optional: Set cache prices. For details, see Set Cache Prices.
- Click Save price. If the new price ends a price that's running, we ask you to confirm first.
Result: The price appears in the list. Costs are updated, which usually takes about a minute.
Set Cache Prices
Some models support prompt caching and have separate prices for cached tokens. Set cache prices so cached tokens are billed at your rate for them instead of falling back to the input price. To set them, expand Advanced in the price form:
- Cache read price: The price of tokens served from the prompt cache.
- Cache write price: The price of tokens newly written to the prompt cache.
- 1-hour cache write price: The price of cache writes kept for 1 hour instead of 5 minutes (Anthropic).
If you leave a field empty, the price falls back to another one:
| Field | When empty, tokens are billed at |
|---|---|
| Cache read price | The input price |
| Cache write price | The input price |
| 1-hour cache write price | The cache write price, or the input price if that's empty too |
An empty field isn't the same as 0. Enter 0 to make those tokens free.
You can also set these prices through the API. The 1-hour cache write price is the cache_write_1h_price_per_1k_tokens field, priced per 1,000 tokens.
For providers that count cached tokens as part of the prompt, such as Anthropic and OpenAI, cache reads and writes are taken out of the prompt tokens before the input price applies. This way, cached tokens aren't counted twice.
Edit or Delete a Price
- Go to the Cost Management page and click Custom prices.
- To see prices that have ended, click Show ended prices.
- In the price's row, choose Edit or Delete.
You can't change Applies to on an existing price. To change it, delete the price and add it again. When you delete a price, usage in that period is recalculated with the default price.
Related Information
Was this page helpful?