Models and prices / deepseek-v4.1-flash-1017

deepseek-v4.1-flash-1017 43% off

DeepSeek · Call deepseek-v4.1-flash-1017 through the AIFans API API and pay for the tokens you use.

OpenAI compatibleAnthropic compatible

Pricing

Item (USD per 1M tokens)Price
Input$0.3$0.171
Cached input$0.0034
Output$1.2$0.684
  • Send deepseek-v4.1-flash-1017 as the model.
  • Cached input is the part of a prompt served from the context cache. The struck-through price is the model maker's own price.
  • Thinking is billed as output tokens. Set max_tokens to 1000 or more, or the budget may go to thinking alone.
  • When you do not need reasoning, add "thinking": {"type": "disabled"} to the request, or use "reasoning_effort": "low": simple tasks get noticeably cheaper and faster.

Specs

APIsOpenAI Chat Completions, Anthropic Messages
Reasoning (thinking)Yes, billed as output tokens

Call it with the OpenAI API

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-1017", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 1000}'
# pip install openai
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.aifans.fan/v1")
resp = client.chat.completions.create(
    model="deepseek-v4.1-flash-1017",
    messages=[{"role": "user", "content": "Hello"}],
    max_tokens=1000,
)
print(resp.choices[0].message.content)

Use it in Claude Code

Put this in ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json) and start Claude Code.

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.aifans.fan",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_MODEL": "deepseek-v4.1-flash-1017",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4.1-flash-1017",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4.1-flash-1017",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4.1-flash-1017",
    "CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4.1-flash-1017"
  }
}