A complete migration guide — change 2 lines of code, save 80-99%
OpenAI's GPT-4o is excellent, but it's expensive. For many use cases, Chinese LLMs like DeepSeek V3 and Qwen3 deliver comparable or better quality at a fraction of the cost. This guide shows you exactly how to migrate in 5 minutes.
Go to /get-started and get your free API key with 50K tokens. No credit card required. You'll receive an OpenAI-compatible API key instantly.
If you're using the OpenAI Python SDK, you only need to change the api_key and base_url:
from openai import OpenAI
# BEFORE (OpenAI)
# client = OpenAI(api_key="sk-proj-...")
# AFTER (AI Token Hub)
client = OpenAI(
api_key="your-aitoken-key",
base_url="https://eaf9553505eeb8f5-115-190-107-107.serveousercontent.com/v1"
)
That's it! All your existing code works unchanged.
| OpenAI Model | → Replace With | Savings |
|---|---|---|
| GPT-4o | deepseek-v3 | 90% |
| GPT-4o-mini | qwen3-flash | 93% |
| GPT-4o (reasoning) | deepseek-r1 | 85% |
| GPT-3.5-turbo | glm-4-flash | 100% (FREE) |
response = client.chat.completions.create(
model="deepseek-v3", # Was "gpt-4o"
messages=[{"role": "user", "content": "Hello!"}],
temperature=0.7
)
# Same API, same parameters, 90% cheaper!
Run your existing tests with the new model. Most applications see identical or improved results. Key areas to verify:
# Smart routing: use cheap models for simple tasks
def smart_call(prompt, complexity="medium"):
if complexity == "low":
model = "glm-4-flash" # FREE
elif complexity == "medium":
model = "qwen3-flash" # $0.01/M
else:
model = "deepseek-v3" # $0.27/M
return client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": prompt}]
)
from langchain_openai import ChatOpenAI
# Just change these parameters
llm = ChatOpenAI(
model="deepseek-v3",
api_key="your-aitoken-key",
base_url="https://eaf9553505eeb8f5-115-190-107-107.serveousercontent.com/v1"
)
# Everything else works the same
result = llm.invoke("What is 2+2?")
"Are Chinese LLMs as good as GPT-4o?"
DeepSeek-V3 matches GPT-4o on MMLU, HumanEval, and GSM8K benchmarks. For Chinese language tasks, it often outperforms GPT-4o. For English-only tasks, the quality difference is minimal.
"What about data privacy?"
AI Token Hub routes through international endpoints. No data is stored or logged. API keys are scoped per account.
"Can I switch back?"
Yes! Since we use the OpenAI-compatible API, you can switch between providers by changing the base_url. Keep both configurations and switch as needed.