OpenAI-compatible API migration checklist

A base URL change proves connectivity, not compatibility. Pass the same representative request suite through both paths and compare every application-visible contract before rollout.

Published 2026-08-15 · Updated 2026-08-15 · KeepRouter Editorial · 9 minute read

Field-by-field OpenAI-compatible API migration checklist from request contract to rollback
Compatibility is approved operation by operation, including streams, tools, errors, usage, and rollback.

Short answer: do not approve an OpenAI-compatible API migration because one text prompt returned 200. Treat it as a contract migration. Verify authentication, endpoint paths, model IDs, request fields, response shapes, streaming events, tools, usage, errors, timeouts, and rollback with payloads taken from your application.

The safest sequence starts by freezing a small, representative corpus from the current integration. Remove secrets, but preserve the message structure, tool definitions, output constraints, and edge cases. Run it against both paths and store normalized evidence rather than visually judging a few answers.

Migration evidence matrix

PhaseTestPassing evidence
DiscoveryInventory endpoints and SDK callsEvery generation path and background job has an owner
ConnectivitySend a minimal non-streaming requestAuth succeeds and the returned model/request ID is recorded
ContractCompare consumed response fieldsParsers receive all required fields without undocumented coercion
StreamingParse a complete stream and cancellationEvents arrive in a supported order; partial output and finish state are handled
ToolsExercise zero, one, and multiple tool callsNames, arguments, IDs, and tool results survive a full round trip
FailureTrigger invalid auth, model, payload, limit, and timeout casesThe application classifies errors and retryability correctly
AccountingReconcile response usage with gateway logsModel, input/output units, status, and charge are attributable
RolloutSend a bounded cohort to the new pathQuality, error, latency, and cost gates are evaluated on the same workload
RollbackRestore the previous routeA documented switch works without code archaeology

Configuration is the first change, not the last test

Many OpenAI SDK clients accept a configurable base URL:

from openai import OpenAI

client = OpenAI(
    base_url="https://keeprouter.com/v1",
    api_key="sk-kr-your-key",
)
response = client.chat.completions.create(
    model="MODEL_ID_FROM_THE_CATALOG",
    messages=[{"role": "user", "content": "Return exactly: ready"}],
)

Use the model catalog for the current model ID and its endpoint compatibility. Use the public OpenAPI document for supported routes and request schemas. A model listed for Chat Completions is not automatically evidence that it supports Responses, embeddings, images, or every optional Chat Completions field.

Executable rollout checklist

  • [ ] Pin the SDK version used by the test and production build.
  • [ ] Keep API keys server-side and create a narrowly scoped key where the gateway supports scope.
  • [ ] Replace provider-specific model aliases with IDs verified in the destination catalog.
  • [ ] Test omitted optional fields as well as explicit values; defaults can differ.
  • [ ] Test the exact stream parser, including an upstream error after partial output.
  • [ ] Validate JSON or structured output against your schema instead of checking that it looks valid.
  • [ ] Make tool side effects idempotent before enabling retries or failover.
  • [ ] Capture request IDs and application correlation IDs without logging secrets or sensitive prompt content.
  • [ ] Set timeout, retry, output, and spend bounds explicitly.
  • [ ] Compare a canary cohort with the baseline and rehearse rollback before increasing traffic.

The OpenAI-compatible API page explains the integration surface, while the OpenAI SDK guide provides client-specific setup. If you are choosing between Chat Completions and Responses at the same time, separate the decisions: first read Responses API versus Chat Completions, then migrate one contract at a time.

Boundary: compatible does not mean identical

OpenAI documents that response objects and event data may gain fields under its compatibility policy, and its Responses and Chat Completions APIs deliberately use different object shapes. An independent gateway can implement an OpenAI-style surface without reproducing every upstream extension or model behavior. Your application contract—not the label “compatible”—is the acceptance criterion.

Frequently asked questions

Is changing base_url enough to migrate?

It may establish connectivity for a simple call. Production acceptance still requires testing the fields, streams, tools, errors, limits, and usage records your application relies on.

Should model IDs be copied from the old provider?

Only if the destination's current catalog documents those exact IDs. Treat aliases and endpoint eligibility as destination-owned configuration.

Sources reviewed

Article last reviewed 2026-08-15

  1. [1] OpenAI API reference
  2. [2] OpenAI backward compatibility
  3. [3] KeepRouter OpenAPI
  4. [4] KeepRouter model catalog

Related guides

← All posts · Models & pricing · Get an API key