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

# Cost optimization

> Prepare measurable cost changes using model selection, context limits, and consistent historical evidence.

Optimize for the cost of a satisfactory outcome. A smaller prompt or cheaper model is useful only if it still meets the task's requirements.

<Note>
  Both [expected LLM usage](/api-reference/agents-platform/calculate-expected-llm-usage) endpoints, including the [agent-specific estimate](/api-reference/agents-platform/calculate-expected-llm-usage-for-an-agent), currently return an unavailable error. Do not use them as price quotes or savings estimates.
</Note>

Begin with a saved configuration, representative scenarios, and any trustworthy historical cost data available in your deployment.

| Configuration choice | Review question |
| - | - |
| `conversation_config.agent.prompt.llm` | Does an available model meet the same task requirements? |
| `conversation_config.agent.prompt.max_tokens` | Is the output limit appropriate for the expected answer? |
| Prompt and knowledge context | Can repeated or irrelevant content be removed? |
| Backup model configuration | Does the comparison account for possible fallback choices? |

<Steps>
  <Step title="Establish a baseline" id="cost-baseline">
    Record the configuration version and [analytics](/agents-platform/monitor/analytics) interval. Keep counts and total cost together; avoid comparing averages from different populations.
  </Step>

  <Step title="Prepare one change" id="cost-prepare-change">
    Use [available models](/api-reference/agents-platform/list-available-llms) and preserve a reviewable draft. Reuse the same [test definitions](/agents-platform/monitor/testing).
  </Step>

  <Step title="Wait for measurable execution" id="cost-measure-change">
    Record savings as unmeasured until comparable runtime results exist. Publication acceptance and lower configured limits do not prove lower total cost.
  </Step>
</Steps>

<AccordionGroup>
  <Accordion title="Does max_tokens cap the full conversation bill?" id="cost-faq-token-cap">No. A generation limit does not account for every request, input token, analysis step, or connected service.</Accordion>
  <Accordion title="Can public workspace usage validate savings?" id="cost-faq-usage">Not currently. That report returns placeholder rows. Use verified deployment data and keep its scope explicit.</Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.