Moving an LLM application to another API provider is more than changing a base URL. This AI API migration checklist helps you compare models, map parameters, preserve prompt behavior, handle errors consistently, and validate the switch before production traffic moves.
Overview
Teams switch LLM providers for many practical reasons: a preferred model may be available elsewhere, an existing contract may be changing, a region or deployment requirement may shift, or a multi-provider design may improve resilience. The technical risk is that APIs that appear compatible can still produce different behavior.
Provider documentation may use different model identifiers, authentication methods, endpoint paths, parameter names, response structures, streaming formats, and error codes. Even when two services accept a similar chat-completions request, they may interpret sampling controls, tool calls, structured output, token limits, or system instructions differently.
Approach the migration as a contract comparison rather than a copy-and-paste exercise. First document what your application sends and expects. Then map each dependency to the target provider, build a compatibility layer where useful, and compare outputs using representative tests. Keep the original integration available until the new path has passed functional, quality, performance, and operational checks.
A useful migration record includes:
- Current provider, target provider, model identifiers, and deployment names.
- Authentication method, endpoint format, SDK version, and required headers.
- Request parameters, default values, response fields, and streaming behavior.
- Application assumptions about tool calls, JSON output, citations, token usage, and finish reasons.
- Observed latency, failure behavior, cost inputs, and quality results from a representative test set.
For broader reliability work, pair this checklist with a prompt testing framework and an LLM observability checklist.
Checklist by scenario
Scenario 1: Switching from one hosted API to another
- Inventory the existing integration. Record the base URL, API version, SDK package, model name, request schema, response schema, timeout settings, retry rules, and environment variables.
- Confirm the target model explicitly. Do not assume that a similar model name represents the same capability, context limit, modality, tool support, or output behavior. Treat the target model as a new dependency until tested.
- Map authentication. Identify whether the target uses an API key, cloud credential, workload identity, signed request, project identifier, deployment identifier, or additional header. Store credentials in the same secret-management workflow, but do not assume the variable names or scopes match.
- Compare endpoint formats. Check the path, HTTP method, required headers, content type, request envelope, and streaming transport. A provider may expose an OpenAI-compatible endpoint while still differing in supported fields or response events.
- Run a shadow or offline test. Send the same sanitized inputs to both providers where permitted, capture normalized outputs, and compare task success rather than exact wording alone.
Scenario 2: Using an OpenAI-compatible API
Compatibility can reduce integration effort, but it is not a guarantee of behavioral equivalence. Create a parameter mapping worksheet before changing the client:
| Application concept | Current field | Target field | Verification question |
|---|---|---|---|
| Model selection | Model identifier | Model or deployment identifier | Does the target require a regional or deployment-specific name? |
| Instructions | System message | System or instruction field | Is the instruction role supported and interpreted as expected? |
| Randomness | Temperature | Temperature or equivalent | Is the range, default, and behavior the same? |
| Output limit | Max output tokens | Provider-specific token field | Does the limit include reasoning, visible output, or both? |
| Tool use | Tools and tool choice | Tools, functions, or equivalent | Are schemas, forced calls, and returned arguments compatible? |
| Structured output | JSON or schema mode | Response format or schema option | What happens when the model cannot satisfy the schema? |
| Streaming | Server-sent events or SDK stream | Target stream format | Are partial text, tool events, usage, and termination events exposed? |
Implement an internal request and response model where practical. Your application can then call a provider adapter instead of spreading provider-specific conditionals throughout business logic. Keep the adapter responsible for field translation, response normalization, error classification, and provider-specific logging.
Scenario 3: Preparing a multi-provider fallback
- Define which failures are eligible for fallback. A temporary rate-limit or upstream availability error may be handled differently from an invalid request, authentication failure, or policy refusal.
- Decide whether fallback is allowed for every task. A secondary model may be appropriate for summarization but unsuitable for tool execution, regulated workflows, or strict structured output.
- Normalize responses into a common internal format containing text, tool calls, finish state, usage when available, provider metadata, and trace identifiers.
- Prevent duplicate side effects. If a model response can trigger an email, database write, purchase, or other action, use idempotency keys and confirmation rules before retrying with another provider.
- Test degraded operation deliberately. Verify that the application reports partial availability clearly rather than silently changing behavior.
What to double-check
Authentication and deployment
Check credential scope, project or account selection, region, endpoint hostname, TLS requirements, required headers, and secret rotation procedures. Confirm that local, staging, and production environments point to the intended deployment. Avoid placing provider keys in prompts, client-side code, logs, or test fixtures.
Parameters and defaults
Explicitly set important parameters during comparison instead of relying on provider defaults. Compare temperature, top-p or equivalent sampling controls, output-token limits, stop sequences, penalties, seed support, response format, tool choice, and safety-related controls when exposed. A missing field may be ignored, rejected, or assigned a different default.
Messages, tools, and structured output
Test system instructions, multiple user messages, assistant history, empty content, images or other modalities, tool definitions, parallel tool calls, malformed arguments, and tool-result messages. If your application parses JSON, test valid output, missing fields, extra fields, escaped characters, truncated output, and refusals. Validate at the application boundary rather than trusting that a successful HTTP response contains usable data.
Errors, retries, and rate limits
| Failure class | Recommended handling | Migration question |
|---|---|---|
| Authentication or permission | Fail clearly and alert; do not repeat indefinitely. | Which status, code, and message identify this condition? |
| Invalid request | Fix or reject the request; retrying unchanged input is unlikely to help. | Are unsupported parameters reported precisely? |
| Rate limit or capacity | Use bounded backoff, queueing, or an approved fallback. | Are retry hints or request limits exposed? |
| Timeout or network failure | Use an idempotent retry policy and cancellation handling. | Can a retry duplicate a tool or business action? |
| Malformed model output | Validate, repair only under controlled rules, or request a safe retry. | How does the target behave near output limits? |
Quality, latency, and cost measurement
Compare task-level results, not just response text. Use a fixed evaluation set containing normal requests, long context, ambiguous instructions, edge cases, tool calls, and expected failures. Record pass or fail criteria, latency, output length, token usage when available, retry count, and any manual review notes. Keep prompt versions and test results together; the prompt versioning workflow can help make changes traceable.
Common mistakes
- Changing provider and prompt at the same time. Keep the prompt, application logic, and evaluation set stable first. Otherwise, you cannot identify the cause of a behavior change.
- Assuming compatible means identical. Treat compatible APIs as a starting point for integration, not proof that parameters, defaults, streaming, tools, or output formats match.
- Comparing only one successful example. Include failures, long inputs, structured output, retries, and production-like concurrency.
- Ignoring token accounting. A migration can change how input, output, cached context, reasoning, or tool content is counted. Verify the fields and definitions exposed by the target.
- Retrying every error. Unbounded retries can increase load, delay users, and repeat side effects. Classify errors before designing retry behavior.
- Logging sensitive prompts and responses by default. Redact personal or confidential data and review retention before enabling comparison logs. See the PII redaction workflow for a practical preprocessing approach.
- Removing the rollback path too early. Keep the previous adapter, configuration, and prompt version available until the new integration has demonstrated stable behavior.
When to revisit
Revisit this checklist before a planned provider change, contract renewal, model upgrade, regional deployment, or seasonal planning cycle. It should also be reopened after a material change to your prompt, tool schema, retrieval pipeline, output parser, retry policy, or user traffic pattern.
Set a lightweight review trigger for each integration. At minimum, review the model identifier, supported parameters, endpoint documentation, authentication configuration, rate-limit assumptions, error mapping, and evaluation results. Do not rely on a migration document that records only the original cutover; provider APIs and application requirements change independently.
For the next migration, make a copy of this working sequence:
- Freeze and record the current integration.
- Build the model, parameter, authentication, and error mapping.
- Create provider adapters and normalize responses.
- Run representative offline tests and review failures.
- Test staging traffic, observability, retries, and rollback.
- Roll out gradually with a named owner and a stop condition.
- Record differences discovered during rollout and schedule the next review.
This process turns switching LLM providers from an improvised endpoint replacement into a repeatable engineering decision. The result is easier comparison, safer rollback, and an application that is less tightly coupled to any single API contract.