If you've tried to sign up for DeepSeek's official API from outside China, you already know the wall. It asks for a mainland China phone number to verify your account. No number, no API key. For most developers outside China, the conversation ends right there.
I ran into this exact problem and found a way around it that doesn't involve buying a virtual number or asking a friend in China for a favor. Here's the whole thing, including the code, so you can be calling DeepSeek in about five minutes.
What actually blocks you
DeepSeek's own platform gates API access behind real-name verification tied to a Chinese phone number. On top of that, topping up the balance usually means a Chinese payment method — Alipay, WeChat Pay, or a Chinese bank card. If you have neither the number nor the payment rail, you're stuck even though the model itself is fully documented and works great.
A lot of guides suggest workarounds. Some of them are sketchy, and some are outright against the platform's terms. You don't need any of that.
The way around it: an OpenAI-compatible endpoint
DeepSeek's model is exposed through an OpenAI-compatible API. That means anything that can talk to OpenAI can talk to DeepSeek, as long as it's pointed at the right base URL. The practical trick: use a gateway that hosts DeepSeek and the other open Chinese models, then talk to it with your normal OpenAI client code. The gateway handles the China-side signup and payment, so you never touch a phone number or a Chinese payment method.
There are a few of these. The one I use is keheai.com, mostly because it's dead simple and doesn't make you jump through hoops. But the code below works with any OpenAI-compatible gateway — swap the base URL and you're done.
The code
from openai import OpenAI
client = OpenAI(
base_url="https://keheai.com/v1",
api_key="YOUR_KEY", # from keheai.com/register — free trial quota, no card needed
)
resp = client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Explain the halting problem in one paragraph."}],
)
print(resp.choices[0].message.content)
Same thing with curl, for when you don't want a Python dependency:
curl https://keheai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-chat","messages":[{"role":"user","content":"Hello from outside China"}]}'
That's it. If you already use the OpenAI SDK or the Claude Code / Cursor style of pointing a tool at a custom backend, the only thing that changes is the two env vars: OPENAI_BASE_URL=https://keheai.com/v1 and OPENAI_API_KEY=YOUR_KEY.
Why DeepSeek specifically
DeepSeek's chat model is one of the best cost-to-performance ratios around right now, and the reasoning variant (deepseek-reasoner) is genuinely good at math and multi-step problems. If you've been locked out purely by the signup wall, you're missing a solid tool, not a novelty. The same gateway also exposes GLM, Kimi, Qwen, and MiniMax under the same key, so you're not locked into one lab.
The honest caveats
- You're going through a third party, not DeepSeek directly. That means a small markup on the per-token price, and you should read their data policy before sending anything sensitive.
- It's a gateway, not magic. If you need a hard SLA or a specific enterprise compliance cert, you should be talking to the lab directly — and that generally means the China signup anyway.
- Pricing is usage-based and shows clearly on the pricing page, so there's no "free forever then surprise bill" structure. The signup trial quota is enough to test the code above without entering a card.
I'm not affiliated with the gateway. I hit the phone-number wall, found this route, and it's worked reliably for the past few weeks. If you've been stuck on the same wall, this gets you unblocked in about five minutes.
Top comments (0)