Migrate existing OpenAI compatible applications

Replace addresses, credentials, and models in stages, and switch production after verifying compatibility.

When migrating existing applications, first keep the business input unchanged and use small traffic to compare protocols, quality and costs. Do not modify the address, prompt words, model parameters and retry logic at the same time, otherwise it will be difficult to locate the differences.

Step One: Backup and Inventory

Save the original Provider configuration and rollback method, and list the actually called Chat, Responses, images, tools, vectors or audio interfaces. Confirm whether the request is initiated by a browser, application service, background task, or plug-in, and create an independent site Key for testing.

Step 2: Replace connection parameters

Original configuration This site configuration
API Key API Key for this site
OpenAI SDK Base URL https://dunduntoken.com/v1
Handwritten Chat URL https://dunduntoken.com/v1/chat/completions
Model name Exact ID accessible by the current key
Management console address Cannot be used as a model API path

Applications that use environment variables can first adjust the test service:

export OPENAI_BASE_URL="https://dunduntoken.com/v1"
export OPENAI_API_KEY="$DUNDUN_API_KEY"

The variables must be securely set according to Quick Start; whether the application reads the variables depends on the code. After the service restarts, check the actual process, not just the current shell.

Step 3: Return by ability

  1. Use the same Key to query /v1/models.
  2. Minimum non-streaming text, check output structure and end reason.
  3. Streaming increment, normal completion, user cancellation and interruption.
  4. Multi-round history, tool call ID, result pairing and structured output.
  5. Media, vectors and background tasks actually used by the business.
  6. Timeout, 429, error display and call record ownership.

SDK methods such as Files and Fine-tunes cannot be assumed to be supported just because the base address is changed. Please see Interface Overview first. Responses’ input and Chat’s messages cannot be mixed by just changing the URL.

Step 4: Grayscale and rollback

Allocate a small percentage of traffic by user or business task and compare accuracy, latency, tool success rate, and actual consumption. Media creation may incur charges, do not double charge requests to test alternate services. In the event of failure, roll back the configuration and retain the desensitization request ID; expand traffic and revoke unused credentials after confirming stability.

Common migration differences

404 is common in duplicate /v1; 400 first remove parameters that are not supported by the model; the model with the same name still needs to verify the context and tools; the client estimate and the website cost may have different units. The migration list, observation interval, and rollback responsible person should be kept by the application itself.

SDK Complete Example · Error Troubleshooting