AlgoViz

Streaming, token budgets and cost

medium 7 min

Streaming reveals progress before generation is complete.

Trace the example

Follow the evidence through each stage, then test a change in the case.

One request, three clocks and one bill

One request, three clocks and one bill. Selected component: Input estimate inside Application.
Open full-size diagram

Application

1,200 input tokens

Reserve enough context for the answer. For this example use fictional prices of $2 per million input tokens and $8 per million output tokens.

The connection drops after the first text event. Is the displayed prefix a completed result?

Estimate a completed request

USD 0.0048

Illustrative prices are USD 2 per million input tokens and USD 8 per million output tokens.