Skip to content

AI Industry & Models

Before an AI Endpoint Closes, Replay the Requests That Matter

A replacement model name does not prove compatibility. Preserve real request patterns, replay them safely, and set migration gates around behavior your application depends on.

Tobias LundIndustry & Models Writer

November 10, 2026 · 7 min read

Laptop displaying side-by-side JSON and tool-call results from an order-cancellation API replay.
Laptop displaying side-by-side JSON and tool-call results from an order-cancellation API replay.

A deprecation notice usually identifies an endpoint that will disappear and another model that can accept requests. That establishes availability, not compatibility. The candidate may recognize the same parameters while choosing different tools, refusing benign work, taking longer at the tail, or returning JSON that passes a visual inspection but breaks a parser.

Use an order-cancellation assistant as the running case. It receives a support conversation, calls `get_order`, waits for explicit customer confirmation, calls `cancel_order` when policy allows, and returns a JSON object containing the order status and reason. A tool call is a structured instruction from the model to application code; the model proposes the call, while the application decides whether to execute it.

The migration succeeds only if that sequence still behaves correctly. A fluent answer is irrelevant when the candidate cancels before confirmation, sends the wrong order ID, or renames `cancellation_reason` to `reason`.

Build the replay set before choosing the replacement

A replay set is a stored collection of requests, expected constraints, and prior results that can be sent through another model under controlled conditions. It should represent the workload the endpoint handles, rather than a handful of prompts copied from a demo notebook.

Start with production traffic while the old endpoint remains available. Preserve the full request envelope: system instructions, message history, tool definitions, response schema, sampling settings, output limits, and any transformations applied by an SDK or internal gateway. Record the endpoint identifier and configuration with each case. Without those details, a later difference cannot be assigned to the model, the prompt, or the surrounding software.

Remove or replace personal data before requests enter the evaluation store. Stable placeholders are more useful than deleting fields because relationships still matter: the customer ID in the conversation should match the ID passed to `get_order`, even when both values are synthetic. Keep access controls and retention limits aligned with the source system rather than treating an evaluation database as harmless test data.

A random sample captures common traffic, but common traffic alone misses costly failures. Add cases selected by route and consequence: requests that can trigger a mutating tool, conversations near the context limit, prior refusals, malformed user input, unusual languages, and cases that previously required human correction. For the cancellation assistant, preserve successful cancellations as well as expired orders, ambiguous confirmation, duplicate requests, and attempts to cancel somebody else’s order.

Label each case with the behavior that matters. Some need an exact schema. Others allow several valid phrasings but require the same tool and arguments. A request asking only for order status must never reach `cancel_order`; that prohibition is more useful than storing one preferred sentence as the answer.

Capture a baseline while both endpoints run

Replay every selected request against the retiring endpoint before it closes. Save the raw response, parsed response, tool proposals, token usage reported by the API, error status, and wall-clock duration. If streaming matters, record time to first output separately from time to a complete, validated result.

Models can be nondeterministic, meaning identical requests may produce different outputs across runs. Repeat cases that sit near a policy boundary or control a consequential tool, using the same parameters each time. One successful run cannot establish that the cancellation assistant consistently waits for confirmation; repeated results reveal whether the old endpoint already has a failure rate that the replacement should improve rather than inherit.

Do not let a replay execute production side effects. Point `get_order` at a fixed fixture and replace `cancel_order` with a sandbox implementation that records its arguments without changing an order. The fixture must return the same data to both models, or a changed inventory state, timeout, or policy response will contaminate the comparison.

Run the candidate against the same cases and environment. Paired results matter because aggregate dashboards can conceal route-level regressions: faster answers to status checks may offset slower cancellation paths in the overall average, even though the cancellation path is the one with an operational deadline.

This duplicate inference has a direct cost. Each candidate run consumes model capacity, and repeated cases multiply it, while human review adds labor for outputs that cannot be scored mechanically. Spend that budget on requests with either high traffic or high consequences; a large unlabelled archive is less useful than a smaller set with explicit pass conditions.

Score behavior rather than prose similarity

Tool use should be compared semantically. Check the tool name, normalized arguments, call order, and whether the application would permit execution. Textual equality is too strict when two valid calls differ only in JSON key order, but it is too weak when a plausible explanation accompanies the wrong order ID. For mutating tools such as `cancel_order`, an unauthorized call should block the migration rather than disappear into an average score.

Refusals need two labels. A correct refusal blocks a disallowed request, such as a customer trying to cancel an order belonging to another account. An over-refusal blocks legitimate work. Compare both rates with the baseline because a candidate that appears safer may have become unusable for ordinary cancellations, while one that answers more often may have dropped a necessary account check.

Measure latency at the boundary users experience: from dispatching the model request until the application has a validated result it can act on. Report the median alongside p95, the duration under which 95 percent of measured runs finish, because a small group of slow tool-selection responses can determine whether a support interface times out. Keep model time separate from tool time so the team knows whether to change models, adjust timeouts, or repair an integration.

Output shape should be tested with the production parser and schema validator. Count whether the response parses, whether required fields exist, whether field types are correct, and whether extra properties are allowed. The cancellation assistant should fail the gate if `order_status` sometimes becomes an array, even when a reviewer can infer what the model meant.

Content quality still requires judgment where several outputs are valid. Give reviewers a short rubric tied to the task, hide which endpoint produced each response, and route disagreements for a second look. Do not ask whether the new answer feels better. Ask whether it states the cancellation result accurately, avoids unsupported policy claims, and gives the customer the next permitted action.

Write acceptance gates before reading candidate results. Machine-consumed output can require complete schema validity across the replay set, while mutating routes can require zero unauthorized tool proposals. Latency should stay inside the application’s existing service objective, and legitimate requests should not be refused more often than the approved baseline permits. These gates turn a provider’s suggested replacement into migration evidence.

Cut over with the replay set still running

Once a candidate passes offline, use shadow traffic, which sends a copy of a live request to the candidate without using its response. Shadowing catches gateway behavior and traffic patterns the stored set missed, although it increases inference spending and requires the same privacy controls as the primary request path.

Then move a limited traffic slice and compare the same measures under real load. Keep the retiring endpoint available for rollback until the provider’s cutoff, and freeze unrelated prompt or tool-schema changes during the comparison. Changing the model, system prompt, and tool contract together makes a regression hard to locate.

If no candidate passes, narrow the feature instead of accepting an unmeasured failure. The cancellation assistant can continue retrieving order status while sending eligible cancellations to a human queue. That fallback costs staff time and adds delay, but it prevents an endpoint deadline from turning uncertain model behavior into unauthorized account changes.

Keep the replay set after migration. Run it when the model alias changes, a prompt is edited, a tool schema gains a field, or the gateway starts rewriting requests. The original cancellation case then becomes a permanent contract test: retrieve the order, require confirmation, propose the permitted cancellation, and return the schema the application already knows how to read.

Questions people ask

How large should an API replay set be?

There is no universal request count. Cover every important route first, then add common traffic and high-consequence edge cases until new samples stop revealing distinct behavior. A small, labelled set spanning each tool and refusal boundary usually produces stronger migration evidence than thousands of requests with no expected outcome.

Can provider benchmarks replace a replay test?

No. Provider evaluations can indicate general capability, but they do not contain your system prompt, tool schemas, account rules, parser, or latency budget. Use them to shortlist candidates, then replay the requests that exercise the exact contract between your model endpoint and application.

Should a replay set contain production data?

It can preserve production request patterns without retaining unnecessary personal data. Replace identifiers consistently, restrict access, define a retention period, and keep any required relationships between fields. If sensitive content cannot enter an evaluation store, construct fixtures from approved patterns and document the coverage lost through sanitization.

What if the old endpoint has already closed?

Use stored request logs, responses, tool traces, and latency records as the baseline, then replay only the candidate. The comparison will be weaker because both endpoints cannot run against identical fixtures. Treat missing evidence as migration risk, tighten human review, and keep mutating actions behind approval until live results establish acceptable behavior.

ShareFacebook
model evaluationmodel releasesdeveloper toolingapi deprecationmodel migrationreplay testingllm apis

One story a day

The story of the day, in your inbox

One real story about AI each morning — no hype, no alarm, just company for the road.

Read next

A laptop displaying a vendor-risk PDF beside extracted text with matching page labels and a highlighted footnote.

AI Industry & Models

AI Can Read a PDF Page and Still Lose the Document

Rendered pages help multimodal models see tables and diagrams. They do not reliably preserve footnotes, repeated sections, or references that cross page boundaries.

Tobias Lund · 8 min read

A laptop showing a support ticket beside a routing log with accepted and escalated decisions.

AI Industry & Models

A Model Router Saves Money Only If It Escalates in Time

A cheaper model can handle routine work, but one confidently wrong answer can cost more than several escalations. This routing test measures the failure that pricing tables omit.

Tobias Lund · 7 min read