OpenAI and Anthropic compatible · Pay as you go
Top AI models, lower prices.
One API.
AIFans API gives developers one API for DeepSeek, GLM and MiniMax models. Every model is priced per token at or below its maker's own price, many well below. No subscription, no minimum spend.
Verify your email and get $1 free credit · Invite friends and earn 5% of their spend (details)
Featured models
The same models as their makers' own APIs, priced per token at or below the makers' prices.
DeepSeek V4.1 Flash
deepseek-v4.1-flash
DeepSeek's Flash model. Fast and inexpensive, with about 1M tokens of context, tool calls and image input. A good default for coding assistants, agents and everyday chat.
GLM-5.3
glm-5.3
Zhipu AI's flagship GLM model for coding, agents and long-context work, with tool calls.
Why AIFans API
Works with your tools
OpenAI Chat Completions and Anthropic Messages, both with streaming. Claude Code, Cursor, Cline and any OpenAI SDK: change the base URL and key. Guides
Every model, one key
DeepSeek, GLM and MiniMax: switch by changing the model name. Each model has its own price and setup page.
Failed calls are free
You pay only for calls that succeed, by the actual tokens. A call that fails on our side is never billed.
Spending under control
Give each key its own daily, monthly or total spending limit, an IP allow-list and a model list, so a runaway script cannot drain your balance.
Every call accounted for
Tokens and cost of every request, totals by model and by key, CSV export. Try any model in the Playground before you write code.
Your prompts stay yours
We do not store the content of your requests or the answers. We keep usage records only: model, tokens, cost and time, so you can check every charge.
Start in three steps
Create an account
Sign up with your email. No credit card needed to look around.
Add credit
Pay by card or PayPal, from $5. Credit never expires.
Get your API key
Create a key and point your OpenAI or Anthropic client at https://api.aifans.fan.
Quick start
Replace the key with yours. Any OpenAI SDK works the same way.
Python · OpenAI SDK
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.aifans.fan/v1",
)
r = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)Claude Code · ~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.aifans.fan",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"ANTHROPIC_MODEL": "glm-5.3",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4.1-flash"
}
}curl https://api.aifans.fan/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash", "messages": [{"role": "user", "content": "Hello"}]}'Models and prices
USD per 1M tokens. Input and output are billed on actual usage.
| Model (the model you send) | Input | Cached input | Output |
|---|---|---|---|
| deepseek-v4.1-flash 35% off | $0.3$0.195 | $0.0039 | $1.2$0.78 |
| deepseek-v4.1-flash-1017 43% off | $0.3$0.171 | $0.0034 | $1.2$0.684 |
| glm-5.3 42% off | $1.4$0.812 | $0.1508 | $4.4$2.552 |
| glm-5.3-flash 42% off | $0.15$0.087 | $0.0174 | $0.5$0.29 |
| glm-5.2 34% off | $1.4$0.924 | $0.1716 | $4.4$2.904 |
| minimax-m3.1-flash | $0.15 | $0.015 | $0.6 |
| mimo-v2.6-flash | $0.1344 | $0.0038 | $0.3648 |
| qwen3.8-27b 43% off | $0.425$0.2422 | $0.0485 | $2.55$1.4535 |
- “N% off” means that much below the model maker's own price (struck through) on every item; click a model for details. Cached input is the part of a prompt served from the context cache, at a lower rate.
- Reasoning models think before they answer; thinking is billed as output tokens.
- Prices may change. We announce changes in the console in advance; the price shown in the console when you make a call applies.
Billing
Prepaid, pay as you go
Add credit, and each call is deducted from your balance by the tokens it used. When the balance runs out, calls are refused: you never get a surprise bill.
Top up by card or PayPal
Top up from $5 to $2000 at a time with PayPal or a card; the credit is added as soon as the payment completes. A payment processing fee of 5.5% (at least $0.8) is added at checkout.
Usage and statements
Daily spend chart, totals by model and by key, every call and every top-up in the console, all exportable as CSV.
Invite friends, earn credit
1. Copy your link
Sign in and copy your personal invite link from the Invite friends page of the console.
2. Friends sign up
Your friends sign up through the link, verify their email and use the API as usual.
3. You earn 5%
For 180 days you get 5% of what each friend spends, as vouchers settled daily and valid on every model.
Rewards are a share of what friends actually pay from their balance; top-ups and spending paid by vouchers do not count. Up to $30 per friend and $75 per month. Vouchers cannot be withdrawn. Accounts created from the inviter's own network do not count, and we may cancel rewards earned through fake sign-ups.
Start building in minutes
One key for DeepSeek, GLM and MiniMax. Pay only for what you use.
About us
- [email protected]