Account for the First Cache Write in a CometAPI GPT-6 Astra Trial

A repeated-call forecast should not begin with “all cached input.” Begin with a cold row. OpenAI’s prompt-caching guide says that for GPT-5.6 and later, an eligible cache write costs 1.25× the ordinary input rate while a read costs 0.1×. One write plus one full reuse is therefore 1.35× one ordinary input, not 0.2×. The official CometAPI Astra guide identifies gpt-6-astra and lists separate short-context Standard rates for uncached input, cached input, cache writes, and output.

That upstream schedule is a hypothesis for a CometAPI trial, not the bill. The useful decision is whether an Astra workload routed through CometAPI actually exposes enough usage detail—and produces an observed charge consistent enough—to justify a cached-read forecast.

Illustrative cold/write/read experiment

No live gateway test was performed here. Use this as a controlled test plan with your existing CometAPI integration. Keep the model, tools, reasoning effort, response format, stable prefix, and any cache key unchanged. Change only a short suffix. Run the second request promptly: an identical prefix is required for reuse, but a cache key influences routing rather than guaranteeing a hit.

Run Intended condition Change from prior run Record from response Billing interpretation
A Cold population New stable prefix total input, cached input, cache-write input, output, latency Count as a write only if returned usage supports it; otherwise mark unverified
B First reuse Suffix only same fields A positive cached count is evidence of a read; a miss is still a valid observation
C Repeated reuse Suffix only same fields Tests whether reuse persists; do not assume B’s result repeats
D Negative control Alter an early prefix token same fields Expected to reduce reusable prefix; diagnose rather than discard the row

“Cache-write input” and “cached input” are requested observations, not promises about the CometAPI response schema. If a field is absent, write not exposed, not zero.

Bill-to-observation worksheet

Complete one line per request, using the rate card and processing/context tier applicable at the test time:

Field Symbol Value
Total input tokens I ___
Cached input tokens, if exposed R ___ / not exposed
Cache-write tokens, if exposed W ___ / not exposed
Ordinary input tokens U = I - R - W ___ / unverified
Output tokens O ___
Applicable rates per token pU, pR, pW, pO ___
Usage-derived expected charge E = U·pU + R·pR + W·pW + O·pO ___ / unverified
Observed CometAPI charge B ___
Difference B - E ___ / unverified
Processing tier, context band, timestamp, request ID — ___

OpenAI’s guide uses the same category logic: ordinary input is total input minus cached and cache-write tokens. But do not force that formula when the gateway omits a category. Instead, preserve the raw response, mark E unverified, and compare the observed CometAPI charge across A–D.

Forecast only after reconciliation. For n calls with one measured write and n-1 measured reads, use:

forecast(n) = observed_write_charge + (n - 1) × observed_median_read_charge

Keep output and uncached-suffix costs in those observed charges. Report misses separately, because prefix changes, expiry, or routing can turn an intended read into another write or uncached request. This makes the CometAPI accounting check—not an upstream discount headline—the boundary between an experiment and a budget.

The worksheet should include a cache-eligibility precheck before interpreting token counts. Record the rendered prefix hash, breakpoint position, prompt length, model/interface settings, and whether the prefix meets the documented minimum cacheable length. Flag a deliberate cached-prefix, breakpoint, or model/interface setting change as controlled_input_changed, while recording the actual reported cached-token count independently. Ordinary suffix edits and the resulting total prompt-length changes do not automatically disqualify the row. If the reported cached count is zero, keep that observation visible even when a control changed; it does not by itself identify why reuse failed.

For billing reconciliation, preserve an observed_usage_source field with values such as response_usage, provider_invoice, or not_exposed. A token category reported by the response is evidence about usage, while an invoice comparison is evidence about money; they should not be collapsed into one number. This makes the forecast honest when CometAPI exposes usage but not a cache-specific charge.