LLM Inference Cost per Task Calculator

The LLM Inference Cost per Task Calculator estimates the variable and fixed cost of one successful inference task. It prices input and output tokens separately, adds any per-attempt infrastructure or platform charge, and adjusts for the share of attempts that actually complete successfully.

This task-level view is useful for unit economics, feature pricing, model routing, and cost regression checks. Enter the prices that apply to your deployment and billing arrangement; providers may use different rates for cached input, priority service, batch jobs, or long-context tiers. The success-rate adjustment assumes failed attempts incur the same average cost as other attempts, so separate failure classes when they consume materially different token volumes.

Token pricing assumptions

tokens
tokens
USD
USD
USD
%
Result
cost per successful task
Raw cost per attempt
Input token cost
Output token cost
Cost per 1,000 successful tasks

1. Enter token usage
Use average input and output tokens for one attempt.

2. Add token prices
Enter the price per one million tokens for each token class.

3. Include fixed cost
Add per-attempt costs such as orchestration, retrieval, moderation, or allocated infrastructure.

4. Set success rate
Enter the percentage of attempts that produce a usable completed task.

5. Review unit cost
The main result divides expected cost per attempt by the success probability.

6. Scale the result
Use the cost per 1,000 successful tasks for feature or volume planning.

Input cost = Input tokens ÷ 1,000,000 × Input price Output cost = Output tokens ÷ 1,000,000 × Output price Raw cost per attempt = Input cost + Output cost + Fixed cost Cost per successful task = Raw cost per attempt ÷ Success rate

What the result means

The main result is the expected cost needed to obtain one successful task, including the entered failure rate.

Estimates depend on the model, serving stack, hardware, quantization, batching strategy, and workload mix. Validate the result with measurements from your own environment before committing capacity or budget.

Given

  • 1,800 input tokens
  • 420 output tokens
  • $1.50 per 1M input tokens
  • $6.00 per 1M output tokens
  • $0.0008 fixed cost per attempt
  • 97% success rate

Calculation

Input = 1,800 ÷ 1,000,000 × $1.50 = $0.0027. Output = 420 ÷ 1,000,000 × $6.00 = $0.00252. Raw = $0.00602. Successful task cost = $0.00602 ÷ 0.97 = $0.006206.

Result

$0.006206 per successful task, or about $6.21 per 1,000.

The success adjustment adds the expected cost of unsuccessful attempts to the usable-task unit cost.

Where should retrieval or embedding costs go?

Add stable per-task amounts to fixed cost. For better detail, calculate them separately and enter their combined expected value.

How do cached input discounts affect the result?

Split cached and uncached input into separate calculations or replace the input price with a weighted average based on measured cache hit rate.

Why divide by success rate?

When only a fraction of paid attempts produces usable output, more than one attempt is needed on average for each success. Dividing by the success probability allocates that extra spend.

Can I use this for self-hosted models?

Yes. Convert GPU, CPU, memory, network, and operations expense into an expected cost per attempt, then enter that amount as fixed cost while setting token prices to zero if appropriate.

How is cost per task different from cost per request?

A task may include retries, multiple model calls, or supporting services. This calculator can represent that full workflow when all expected components are included.