← Back to article

Equation 6 · Actually Building with the Grok API

What does this equation mean?

Cost(ni,no)={ni piL+no poL,ni<Tni piH+no poH,ni≥T\text{Cost}(n_i, n_o) = \begin{cases} n_i\, p_i^{L} + n_o\, p_o^{L}, & n_i < T \\ n_i\, p_i^{H} + n_o\, p_o^{H}, & n_i \geq T \end{cases}

Read the formula alongside the article passage below. Each part has a deeper page with its role in the equation, the supporting passage and nearby citations.

This equation states a bound: one expression must stay on the indicated side of the other under the article’s assumptions. Read the equation part by part below; each part has a contextual explanation and a link to its mathematical background.

Read it piece by piece

nin_i

Symbol n_i

nin_i is an argument of the function-like quantity on the left; its role is set by that function’s stated inputs.

Understand this part →

non_o

Symbol n_o

non_o is an argument of the function-like quantity on the left; its role is set by that function’s stated inputs.

Understand this part →

piLp_i^{L}

Symbol p_i^L

the low-tier prices.

Understand this part →

poLp_o^{L}

Symbol p_o^L

poLp_o^L is one of the signed contributions combined to compute the quantity on the left.

Understand this part →

TT

Symbol T

T is one of the signed contributions combined to compute the quantity on the left.

Understand this part →

piHp_i^{H}

Symbol p_i^H

piHp_i^H is one of the signed contributions combined to compute the quantity on the left.

Understand this part →

poHp_o^{H}

Symbol p_o^H

poHp_o^H is one of the signed contributions combined to compute the quantity on the left.

Understand this part →

=

=

The expressions on both sides represent the same quantity under the stated assumptions.

Understand this part →

See an illustrated explanation →
addition

addition

Add the term after the plus sign to the term or group before it.

Understand this part →

subscript

subscript

The lower label selects a particular version, component, or indexed member of the quantity. For example, x₀ and xₜ can be values at different positions.

Understand this part →

superscript

superscript

A raised number can be a power. When it is a label or bound, it selects a case or the upper limit of a sum; the formula’s structure distinguishes these uses.

Understand this part →

See an illustrated explanation →

How to interpret it

Read it with the definitions, units, and assumptions supplied by the article.

What the article says around this equation

The pricing structure has a feature worth building a mental model around before it costs you money in production: it is not a marginal rate that blends smoothly as a request grows, it is a cliff. Every model’s documented price list carries two tiers — one for requests under 200,000 tokens, and a materially higher one, roughly double across the board, once a request reaches that threshold — and the higher rate applies to the entire request, not just the tokens past the line [ 1 ] . Written as a cost function of input tokens nin_i and output tokens non_o against a threshold T = 200{,}000 , with low-tier prices piLp_i^{L}, poLp_o^{L} and high-tier prices piHp_i^{H}, poHp_o^{H} : Cost(ni,no)={ni piL+no poL,ni<Tni piH+no poH,ni≥T\text{Cost}(n_i, n_o) = \begin{cases} n_i\, p_i^{L} + n_o\, p_o^{L}, & n_i < T \\ n_i\, p_i^{H} + n_o\, p_o^{H}, & n_i \geq T \end{cases}. For…
Read the full surrounding passage
The pricing structure has a feature worth building a mental model around before it costs you money in production: it is not a marginal rate that blends smoothly as a request grows, it is a cliff. Every model’s documented price list carries two tiers — one for requests under 200,000 tokens, and a materially higher one, roughly double across the board, once a request reaches that threshold — and the higher rate applies to the entire request, not just the tokens past the line [ 1 ] . Written as a cost function of input tokens nin_i and output tokens non_o against a threshold T = 200{,}000 , with low-tier prices piLp_i^{L}, poLp_o^{L} and high-tier prices piHp_i^{H}, poHp_o^{H} : Cost(ni,no)={ni piL+no poL,ni<Tni piH+no poH,ni≥T\text{Cost}(n_i, n_o) = \begin{cases} n_i\, p_i^{L} + n_o\, p_o^{L}, & n_i < T \\ n_i\, p_i^{H} + n_o\, p_o^{H}, & n_i \geq T \end{cases}. For grok-4.6 that means a 199,999-token prompt is billed at two dollars per million input tokens, and a 200,001-token prompt — one token longer — is billed at four dollars per million input tokens and twelve dollars per million output tokens for the whole request, not a blended rate [ 1 ] . A retrieval-augmented pipeline that occasionally pads a prompt with one extra chunk of context can cross that line without any change in what the request is actually asking for, and the bill for that request roughly doubles. This is a discontinuity, not a slope, and it is the kind of detail a cost estimate built from a single “price per million tokens” figure will get wrong in exactly the requests that matter most, because long-context requests are disproportionately the expensive ones to mis-price.

Read the equation in its article →

Sources cited in the surrounding passage

These citations give research context. Read each source to check which claims it supports.

Return to Actually Building with the Grok API

See this formula across 1 published context →

Browse the mathematical compendium →