Migrating from DeepSeek to OpenAI: A Practical Guide

If you built on DeepSeek through its OpenAI-compatible API, moving to OpenAI is mostly removing the DeepSeek-specific config: drop the custom base URL, swap the key, and change the model. The request/response shapes are already the OpenAI shapes.

API concept mapping

DeepSeek → OpenAI (as of June 2026).
ConceptDeepSeekOpenAI
SDK openai + base_urlopenai (no base_url)
Base URL https://api.deepseek.comdefault (remove it)
Auth DEEPSEEK_API_KEYOPENAI_API_KEY
Model deepseek-chat / -reasonergpt-5.4 / gpt-5.4 mini / gpt-5.5
Response choices[0].message.contentchoices[0].message.content (same)
Reasoning field reasoning_content (reasoner)reasoning models differ — see gotchas

Before / after

Before — DeepSeek
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["DEEPSEEK_API_KEY"], base_url="https://api.deepseek.com")

resp = client.chat.completions.create(
  model="deepseek-chat",
  messages=[{"role": "user", "content": "Summarize the CAP theorem."}],
)
print(resp.choices[0].message.content)
After — OpenAI
from openai import OpenAI
client = OpenAI()  # OPENAI_API_KEY; no base_url

resp = client.chat.completions.create(
  model="gpt-5.4",
  messages=[{"role": "user", "content": "Summarize the CAP theorem."}],
)
print(resp.choices[0].message.content)

Gotchas

Watch for these
  • Drop base_url entirely — leaving it pointed at DeepSeek is the most common mistake.
  • Reasoning isn’t 1:1. If you used deepseek-reasoner and read reasoning_content, OpenAI’s reasoning models surface thinking differently; adjust how you capture/cost it.
  • Pricing jumps. OpenAI models are typically far pricier than DeepSeek — re-budget before cutover with the cost calculator.
  • Re-tune prompts and re-run evals; behavior and formatting differ.

What to do next

  1. Remove the DeepSeek base URL and key from config; add the OpenAI key.
  2. Map deepseek-chat → a GPT tier that meets your quality bar (gpt-5.4 or gpt-5.4 mini).
  3. Re-price the workload — this migration usually increases cost.
  4. Going the other way? See OpenAI → DeepSeek.

Frequently asked questions

How hard is DeepSeek → OpenAI?
Easy — you're already on the OpenAI API shape via DeepSeek's compatibility layer. Remove the custom base URL, swap the key, and pick an OpenAI model. The main work is re-tuning prompts and re-pricing.
What replaces deepseek-reasoner?
Use an OpenAI reasoning-capable model for chain-of-thought tasks. Note that how reasoning tokens are exposed and billed differs from DeepSeek's reasoning_content, so revisit any code that read that field.
Will my costs change?
Almost certainly up — DeepSeek is among the cheapest providers. Run your real token counts through the cost calculator before committing so the increase doesn't surprise you.