Responses streaming evidence
Record final stream usage once, without changing the stream.
Grow or Die wraps the official OpenAI client on your server. It preserves normal and streaming return values, waits for final stream usage, and keeps cached tokens separate from uncached input.
Final usage is the boundary
Text deltas are not an accounting record. The completed response supplies input, output, cached, and reasoning usage; a cancelled stream without final usage stays visibly unknown.
Cached tokens stay separate
input_tokens_details.cached_tokens is retained as its own meter so the server can apply the exact cached-input rate for the model, tier, and date.
Business identity comes from your backend
Attach opaque account, user, feature, and prompt-version IDs before the request. Prompts, generated responses, provider keys, and request bodies are not sent.
Hidden retries remain unknown
Retries inside the provider client are below the wrapper boundary. For attempt-level cost, disable provider retries and retry explicitly with one logical request ID and increasing attempt numbers.
Full implementation recipe
OpenAI Responses streaming cost by account
See the tested server pattern, identity boundary, and fail-closed usage rules in the streaming cost recipe.