DEV Community

Cover image for GPT-6.1 Terra Cost Breakdown: Effort Tokens, the 272K Repricing Rule and Cache Writes
AIHubMix
AIHubMix

Posted on Edited on

GPT-6.1 Terra Cost Breakdown: Effort Tokens, the 272K Repricing Rule and Cache Writes

A support workload of 10,000 requests a month on GPT-6.1 Terra, run at the model's default medium effort, prices out at $91.25 on standard rates, cache writes aside. Output tokens are $75 of that, or 82%. The input price that makes Terra look cheap — $1 per million tokens, half of GPT-5.6 Terra's $2 — is not where the bill concentrates, and the setting that moves it most is not the one on the price card.

Terra launched on 26 October 2026 at $1 input and $5 output per million tokens, against $12 output on GPT-5.6 Terra. Three mechanics decide what a real workload pays on top of those numbers: reasoning tokens bill as output, a request that crosses 272,000 input tokens is repriced in full, and a cached prefix costs 5% of input while a written prefix costs 125%. Two of the three are only visible in a response's usage object, which is why the sample below logs them.

AIHubMix serves the model as gpt-6.1-terra at the same rates as OpenAI.

Prerequisites

  • An AIHubMix key in $AIHUBMIX_API_KEY, and the OpenAI Python SDK pointed at https://aihubmix.com/v1.
  • The Responses API. Terra's effort setting only takes effect on that route through AIHubMix (evidence in the failure modes below), and the 12-hour cache lifetime is Responses-only.
  • A stable prefix of at least 1,024 tokens if you want anything cached. Below that, no cache entry is created.
  • Requests under 272,000 input tokens if you want standard rates. Terra accepts up to 922,000 input tokens within a 1,050,000-token context; it just charges more past 272K.

The rates you are working against

USD per million tokens, from the OpenAI model page. AIHubMix's model page lists the same standard input, cache-read and output prices, but no cache-write or long-context line; its caching doc gives a single 1.25x write ratio, so a 12-hour premium isn't published there.

Token type Up to 272K input Over 272K input
Input $1.00 $2.00
Cached input (read) $0.05 $0.10
Cache write, 30 min $1.25 $2.50
Cache write, 12 h $2.50 $5.00
Output $5.00 $7.50

Two caveats sit under that table. The figures past 272K are OpenAI's rule applied, not AIHubMix's price lines: input and cache rates double and output rises 1.5x for the whole request, which puts a 12-hour write at $5.00, and AIHubMix publishes no long-context line for Terra. And the 12-hour write rate is OpenAI's: AIHubMix's price config carries a single cache-write ratio of 1.25x input, so a 12-hour premium on the gateway isn't confirmed.

Read the write rates as total rates, not surcharges. Per OpenAI's prompt caching guide, each input token bills exactly once — as ordinary input, as a read, or as a write.

OpenAI also sells Batch and Flex at 50% off, Fast mode at 2x and regional processing at +10%. Those are OpenAI's terms; the section "What the gateway doesn't confirm" covers what survives on the gateway.

Where a request's money goes

Reasoning is output. A call that returns 2,000 visible tokens after 8,000 reasoning tokens bills 10,000 output tokens. The response text is not a cost signal; output_tokens_details.reasoning_tokens is.

272K is a cliff, not a marginal band. Every input token in the request doubles and every output token rises 50%, including the tokens below the line. With no caching and 20,000 output tokens:

Request Input cost Output cost Total
270,000 in, 20,000 out $0.27 $0.10 $0.37
300,000 in, 20,000 out $0.60 $0.15 $0.75

Eleven percent more input roughly doubles the bill. If a retrieval step adds chunks opportunistically, a fraction of your traffic will sit on the wrong side of that boundary, and those requests cost roughly double the same request just under the line.

A cache write is a charge, and a route change is a second one. Writing a prefix bills at 1.25x input for the default 30-minute lifetime and 2.5x for 12 hours; reads bill at 0.05x whichever lifetime you chose. In AIHubMix's checks, a 9,623-token developer prefix written on a first Responses call was read on calls two and three, but the same prefix sent to Chat Completions immediately afterwards was written again with no hit. Chat Completions and Responses keep separate caches on the gateway, so mixed traffic pays twice for one prefix.

Pricing 10,000 requests

The workload: each request carries a 2,500-token stable prefix that hits the cache, adds 1,500 fresh input tokens, and returns 1,500 output tokens with reasoning included at medium effort. Every request stays under 272K. Cache writes are excluded from the totals and handled separately.

That is 25M cached tokens, 15M fresh input tokens and 15M output tokens for the month.

Line Tokens Rate per M Cost
Cached input 25M $0.05 $1.25
Fresh input 15M $1.00 $15.00
Output, medium 15M $5.00 $75.00
Total, medium $91.25

Writes are noise at this prefix size: 2,500 tokens billed at $1.25 per million instead of $0.05 is about $0.003 extra per write.

Two variations price the risk. If the prefix never hits — it changes per request, or traffic is split across routes — all 40M input tokens bill at $1, so input plus output is $115. Caching is worth $23.75 a month, roughly a fifth of that bill. If the same traffic runs at max effort, Artificial Analysis's measured ratio of about 35,000 output tokens per task at max against 6,000 at medium (5.8x) scales 1,500 output tokens to 8,750 per request, 87.5M for the month. Output costs $437.50 and the month totals $453.75 — about five times the medium figure. Losing the cache costs a fifth of the bill; running max costs five times it.

Per task, at equal token counts, the same workload costs $0.0091 on Terra against $0.0183 on GPT-6.1 Sol and Claude Sonnet 5.5 and $0.0215 on GPT-5.6 Terra. Measured rather than computed, Artificial Analysis puts Terra at medium at $0.10 per task on its Intelligence Index, max at $0.40, Sol at xhigh at $0.39 with a higher score, and Sonnet 5.5 at max at $5.46 while spending about 197,000 output tokens per task.

Logging the usage fields

The sample uses the OpenAI SDK against AIHubMix's Responses endpoint, sets effort, passes prompt_cache_options through extra_body, and prices the response at standard rates. Setup is in AIHubMix's Responses API docs; gateway caching behaviour is in the caching docs.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://aihubmix.com/v1",
    api_key=os.environ["AIHUBMIX_API_KEY"],
)

# Keep this identical across requests so it can be cached (1,024+ tokens).
STABLE_PREFIX = open("support_rules.txt").read()

# Terra standard rates, USD per 1M tokens, input up to 272K.
PRICE = {"input": 1.00, "cached": 0.05, "write_30m": 1.25,
         "write_12h": 2.50, "output": 5.00}

resp = client.responses.create(
    model="gpt-6.1-terra",
    reasoning={"effort": "low"},  # none, low, medium, high, xhigh, max
    input=[
        {"role": "developer", "content": STABLE_PREFIX},
        {"role": "user", "content": "Classify this ticket: refund not received."},
    ],
    extra_body={"prompt_cache_options": {"ttl": "30m"}},  # or "12h"
)

u = resp.usage.model_dump()
inp = u["input_tokens_details"]
cached = inp.get("cached_tokens", 0)
writes = inp.get("cache_write_tokens", 0)
by_ttl = inp.get("cache_write_tokens_details") or {}
w12 = by_ttl.get("ttl_12h_tokens", 0)
w30 = writes - w12
ordinary = u["input_tokens"] - cached - writes
reasoning = u["output_tokens_details"].get("reasoning_tokens", 0)

cost = (ordinary * PRICE["input"] + cached * PRICE["cached"]
        + w30 * PRICE["write_30m"] + w12 * PRICE["write_12h"]
        + u["output_tokens"] * PRICE["output"]) / 1_000_000

print(f"input={u['input_tokens']} cached={cached} writes={writes} (12h={w12})")
print(f"output={u['output_tokens']} reasoning={reasoning}")
print(f"estimated cost=${cost:.6f}")
Enter fullscreen mode Exit fullscreen mode

Ordinary input is input_tokens minus cached_tokens minus cache_write_tokens; the write total is never added on top of its own parts. Above 272,000 input tokens, swap the long-context rates in: $2 input, $0.10 cached, $2.50 for 30-minute writes, $5 for 12-hour writes, $7.50 output.

Failure modes

Effort changes nothing on Chat Completions. On Responses, a prime-sum prompt produced 72 output tokens at effort none and 1,153 at max, 1,078 of them reasoning. On Chat Completions, setting reasoning_effort made no consistent difference across the same tests (none and max both landed around 200-300 reasoning tokens from run to run), which suggests that route runs at a fixed effort. Fix: send the requests you intend to tune to Responses.

Turning reasoning off doesn't automatically save money. In Artificial Analysis's run, no-reasoning Terra cost $0.11 per task and scored 33 against $0.10 and 41 at medium. Fix: measure quality and cost on your own prompts before assuming none is cheaper.

A cache prefix that looks stable isn't. Any edit ahead of the varying content — a timestamp, a reordered tool list — invalidates the entry and bills another write. Fix: keep the system prompt, tool definitions and reference material first, in a fixed order, and everything per-request after it. The 1,024-token minimum still applies.

Explicit mode with no breakpoint caches nothing. With prompt_cache_options.mode set to "explicit", only marked breakpoints are written; content after the last one bills as ordinary input with no write charge. AIHubMix's checks confirmed a request in that mode wrote nothing at all. Fix: mark the breakpoint, or leave the mode on automatic.

Picking the cache lifetime by habit rather than arithmetic. A 30-minute write is $1.25 per million prefix tokens and a 12-hour write $2.50, with reads at $0.05 either way. Three or more 30-minute writes inside 12 hours ($3.75) costs more than one 12-hour write; two writes break even, and steady traffic that keeps the 30-minute entry alive should stay on 30 minutes. AIHubMix confirmed the 12-hour setting on Terra — a 9,020-token prefix was written as ttl_12h_tokens on the first call, and the second call read 9,007 of those tokens — but the write rate it bills at may still be the single 1.25x ratio above.

Effort raised mid-conversation through the request field. OpenAI's GPT-6 model guide recommends keeping request-level effort fixed and adding a configuration_update input item instead; AIHubMix accepted one on Terra (200) in its 27 October checks.

What the gateway doesn't confirm

Three things on this page are OpenAI's terms, not verified gateway behaviour, and the difference matters if you are modelling a bill.

Batch is OpenAI-only. In AIHubMix's checks on 27 October, GET /v1/batches returned 404, so the 50% Batch discount is not available there at all. Flex is different: service_tier "flex" was accepted and echoed back as "flex", and "priority" was accepted and echoed back as "fast" — OpenAI's 2x Fast mode — but AIHubMix's price list for Terra shows only standard lines, so neither billed rate is confirmed; read the usage log rather than assuming a discount. The 12-hour cache-write premium is the third: OpenAI lists $2.50 against $1.25, while AIHubMix's price config carries one 1.25x ratio, so a 12-hour write there may bill at the same rate as a 30-minute one. The $5.00 in the over-272K 12-hour cell is OpenAI's 2x rule applied past 272K, not an AIHubMix price line, since AIHubMix publishes no long-context line. OpenAI also documents a compaction feature for long contexts that AIHubMix hasn't checked on Terra.

Keep reading: the GPT-6.1 Terra series

Sources

Top comments (0)