> ## Documentation Index
> Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost

> Track and evaluate token costs to keep your prompts within budget

The Cost evaluator calculates the cost of each prompt response based on actual token usage returned by the LLM provider and its public pricing. Use it to monitor spending, enforce budget thresholds, and optimize prompts for cost efficiency.

Adaline automatically calculates costs using the token usage reported by the AI provider. Internally, Adaline maintains the public pricing for each model and uses that to compute the cost per response.

<Warning>
  Cost evaluators are not supported for some AI providers (such as OpenRouter, TogetherAI, Custom, etc.) where available models are set by the user.
</Warning>

<Note>
  Want to use custom pricing for your models? Reach out to us at [support@adaline.ai](mailto:support@adaline.ai) to set up a private preview.
</Note>

## Set up the Cost evaluator

<Steps>
  <Step title="Open Evaluate from your prompt">
    Open the prompt you want to test and click **Evaluate** in the prompt header.

    <img src="https://mintcdn.com/adaline/6qZ1-Sm8NeEttI_w/images/evaluate/open-evaluate-tab.png?fit=max&auto=format&n=6qZ1-Sm8NeEttI_w&q=85&s=8a70c493b8cafd7a141b0220eff30640" alt="Opening the Evaluate tab from a prompt" title="Opening the Evaluate tab from a prompt" style={{ width: "100%" }} width="3456" height="1839" data-path="images/evaluate/open-evaluate-tab.png" />
  </Step>

  <Step title="Select the evaluator">
    Add the Cost evaluator from the evaluator menu.

    <img src="https://mintcdn.com/adaline/6qZ1-Sm8NeEttI_w/images/evaluate/add-cost-evaluator.png?fit=max&auto=format&n=6qZ1-Sm8NeEttI_w&q=85&s=38e81c6547c248a5b42c3708ec0791cb" alt="Selecting the Cost evaluator" title="Selecting the Cost evaluator" style={{ width: "100%" }} width="1275" height="775" data-path="images/evaluate/add-cost-evaluator.png" />
  </Step>

  <Step title="Configure the threshold">
    Give the evaluator a name, link a dataset, and set the cost threshold that determines pass/fail.

    <img src="https://mintcdn.com/adaline/Um_T8BffW4hfcoYD/images/evaluate/link-dataset-cost.png?fit=max&auto=format&n=Um_T8BffW4hfcoYD&q=85&s=9af411b06472a58ad1f546b941f6d764" alt="Configuring the Cost evaluator threshold" title="Configuring the Cost evaluator threshold" style={{ width: "100%" }} width="792" height="201" data-path="images/evaluate/link-dataset-cost.png" />

    Choose from the following threshold operators:

    | Operator         | Behavior                                                                                                                     |
    | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- |
    | **less than**    | The response passes if its cost is below your threshold. Use this to enforce budget caps.                                    |
    | **greater than** | The response passes if its cost exceeds your threshold. Use this to flag unusually cheap (potentially incomplete) responses. |
    | **equal to**     | The response passes if its cost matches the exact threshold.                                                                 |
  </Step>

  <Step title="Run the evaluation">
    Click **Evaluate** to execute the evaluation and see the results.

    <img src="https://mintcdn.com/adaline/Um_T8BffW4hfcoYD/images/evaluate/cost-results.png?fit=max&auto=format&n=Um_T8BffW4hfcoYD&q=85&s=717981844afe25e86e8c56c13ffc9e48" alt="Cost evaluator results" title="Cost evaluator results" style={{ width: "100%" }} width="1490" height="428" data-path="images/evaluate/cost-results.png" />
  </Step>
</Steps>

<Note>
  **Prompt chaining**: When your prompt uses [prompt variables](/docs/iterate/use-other-prompts-in-prompt) (child prompts), the Cost evaluator reports the **cumulative cost** of the entire prompt chain — including the parent prompt and all child prompts executed during the evaluation.
</Note>

## When to use

* **Budget enforcement** — Set a maximum cost per response to prevent runaway spending.
* **Model comparison** — Compare cost efficiency across different models handling the same test cases.
* **Prompt optimization** — Identify prompts that are more expensive than expected and refine them to reduce token usage.
* **Cost forecasting** — Use evaluation results to estimate production costs at scale.

## Next steps

<CardGroup cols={2}>
  <Card title="Latency Evaluator" icon="timer" href="/docs/evaluate/latency">
    Measure response time alongside cost.
  </Card>

  <Card title="Response Length" icon="ruler" href="/docs/evaluate/response-length">
    Control output size to manage costs.
  </Card>
</CardGroup>
