Chapter C98 · Interactive Course

Use it: read your own request receipt

Split the time, attribute the cost, find the reuse, total the task.

Start chapter in web app

Core Learning Concept

Inspect request receipts carefully to pinpoint true bottlenecks and real expenses instead of guessing. Break down processing phases, audit caching eligibility, and tally full retry costs to discover genuine practical optimizations.

What You’ll Learn in This Chapter

  1. Where the time went

    Activity 1 of 7 · 4 min

    Distinguish input processing, generation, and other sources of waiting.

    Break latency into recorded phases such as queuing, input processing, generation, tool work, and network delivery. Time to first token can combine several of them. Locate the measured bottleneck before proposing a fix. A short output can still follow a long wait for reasons unrelated to output length.

    Start activity →

  2. What you paid for

    Activity 2 of 7 · 4 min

    Attribute cost to input, output and repeated attempts.

    Usage charges depend on the provider’s units and rates, including input, output, cached input, and any tool fees. Count all attempts. Which category dominates varies by task and pricing, so calculate from the receipt instead of assuming input or output is always the cheapest place to optimize.

    Start activity →

  3. Check whether repeated input can be reused

    Activity 3 of 7 · 4 min

    Identify a repeated prefix worth caching.

    Reuse can save work when the system supports caching and the repeated material satisfies its rules. A stable common prefix may help, but eligibility and pricing are provider-specific. Confirm actual cache hits in the receipt and compare total cost; arranging a prompt alone does not prove a saving.

    Start activity →

  4. Long context has a price

    Activity 4 of 7 · 5 min

    Relate context length to time and cost.

    Long context can increase processing and memory costs and may make relevant information harder to use effectively. The impact depends on the model and task. Supply the material needed to answer and preserve exceptions, then test whether a focused excerpt improves the measured result without removing essential evidence.

    Start activity →

  5. Budget the whole task, not one call

    Activity 5 of 7 · 4 min

    Total a multi-step task honestly.

    A complete task frequently demands multiple API calls, retries, and tool lookups. Calculate total expenditure per completed task rather than per isolated request, ensuring comparison between methods maintains identical final output standards.

    Start activity →

  6. Apply it: read your own request receipt

    Activity 6 of 7 · 7 min

    Carry out the whole decision once: split the time, attribute the cost, find the reusable prefix and total the task.

    Start activity →

  7. Explain a conversation failure

    Activity 7 of 7 · 6 min

    Trace a supplied request through context, generation and delivery, and identify where a missing instruction and a cut-off answer arose.

    Start activity →