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
| Concept | DeepSeek | OpenAI |
|---|---|---|
| SDK | openai + base_url | openai (no base_url) |
| Base URL | https://api.deepseek.com | default (remove it) |
| Auth | DEEPSEEK_API_KEY | OPENAI_API_KEY |
| Model | deepseek-chat / -reasoner | gpt-5.4 / gpt-5.4 mini / gpt-5.5 |
| Response | choices[0].message.content | choices[0].message.content (same) |
| Reasoning field | reasoning_content (reasoner) | reasoning models differ — see gotchas |
Before / after
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) 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_urlentirely — leaving it pointed at DeepSeek is the most common mistake. - Reasoning isn’t 1:1. If you used
deepseek-reasonerand readreasoning_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
- Remove the DeepSeek base URL and key from config; add the OpenAI key.
- Map
deepseek-chat→ a GPT tier that meets your quality bar (gpt-5.4orgpt-5.4 mini). - Re-price the workload — this migration usually increases cost.
- 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.