# Cost per request

> Cost per request: What one request costs end to end: input tokens × input price + output tokens × output price for an API, or machine time × hourly price…

Canonical: https://llmdojo.dev/glossary/cost-per-request

What one request costs end to end: input tokens × input price + output tokens × output price for an API, or machine time × hourly price when self-hosting. Comparable across models with different tokenizers, unlike a price per token.

Learn it in the lesson: [Two prices per request](https://llmdojo.dev/learn/inference-optimization/cost-per-request/two-prices) (Inference and Model Optimization · Cost per Request and per Useful Answer).

## Interview questions about Cost per request

- [You're deciding between a model API and self-hosting. How do you find the break-even, and what does the simple calculation leave out?](https://llmdojo.dev/interview/q/you-re-deciding-between-a-model-api-and-self-hosting-how-do)
- [When do you send inference to a fast model and when to a cheap one? Walk me through the cost and latency trade-offs.](https://llmdojo.dev/interview/q/when-do-you-send-inference-to-a-fast-model-and-when-to)
- [A provider's status page shows a p50 TTFT of 180 ms. You need 300 ms for 9 in 10 of your users. What do you do before signing up?](https://llmdojo.dev/interview/q/a-provider-s-status-page-shows-a-p50-ttft-of-180-ms)

## Related
- [Batch API](https://llmdojo.dev/glossary/batch-api)
- [Utilization](https://llmdojo.dev/glossary/utilization)
- [Cost per useful answer](https://llmdojo.dev/glossary/cost-per-useful-answer)
- [Glossary of every term](https://llmdojo.dev/glossary)
