AiCredits
Freelance Ops

DeepSeek API for Freelancers: Getting Paid and Paying for Credits

How freelancers bill clients for DeepSeek API work and buy credits with a card or PayPal — plus runnable Python for per-client token tracking and invoicing.

Published 2026-09-23 Updated 2026-09-23 6 min

Freelancing with the DeepSeek API has two money problems, and most tutorials only cover one. The first is getting paid: you shipped an AI feature, the client is happy, and now you have to turn a messy work log into something a finance department will actually approve. The second is paying: the API runs on prepaid credits, and if you live outside mainland China, topping up the first-party console is often a dead end.

This post fixes both. You'll get a payment route that works with an international card or PayPal, a sane way to split labor between deepseek-v4-flash and deepseek-v4-pro, and two runnable Python scripts — one that converts your raw work log into invoiceable line items, one that tracks token usage per client so you can rebill it instead of eating the cost.

Paying for credits without a Chinese phone number or bank card

DeepSeek's own platform is built around Chinese payment rails and identity verification. If that isn't you, the usual workarounds are grim: asking a friend to top up, buying resold keys from a stranger (never do this — you're handing someone your prompts and your client data), or abandoning DeepSeek for a more expensive model family you didn't actually want.

AiCredits exists for this exact gap. You buy DeepSeek API credits with an international card or PayPal, no Chinese phone number or bank account involved, and you point the standard OpenAI SDK at the AiCredits endpoint. Nothing else in your code changes, which matters when you're maintaining five client repos at once.

Install once and you're done:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AICREDITS_API_KEY"],
    base_url="https://api.aicreditsapi.com/v1",
)

reply = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Summarize 'shipped the export fix' in one line."}],
)
print(reply.choices[0].message.content)

Pick the model per task, not per project

DeepSeek gives you two practical choices: deepseek-v4-flash as the fast default, and deepseek-v4-pro when a job genuinely needs more reasoning. The classic freelancer mistake is choosing one and using it for the entire engagement. Flash is cheap enough to run on every call; pro costs more, so you spend it deliberately, the way you'd spend your own billable hours.

  • deepseek-v4-flash — your default. Summaries, classification, field extraction, drafting, chat scaffolding, and code generation on well-specified tasks all live here.

  • deepseek-v4-pro — reserve it for the parts the client is actually paying a premium for: architectural review, gnarly debugging, spec or contract analysis, and the final pass on client-facing copy.

  • Prompt caching — if every call repeats the same long prefix (a style guide, a JSON schema, a repo summary), put the stable part first. Cache hits are cheaper than fresh input, so prompt layout is a billing decision.

  • Off-peak scheduling — batch jobs run outside peak hours cost less than the identical calls at peak times. If a job isn't urgent, don't run it at 2pm.

SituationModelWhy
Client updates, tagging, extraction over hundreds of recordsdeepseek-v4-flashFast default; more than enough for structured output
Debugging a race condition in a client's codebasedeepseek-v4-proStronger reasoning earns its higher cost here
Overnight batch over a ticket backlogdeepseek-v4-flash, off-peakOff-peak calls cost less than peak
Final polish on the deliverable the client readsdeepseek-v4-proOne last-mile pass, not the whole pipeline

Turn a messy work log into invoiceable line items

Here's flash doing something that pays for itself immediately. You keep a blunt daily log; the model reshapes it into grouped, client-friendly line items and returns JSON so you can pipe it straight into your invoicing template.

import json
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AICREDITS_API_KEY"],
    base_url="https://api.aicreditsapi.com/v1",
)

WORK_LOG = """Mon 3.0h  fixed the CSV export bug the client reported
Tue 2.5h  discovery call + revised wireframes
Wed 1.5h  reviewed their data model, wrote migration notes
Thu 4.0h  implemented the dark mode toggle
Fri 0.5h  status email
"""

SYSTEM = (
    "You convert a freelancer's raw work log into invoice line items. "
    "Group related work, keep hours in quarter-hour increments, and write "
    "descriptions a non-technical client can approve without asking questions. "
    'Reply with JSON only, shaped like {"line_items": [{"description": "...", "hours": 1.25]}.'
)

resp = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[
        {"role": "system", "content": SYSTEM},
        {"role": "user", "content": WORK_LOG},
    ],
    temperature=0.2,
)

raw = resp.choices[0].message.content.strip()
raw = raw.removeprefix("```json").removeprefix("```").removesuffix("```").strip()
data = json.loads(raw)

total = 0.0
for item in data["line_items"]:
    hours = float(item["hours"])
    total += hours
    print(f"{hours:>5.2f}h  {item['description']}")

print(f"{total:>5.2f}h  TOTAL")
print(f"{resp.usage.total_tokens} tokens used")

If you prefer to write the invoice yourself, run the same script and ask for a summary email instead — the value is the same. Ten minutes of reformatting per client per month adds up to a day of unbilled admin a year.

Track tokens per client so you can rebill them

Most freelancers quietly absorb API costs, which is how a profitable project becomes an unprofitable one. Wrap every call in a helper that attributes usage to a client name, then either bill it through as a pass-through line item or use the number to check whether your effective hourly rate is what you thought it was.

import os
from collections import defaultdict
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AICREDITS_API_KEY"],
    base_url="https://api.aicreditsapi.com/v1",
)

usage_by_client = defaultdict(int)


def summarize(client_name: str, work_log: str, model: str = "deepseek-v4-flash") -> str:
    resp = client.chat.completions.create(
        model=model,
        messages=[
            {"role": "system", "content": "Summarize this work log as three bullet points for a client update email."},
            {"role": "user", "content": work_log},
        ],
        temperature=0.3,
    )
    usage_by_client[client_name] += resp.usage.total_tokens
    return resp.choices[0].message.content.strip()


print(summarize("Acme Corp", "Fixed the export bug; reviewed their data model; wrote migration notes."))
print(summarize("Beta Studio", "Built the dark mode toggle; sent a status email."))

# The last-mile summary a client actually reads: use the stronger model.
print(summarize("Acme Corp", "Fixed the export bug; reviewed their data model.", model="deepseek-v4-pro"))

for name, tokens in usage_by_client.items():
    print(f"{name}: {tokens} tokens")

The pattern scales cleanly: deepseek-v4-flash everywhere, deepseek-v4-pro on the last mile. For current credit rates and how off-peak and cache pricing works, check aicreditsapi.com/pricing — the numbers change, the structure of the decision doesn't.

Getting paid: contract terms that survive scope creep

  • Take a deposit before you touch the API. Credits are consumed the moment a request returns, whether or not the invoice ever clears.

  • Put a pass-through clause in the contract: "third-party API usage billed at cost" or folded into your blended rate. Either is fine. Silence is not.

  • Never ship your API key inside a client's repository. Proxy requests through your own backend so the key stays yours and you can revoke it the day the engagement ends.

  • Keep one key or sub-account per client. Attribution becomes free instead of a spreadsheet argument.

  • Bill API usage as its own line item. Clients approve a concrete infrastructure charge faster than an unexplained bump to your hourly rate.

Rule of thumb: flash is your default, pro is your closer, and the client pays for both.

OpenRouter, OpenAI, or DeepSeek credits directly?

OpenRouter is genuinely good at what it does — one key across dozens of models, simple routing, and a clean dashboard for comparing outputs. If you hop between model families on every task, it's a reasonable home base. The tradeoff is that you're paying for a routing layer, and your DeepSeek traffic is one product among many rather than the thing the service is built around.

OpenAI's ecosystem is the most mature in the industry: the SDK everyone already knows, the widest third-party tooling, and documentation that rarely leaves you guessing. If a client mandates it, use it without argument. But it's a different model family with a different pricing shape, and it isn't DeepSeek.

If DeepSeek is your workhorse, buying credits from a DeepSeek-focused provider is simpler: international card or PayPal, an OpenAI-compatible endpoint, no currency conversion gymnastics, and no dependency on a payment rail you don't have. AiCredits also ships code linting tools, which matters more than it sounds — when you hand a repo back to a client, clean code is what makes the next invoice easy to approve. Current rates are at aicreditsapi.com/pricing.

Frequently asked questions

Can I use the DeepSeek API without a Chinese phone number or bank account?

Yes. Buy credits with an international card or PayPal through a provider like AiCredits, then point the OpenAI SDK at base_url="https://api.aicreditsapi.com/v1" with model="deepseek-v4-flash". No Chinese phone number, bank card, or Alipay account is required.

How do I bill clients for API usage?

Track tokens per client with a wrapper function, then either invoice it as a pass-through line item at cost or fold it into your rate with a margin. Either way, put the clause in the contract before work starts so there's no negotiation after delivery.

Should I use deepseek-v4-pro for everything?

No. It costs more than deepseek-v4-flash, and most freelancer tasks — summaries, extraction, drafting, bulk classification — don't need the extra reasoning. Default to flash and switch to pro for architectural review, hard debugging, and the final client-facing pass.

Why does my bill vary month to month for the same workload?

Volume isn't the only variable. Off-peak calls cost less than peak calls, and cache hits cost less than fresh input, so how you schedule jobs and structure prompts changes the total. See aicreditsapi.com/pricing for current rates.

Is it safe to give a client my API key?

No. Proxy requests through your own backend so the key stays under your control, usage stays attributable, and you can revoke access the moment the project ends.

Try Lint in 2 seconds

Wrote something? Paste it here for a free grammar check. No account needed.

More Tools →

Related Tools

💻Code Explainer

Was this article helpful?

| Share on X Reddit Copy link

服务器宕机了?别等用户告诉你

Wakeless 梦哨 帮你 30 秒监控网站 / API / SSL 证书,宕机秒级告警到邮箱、飞书、Slack。免费档 30 个监控,永久免费,无需信用卡。

免费开始监控 →
💬
反馈意见 / Feedback ×