og.cc.cd / guides / how-to-get-llm-api-keys

How to Get an LLM API Key: OpenAI, Claude, Gemini, DeepSeek, Qwen, Kimi, GLM and More

By og.cc.cd · Published · Updated · 5 min read

TL;DR: Every LLM API key follows the same path — open the vendor console, create a key, set up billing and check region rules, then send a first request; this page compares 10 vendors from their official docs.

Updated · All sources ↓

Every LLM API starts with the same chore: find the console, create a key, work out billing and region rules, and make a first call. This page compares ten providers side by side, using only what their official documentation says (checked 2026-10-20), and links to a step-by-step guide for each.

Count tokens before you spend →All guides

Comparison table

“Not stated” means the official pages we checked do not say — not that the answer is no. Region notes repeat the vendors’ own wording; they are not legal advice.

Where to get the key, and how to call it

ProviderConsole / key pageBase URLEnv varSample model
OpenAIplatform.openai.com/api-keyshttps://api.openai.com/v1OPENAI_API_KEYgpt-6-astra
Anthropicplatform.claude.com/settings/keyshttps://api.anthropic.com (native)ANTHROPIC_API_KEYNot given on the pages we checked
Google Geminiaistudio.google.com/apikeygenerativelanguage.googleapis.com (native)GEMINI_API_KEY or GOOGLE_API_KEYgemini-3.8-flash
DeepSeekplatform.deepseek.com/api_keyshttps://api.deepseek.comDEEPSEEK_API_KEYdeepseek-flash
Bailian (Beijing)bailian.console.aliyun.comhttps://dashscope.aliyuncs.com/compatible-mode/v1DASHSCOPE_API_KEYqwen-plus
Bailian (Singapore)modelstudio.console.alibabacloud.comhttps://dashscope-intl.aliyuncs.com/compatible-mode/v1DASHSCOPE_API_KEYqwen-plus
Xiaomi MiMoplatform.xiaomimimo.comhttps://api.xiaomimimo.com/v1MIMO_API_KEYmimo-v2.6-pro
Moonshot Kimiplatform.kimi.com/console/api-keyshttps://api.moonshot.cn/v1MOONSHOT_API_KEYkimi-k3
Zhipu (bigmodel.cn)bigmodel.cn/usercenter/proj-mgmt/apikeyshttps://open.bigmodel.cn/api/paas/v4Not prescribedglm-5.3
Z.aiz.ai/manage-apikey/apikey-listhttps://api.z.ai/api/paas/v4/Not prescribedglm-5.3
Volcengine ArkArk console → API Key 管理https://ark.cn-beijing.volces.com/api/v3ARK_API_KEYdoubao-seed-1-6-251015
OpenRouteropenrouter.ai/settings/creditshttps://openrouter.ai/api/v1OPENROUTER_API_KEY~openai/gpt-sol-latest

Sign-up rules and free quota

ProviderMainland-China signup note (official wording)Free quota (verified)
OpenAIMainland China, HK, Macau not on the supported-countries listFree usage tier ($100/month cap) in allowed geographies; credit amount not stated
AnthropicMainland China, HK, Macau not on the supported-regions listNot stated in the docs we checked
Google GeminiMainland China, HK, Macau not on the available-regions list; 18+Free Tier on some models; $300 GCP credit not usable
DeepSeekNo regional restriction mentioned in the docsGranted balance is used first; amount not stated
Bailian (Beijing)Free quota needs no real-name; pay-as-you-go needs real-name + top-upUsually 1M tokens per model, 90 days (Beijing models)
Bailian (Singapore)Complete account information first (since 2026-09-15)Usually 1M tokens per model, 90 days (Singapore, International scope)
Xiaomi MiMoXiaomi account (mobile sign-up); real-name before top-up“Welcome Bonus” page exists; amount not verified
Moonshot KimiPersonal verification before top-up¥15 voucher after verification (not for Kimi K3)
Zhipu (bigmodel.cn)API calls don’t currently require real-nameNot stated in the docs we checked
Z.aiNot stated in the docs we checkedNot stated in the docs we checked
Volcengine ArkReal-name + enable the model after the free quotaNew-user free inference quota per model (online inference only)
OpenRouterNo regional restriction mentioned; accepts AliPaySmall free allowance + :free models

Step-by-step guides

Region gotchas

  • OpenAI, Anthropic and Google Gemini do not list mainland China, Hong Kong or Macau as supported. OpenAI explicitly warns that access from outside its list may get an account blocked or suspended. Gemini also requires users to be 18+, and in Colab it goes by the runtime’s region.
  • Keys are often tied to a region or site. Alibaba Bailian keys, domains and models cannot be mixed between Beijing and Singapore. Xiaomi MiMo’s domestic and overseas accounts have separate keys and base URLs. Zhipu runs bigmodel.cn and z.ai as separate platforms.
  • Real-name verification is common on Chinese platforms, but timing differs: Bailian (China site) only needs it after the free quota; MiMo and Kimi need it before you top up; Volcengine needs it after the free quota (and models must be enabled); Zhipu does not currently require it for API calls.
  • “Free” has fine print. Google’s $300 Cloud credit cannot pay for the Gemini API (accounts opened after 2 March 2026); Kimi’s ¥15 voucher does not cover Kimi K3; Volcengine’s free quota does not cover batch inference; Bailian Singapore rolls into pay-as-you-go by default when the quota runs out.

Key safety basics

  1. Use environment variables. Every provider here documents one (Zhipu recommends one without naming it). SDKs such as OpenAI’s and Anthropic’s read theirs automatically.
  2. Never commit keys. Keep them in a .env file that is listed in .gitignore, or in a secrets manager (Anthropic’s recommendation). Google says plainly: don’t commit keys to Git.
  3. Keep keys out of browsers and mobile apps. OpenAI and Google say not to expose keys in client-side code; Alibaba Bailian offers short-lived temporary keys (up to 1,800 seconds) for that case.
  4. Restrict what a key can do. Gemini keys should be restricted to the Gemini API; Bailian keys can be limited to IPs and models; Volcengine keys to Model IDs, endpoints and IPs.
  5. Rotate, and replace leaks immediately. Create the new key first, switch your app over, then revoke or disable the old one (Google’s documented order). OpenAI says revocation takes effect within seconds. Keys that are shown only once (Anthropic, newer Bailian keys) cannot be recovered — just make a new one.
  6. More keys do not mean more quota. DeepSeek, Kimi and OpenRouter count limits per account or user, not per key.
# .env  (add ".env" to .gitignore before your first commit)
OPENAI_API_KEY=...
DEEPSEEK_API_KEY=...

# shell: load it for this session only
export DEEPSEEK_API_KEY="paste-your-key-here"

# check nothing secret is staged before you commit
git diff --cached | grep -nE 'sk-|API_KEY=' && echo "STOP: a key is staged"

Before you top up

Once a key works, the next question is what it will cost. Paste a real prompt into the token counter to see per-request cost across models, then use the LLM cost calculator for a monthly estimate with caching and off-peak options. Our API price comparison explains the price tables.

FAQ

Which providers can I sign up for from mainland China?

OpenAI, Anthropic and Gemini do not list mainland China as supported. The Chinese platforms here (Bailian, MiMo, Kimi, Zhipu, Volcengine) document mainland sign-up with real-name rules; DeepSeek’s and OpenRouter’s docs do not mention regional restrictions.

Which ones offer free usage?

Verified on official pages: Gemini’s Free Tier, Bailian’s new-user quota (usually 1M tokens per model for 90 days), Volcengine’s free inference quota, Kimi’s ¥15 voucher after verification, OpenRouter’s small allowance and :free models, and OpenAI’s Free usage tier. Others either don’t state an amount or we could not verify it.

Can one key work across providers?

Only through an aggregator such as OpenRouter, which puts many providers behind one key and one OpenAI-compatible base URL. Otherwise each provider issues its own keys.

Sources

Vendor features and prices were checked against these official pages on 2026-10-20. Products change; if something here no longer matches, the official page is right.

Related guides