LLM API Selection: Look Past Price per Token — Performance and Throughput Drive the Real Cost

    When teams add LLM capabilities to an application, a common mistake is comparing prices across model generations and concluding that "the new flagship is 2.5x more expensive, so it isn't worth it." That comparison ignores the practical value of a generational jump in model capability, and it also ignores how performance dimensions such as output speed and latency affect overall cost. This article takes a general technical view of how to evaluate LLM API cost efficiency properly, instead of just reading the price tag.

    LLM API Selection: Look Past Price per Token — Performance and Throughput Drive the Real Cost

    When teams add LLM capabilities to an application, a common mistake is comparing prices across model generations and concluding that “the new flagship costs 2.5x more, so it isn’t worth it.” This comparison ignores two things: the practical value delivered by a generational jump in model capability, and the impact of performance dimensions such as output speed and latency on the total cost. This article takes a general technical perspective on how to evaluate LLM API cost efficiency rationally, rather than simply reading the list price.

    1. Why price-per-token comparisons are unreliable

    LLM APIs are typically billed separately for input tokens and output tokens, so the unit price is the most obvious metric — but it is only the “cost on paper.” Actual spend also depends on three frequently overlooked factors:

    • Total tokens needed to complete the task: Stronger models often finish a task in fewer reasoning steps and with more concise output, so the tokens actually consumed can be lower.
    • Output speed (throughput): For the same task, slower output means longer waits for users, and the gap is dramatically amplified in long-form scenarios.
    • Concurrency and queuing cost: A model with insufficient throughput queues requests under high concurrency, which indirectly raises the engineering cost of scaling out and fault tolerance.

    So “is it expensive?” has to be measured against a concrete workload. Comparing unit prices in isolation is close to meaningless.

    2. Model tiers: different positions solve different problems

    Mainstream platforms usually offer a tiered model lineup that can be roughly divided into three groups:

    Tier Typical positioning Suitable use cases
    Flagship Best possible reasoning and generation quality Complex reasoning, code generation, long-form writing
    Standard Balanced quality and cost Everyday conversation, content generation, general Q&A
    Lightweight Low latency, high throughput, low cost Intent detection, classification and extraction, high-concurrency short interactions

    The key point is that the tiers are not a simple old-versus-new replacement — they represent differentiated capability boundaries. Running a task that a lightweight model should handle on a flagship model wastes money; forcing a lightweight model to handle complex reasoning causes quality collapse and repeated retries, which is equally a hidden waste.

    3. The two core performance metrics: latency and throughput

    Many people focus only on generation quality and overlook how directly performance affects both user experience and cost.

    Time to first token (TTFT): the time from sending the request to receiving the first token. It determines how responsive an interaction feels, and it matters especially in interactive and agent-style tool-calling chains — when steps are chained together over multiple rounds, latency accumulates and compounds.

    Output throughput (tokens/s): the number of tokens generated per unit of time. It directly determines how long long-form tasks take to finish. For example, consider a task that needs to output 2,000 tokens:

    1. Model A (high throughput): ~80 tokens/s → about 25 seconds
    2. Model B (low throughput): ~20 tokens/s → about 100 seconds

    If the two models have similar unit prices but differ 4x in throughput, user experience and concurrency capacity differ enormously. In a high-concurrency production service, low throughput means each request holds a connection longer, the number of concurrent requests the same fleet of machines can serve drops sharply, and scaling costs climb accordingly. This is why a model with faster output can end up cheaper overall, even at a slightly higher unit price.

    4. Building a reproducible cost-evaluation framework

    For a rational decision, run a benchmark over a shared evaluation set rather than relying on vendor marketing claims or one-off experiences.

    1. import time
    2. def benchmark(client, model_id, prompts):
    3. total_in = total_out = 0
    4. ttft_samples, tps_samples = [], []
    5. for prompt in prompts:
    6. start = time.perf_counter()
    7. first_token_time = None
    8. out_tokens = 0
    9. # Consume the response as a stream so first-token latency and throughput can be measured accurately
    10. stream = client.chat.completions.create(
    11. model=model_id,
    12. messages=[{"role": "user", "content": prompt}],
    13. stream=True,
    14. )
    15. for chunk in stream:
    16. if first_token_time is None:
    17. first_token_time = time.perf_counter() - start
    18. out_tokens += count_tokens(chunk)
    19. elapsed = time.perf_counter() - start
    20. if first_token_time is not None:
    21. ttft_samples.append(first_token_time)
    22. tps_samples.append(out_tokens / elapsed if elapsed else 0)
    23. total_out += out_tokens
    24. return {
    25. "avg_ttft_s": sum(ttft_samples) / len(ttft_samples),
    26. "avg_tokens_per_s": sum(tps_samples) / len(tps_samples),
    27. "avg_output_tokens": total_out / len(prompts),
    28. }

    The evaluation should cover at least:

    1. Task success rate and quality: measure whether the output meets the bar using real business samples — this is the denominator of cost efficiency.
    2. Average output tokens: more capable models often produce more concise output, which offsets their unit-price disadvantage.
    3. Time to first token and throughput: translate directly into user experience and concurrency capacity.
    4. Blended unit cost: use total cost / successfully completed tasks as the final metric, not the unit price.

    5. Engineering practice: tiered routing and cascading

    The mature approach is not “bet the whole product on one model” but dynamic routing based on task complexity:

    • Lightweight first, flagship second (cascading): handle requests with the low-cost lightweight model, and escalate to a stronger flagship model for a retry only when confidence is insufficient or quality falls short. Most simple requests are absorbed by the lightweight model, and only complex ones pay the flagship price.
    • Route by scenario: send intent detection and structured extraction to lightweight models; send complex reasoning and high-quality generation to flagship or standard models.
    • Caching and batching: cache results for frequent repeated requests, and use throughput-first configurations for offline batch jobs to cut cost further.
    1. def route_and_run(client, prompt, lite_model, flagship_model):
    2. # Layer 1: handle the request quickly with the lightweight model
    3. lite_result = client.chat.completions.create(
    4. model=lite_model,
    5. messages=[{"role": "user", "content": prompt}],
    6. )
    7. if is_confident(lite_result): # custom confidence check
    8. return lite_result
    9. # Layer 2: escalate to the flagship model only when quality is insufficient
    10. return client.chat.completions.create(
    11. model=flagship_model,
    12. messages=[{"role": "user", "content": prompt}],
    13. )

    6. Conclusion

    Back to the original question — “the new flagship generation costs more, so is it expensive?” The answer depends on which costs you include in the calculation. Looking only at the price sheet can lead to the wrong conclusion; but once you factor in task completion quality, actual token consumption, output throughput, and concurrency cost, a more capable model often turns out to be better value under real workloads.

    Three principles for rational selection: let a shared evaluation set do the talking, measure blended cost per completed task rather than unit price, and use tiered routing so that expensive capability is spent where it matters. Whether you choose a general-purpose model service from a cloud provider, or assemble a full application pipeline with infrastructure such as object storage, message queues, logging, and monitoring and alerting, this evaluation methodology applies. In technical selection there is no absolute “expensive” or “cheap” — only “does it match your workload.”