LIVE · Thursday 3 December

Cheapest Way to Test a Smaller Model on Production OpenAI Traffic: Batch API Replay, Then a Canary

Replaying logged requests through OpenAI's Batch API at a 50% discount costs tens of dollars per candidate model. Mirroring live traffic costs thousands. Here is how the replay test works, call type by call type.

By Surya10 min read

The cheapest way to test a smaller model on production OpenAI traffic is to replay a sample of your logged requests through the candidate model with OpenAI's Batch API, which carries a 50% discount, and score its answers against the answers your current model already gave. For a startup spending $40,000 a month on gpt-5.4, a 12,000-request replay costs about $8 on gpt-5-mini and under $3 on gpt-6-luna or gpt-5-nano, plus about $18 to have an AI judge grade the open-ended answers. Mirroring all live traffic to the same small model through a proxy costs about $4,700 a month at standard prices. Send live traffic to the small model only as a small canary, and only for the call types that pass the replay.

Why "half the calls" is the wrong unit

The suspicion that half your calls could go to a smaller model is a reasonable starting point. It is also the wrong number to test. What you save depends on the share of spend that moves, and spend is rarely spread evenly. A classifier that runs on every request with a 300-token prompt can be most of your call volume and a small part of the bill. A summariser reading 20,000-token documents can be the reverse.

So the first step costs nothing: tag each logged request with its call type (classification, extraction, JSON formatting, summarisation, routing, open-ended generation, or whatever your product's own categories are), add up input and output tokens by type, and rank the types by dollars. If your requests are not tagged today, a separate OpenAI project or API key per feature gives you the split going forward. Everything below runs per call type, because a small model can be fine at extraction and poor at open-ended writing, and a single pass rate across all traffic hides that.

How a replay test works

A replay test has three parts: a sample of real requests, the answers your current model gave to them, and the candidate's answers to the same requests. The pairing is what makes it cheap and honest. Each request is graded against a known reference, users never see the candidate's output, and nothing in production changes.

OpenAI's Batch API is the natural place to run it. Its guide says it offers a "50% cost discount compared to synchronous APIs", that each batch "completes within 24 hours (and often more quickly)", and that "Batch API jobs don't count toward standard per-model request or token rate limits", so the test cannot slow down production. A batch can hold up to 50,000 requests in a file of up to 200 MB, and it accepts both /v1/responses and /v1/chat/completions. One detail shapes the setup: the guide says "each input file can only include requests to a single model", so each candidate gets its own batch file. Results also come back in no fixed order, so every line needs a unique custom_id to join it back to the original request.

If your logs do not hold the current model's answers, you need to regenerate them, and that is the most expensive line in the test: about $66 for 12,000 gpt-5.4 requests on Batch under the assumptions below. Logging the full response alongside each request is the cheapest thing you can do before testing anything.

A minimal script that samples once and writes one batch file per candidate, assuming a log file with id, call_type, messages and output fields:

import json, random

random.seed(7)
rows = [json.loads(line) for line in open("logged_calls.jsonl")]
by_type = {}
for r in rows:
    by_type.setdefault(r["call_type"], []).append(r)

# Sample once so every candidate sees the same requests.
sample = [r for rs in by_type.values() for r in random.sample(rs, min(2000, len(rs)))]
json.dump(sample, open("sample.json", "w"))

for model in ["gpt-5-mini", "gpt-5-nano", "gpt-6-luna"]:
    with open(f"batch_{model}.jsonl", "w") as f:
        for r in sample:
            f.write(json.dumps({
                "custom_id": f'{r["call_type"]}:{r["id"]}',
                "method": "POST",
                "url": "/v1/chat/completions",
                "body": {"model": model, "messages": r["messages"]},
            }) + "\n")

Each file is uploaded with purpose="batch" and submitted with completion_window="24h", the only window the Batch API accepts.

What the replay costs

OpenAI's pricing page, read on November 17, 2026, lists gpt-5.4 at $2.50 per million input tokens and $15.00 per million output tokens on the standard tier, and $1.25 and $7.50 on Batch. The small candidates are far cheaper: gpt-5-mini is $0.125 in and $1.00 out on Batch, gpt-6-luna $0.05 and $0.25, gpt-5-nano $0.025 and $0.20, and gpt-5.4-mini $0.375 and $2.25.

Assume the $40,000 a month is all gpt-5.4 at standard rates, that the average request carries 2,000 input tokens and 400 output tokens, and that nothing is cached. Each request then costs $0.011, which puts the workload at about 3.64 million requests a month. Assume a replay of 2,000 requests for each of six call types, 12,000 in all, with each candidate producing the same 400 output tokens.

Candidate on Batch Cost per 1,000 requests 12,000-request replay Same 12,000 mirrored live at standard
gpt-5.4-mini $1.65 $19.80 $39.60
gpt-5-mini $0.65 $7.80 $15.60
gpt-6-luna $0.20 $2.40 $4.80
gpt-5-nano $0.13 $1.56 $3.12

Testing all four candidates costs about $32. The candidates' real output lengths will differ from the old model's, which is one of the things the replay measures; the per-1,000 figures scale with them.

Score the cheap way first

Most of the cost of a careful test is in grading, not generation, so the order of the checks matters.

Start with checks that cost nothing. For classification, routing and extraction, compare the candidate's answer with the logged answer: same label, same fields. For JSON formatting, parse both and compare the objects, and count any output that fails to parse as a miss. A few lines of Python settle these call types without a model in the loop:

import json

def matches(expected: str, got: str, kind: str) -> bool:
    if kind == "json":
        try:
            return json.loads(got) == json.loads(expected)
        except ValueError:
            return False
    return got.strip().lower() == expected.strip().lower()

For summarisation and open-ended generation, exact match means nothing, so an AI judge has to compare the two answers. Run it on Batch too. A judge call that reads the original prompt, both answers and a short rubric is about 3,000 input tokens; with a 100-token verdict, gpt-5.4 on Batch charges about $0.0045 a call. Judging 4,000 answers from two open-ended call types costs about $18. Then read 50 or so of the cases where the judge says the candidate lost, to check that the judge is grading what you care about.

Do not build this on OpenAI's Evals product. OpenAI's Evals guide says Evals became read-only for existing users on October 31, 2026, and the deprecations page lists the dashboard, API and graders as shutting down on November 30, 2026, with "Migrate to Promptfoo" as the replacement. Existing Evals work does not move over cleanly: in OpenAI's community notice thread, OpenAI support says a JSONL export "only contains the results of a completed evaluation", so test definitions have to be rebuilt. Promptfoo is MIT-licensed and runs locally or in CI. Its is-json and equals assertions cover the free checks, and llm-rubric and select-best cover the judged ones.

How many requests is enough

Nobody has published per-call-type pass rates for gpt-5-mini, gpt-5-nano or gpt-6-luna against a frontier model on real production traffic, so the sample size has to come from arithmetic rather than precedent. The 95% margin of error on a pass rate depends on the rate itself and on the sample:

Requests per call type Margin at a 90% pass rate Margin at a 50% pass rate
100 ±5.9 points ±9.8 points
400 ±2.9 points ±4.9 points
1,000 ±1.9 points ±3.1 points
2,000 ±1.3 points ±2.2 points

The figures use the normal approximation, which is close enough at these sizes. Two thousand requests per call type is enough to tell a 92% pass rate from an 88% one. For call types where a single bad answer is costly, think in terms of the failure rate instead: if a candidate makes no mistakes in 1,000 requests, the 95% upper bound on its true error rate is about 0.3%. Sample across a full week of traffic rather than one day, so weekend and weekday patterns both appear.

Why not mirror live traffic instead

Mirroring sends a copy of each live request to the candidate in the background and logs both answers. LiteLLM's open-source proxy does this with a silent_model setting on a deployment. Its test suite shows each primary request producing a second, background call to the silent model, marked is_silent_experiment: True in the logs, and the setting accepts a list of models for fan-out. The parameter takes model names only, with no sampling rate beside it.

That is the cost problem. Mirroring every request to gpt-5-mini at standard prices costs about $4,727 a month on the workload above, about $1,455 to gpt-6-luna and about $12,000 to gpt-5.4-mini. Mirroring 12,000 requests instead of all of them costs about $15.60 for gpt-5-mini, double the Batch price, and only if you build the sampling yourself. Mirroring earns its place later, for requests your logs cannot reproduce, such as calls whose context is assembled at request time and never stored. For a first test, replay gives the same paired data for less.

If your organisation uses Zero Data Retention, there is a wrinkle. OpenAI's data-controls page lists /v1/batches and /v1/files as not ZDR-eligible, while Chat Completions and Responses are eligible with limitations. Flex processing, which runs through those endpoints with service_tier="flex", is billed at Batch rates and lists model evaluations as a use case, at the cost of slower responses and occasional 429 "Resource Unavailable" errors, which are not charged.

Before you log production prompts

Replay means storing real prompts, so settle the data questions first:

  1. Check your customer contracts and privacy policy for what you may store and for how long.
  2. Strip or hash personal data in prompts before they go into a replay file.
  3. Delete batch files after scoring; OpenAI keeps /v1/batches and /v1/files state until deleted, though batch output files expire after 30 days by default and output_expires_after can shorten that to an hour.
  4. Note that OpenAI says API data is not used for training by default and abuse-monitoring logs are kept for up to 30 days.

From a passing test to a lower bill

A call type that passes the replay goes to a canary: send 5% to 10% of its live traffic to the small model and watch the measures your users feel, such as retries, thumbs-down ratings, support tickets and downstream errors. A canary has no direct cost (it lowers the bill) but it is the only stage with user risk and the only one without a paired reference, which is why it comes last.

Per-call-type switching is the simplest saving to bank. If call types worth $20,000 a month move from gpt-5.4 to gpt-5-mini with the same token counts, that portion costs about $2,364, a saving of about $17,636 a month. Moved to gpt-6-luna it costs about $727.

Per-request routing goes further for call types that mix easy and hard requests. LMSYS's RouteLLM post of July 1, 2024 reported cost cuts of over 85% on MT Bench, 45% on MMLU and 35% on GSM8K while keeping 95% of GPT-4's performance, routing between GPT-4 Turbo and Mixtral 8x7B. The spread is the lesson: routers trained only on Arena preference data were near random on MMLU until about 1,500 labelled MMLU examples were added. These are benchmark results, not production traffic, and a router needs your own labelled data to match them.

A model post-trained on the same captured traffic is the third step. OpenAI's own fine-tuning platform is no longer open to new users, so this means an outside service or your own training stack. Parsec, a small language model lab, offers one version: its routers page says it routes per turn to models post-trained on the customer's traffic, claims "savings on real workloads: 60%" without defining a workload or baseline, and says a first post-trained model takes about four weeks. It publishes no price for the service. The logs and scores from a replay test are the raw material any such service starts from.

Bottom line

If your logs already hold requests and responses, replay a stratified sample through the Batch API this week: about $8 per mini-class candidate for 12,000 requests, plus about $18 of judging for the open-ended types. If you are on Zero Data Retention, run the same replay with Flex. Mirror live traffic only for call types your logs cannot reproduce, and sample it yourself, because LiteLLM's silent_model copies every request. Canary each call type that passes, then bank the per-call-type saving before considering a router or a post-trained model.

Sources

More in Products

All Products →