Few things wreck a late-night deploy like a 402 from an API that was answering fine ten minutes ago. If you build on DeepSeek from outside China, the model is rarely the problem — the billing flow is. Card declines on domestic-only payment rails, verification that assumes a local mobile number, and a console written for a different market can turn a two-minute task into a two-day ticket.
This guide is the shortest reliable path from empty balance to a working key: how to top up, how to prove the credits actually landed, and how to make them last longer once they do.
Why DeepSeek Top-Ups Stall for International Developers
DeepSeek's first-party platform is genuinely strong on the model side — that's not in question. The friction is account-level. Many international cards get rejected by processors built for the Chinese market, some onboarding flows expect a local phone number, and invoicing for foreign companies follows a different queue again. None of that makes DeepSeek hard to use; it means buying credits directly from the source can put you in a payment stack designed for someone else.
That's the gap AiCredits fills. AiCredits sells DeepSeek API credits to international developers with card or PayPal — no Chinese phone number, no Chinese bank account. You keep the same OpenAI-compatible request shape and the same model names; you change one base URL. Current credit rates live at aicreditsapi.com/pricing, so check there rather than trusting any figure you read in a blog post (including this one).
The 5-Minute Top-Up, Step by Step
Create your account at aicreditsapi.com with an email address — no phone-verification loop, no regional app store dance.
Generate an API key and copy it immediately. Store it as an environment variable named AICREDITS_API_KEY, never inline in source or a notebook you might share.
Choose your credit amount. Pricing is per token, cache hits bill more cheaply than fresh input, off-peak requests cost less than peak, and deepseek-v4-pro costs more than deepseek-v4-flash because it does more work.
Pay by card or PayPal. Which one you use is a personal preference, not a compatibility decision — both complete in seconds.
Point your client at https://api.aicreditsapi.com/v1 and run the verification call below. If it prints a completion and a usage object, you're done.
Verify the Credits Landed With a Real Call
Never trust a dashboard alone. One API call tells you the key, the base URL, the model name, and the balance are all live at once.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AICREDITS_API_KEY"],
base_url="https://api.aicreditsapi.com/v1",
)
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Reply with the single word: ready"}],
max_tokens=8,
)
print(response.choices[0].message.content)
print(response.usage)
A populated usage object means tokens were actually billed against a funded account. A 401 means the key is wrong or unset; a 402 means the balance isn't in place yet. Two different problems, two different fixes — don't let your code blur them.
Catch a Low Balance Before It Breaks Production
The worst time to discover an empty balance is mid-request on a user-facing feature. Distinguish credit errors from generic failures so your logs and alerts tell you what to do.
import logging
import os
from openai import APIStatusError, OpenAI
client = OpenAI(
api_key=os.environ["AICREDITS_API_KEY"],
base_url="https://api.aicreditsapi.com/v1",
)
def ask(prompt: str) -> str:
try:
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": prompt}],
max_tokens=256,
)
except APIStatusError as exc:
if exc.status_code in (401, 402):
logging.critical(
"Auth/credit problem (HTTP %s). Check your balance, then retry. "
"Current rates: https://aicreditsapi.com/pricing",
exc.status_code,
)
raise
return response.choices[0].message.content
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
print(ask("Explain prompt caching in one sentence."))
Route 401 and 402 to a dedicated alert channel rather than returning a generic 500 to your users. A balance alert that fires when the account is nearly empty is worth ten apologetic incident reports.
Make Each Top-Up Go Further
Order prompts for cache hits. Put the stable part first — system instructions, schemas, few-shot examples — and the variable part last. Longer identical prefixes are far more likely to be served from cache, and cache hits are billed more cheaply than fresh input.
Move batch jobs off-peak. Off-peak requests cost less than peak ones, so nightly embedding refreshes and backfills are cheaper than the same work at midday.
Always set max_tokens. An uncapped generation can ramble for thousands of tokens nobody reads, and you pay for all of them.
Default to deepseek-v4-flash and escalate deliberately. Reserve deepseek-v4-pro for tasks where the extra reasoning genuinely changes the output — not as a default "better" switch.
Cache your own results. Store the id and a summary of completed calls so a retry doesn't re-bill a question you already answered.
Route Between Flash and Pro Instead of Defaulting to One
Cost control isn't about using the cheapest model everywhere; it's about matching model to task. Here's the smallest routing layer that does the job.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AICREDITS_API_KEY"],
base_url="https://api.aicreditsapi.com/v1",
)
SYSTEM = "You are a precise engineering assistant. Answer in under 120 words."
def answer(prompt: str, hard: bool = False) -> str:
model = "deepseek-v4-pro" if hard else "deepseek-v4-flash"
response = client.chat.completions.create(
model=model,
messages=[
{"role": "system", "content": SYSTEM},
{"role": "user", "content": prompt},
],
temperature=0.2,
max_tokens=400,
)
return response.choices[0].message.content
if __name__ == "__main__":
print(answer("Rewrite as a user-facing note: 'fix: null deref in webhook retry'"))
print(answer("Design a retry policy for a flaky webhook consumer.", hard=True))
| Task | Start with | Why |
|---|---|---|
| Classification, extraction, rewriting, chat replies | deepseek-v4-flash | Fast default; cheapest per token for high-volume work |
| Multi-step planning, tricky debugging, long-context analysis | deepseek-v4-pro | Stronger reasoning, costs more per token — use where accuracy matters |
| Bulk offline jobs (backfills, embeddings pipelines) | deepseek-v4-flash, off-peak | Off-peak runs cost less than peak runs |
| Anything strictly latency-sensitive and user-facing | deepseek-v4-flash | Keep the heavy model out of the critical path |
Frequently Asked Questions
Not through AiCredits. Sign up with an email address and pay by card or PayPal. If you buy through DeepSeek's own first-party console, the verification and payment requirements can differ.
In practice the balance is usable as soon as the payment confirms. Prove it with the verification call above — a returned completion with a usage object means you're funded and ready.
Yes. Set base_url to https://api.aicreditsapi.com/v1 and pass model="deepseek-v4-flash" or model="deepseek-v4-pro". Everything else — messages, streaming, tool calls — works the way you already write it.
deepseek-v4-flash as your default and deepseek-v4-pro when a task needs more reasoning. The older chat and reasoner aliases have been retired, so pin these names explicitly rather than relying on an alias that no longer resolves.
Requests fail with an HTTP 402 that surfaces as APIStatusError in the OpenAI SDK. Log it distinctly, alert on it, and top up at aicreditsapi.com — a re-run after funding picks up where the failure happened.
The fastest top-up is the one you never have to think about: fund the account, verify with one real call, route flash by default, and let a 402 alert tell you when it's time to top up again — not your users.
Still stuck at DeepSeek's checkout?
This article explains why the payment fails. If what you actually need is a working key today, there is a shorter path: prepaid DeepSeek credits, no subscription, key issued to your account right after checkout.
- $9 / $19 / $29 USD one-time credit packs — 1 USD = 500K credits (so $9 = 4.5M); billed by actual usage, never expires, tax excluded
- Card, Apple Pay, Google Pay or Alipay via Creem — no PayPal account needed
- Email signup only — no Chinese phone number, no Chinese bank account
- Same DeepSeek models and the same OpenAI-compatible API — change one base_url
Get a DeepSeek key → Or try it free first
Not sure how prepaid billing works? See the full DeepSeek API credits guide → — packs, usage-based billing, supported models and payment methods.