DeepSeek V4 family documentation

DeepSeek API: V4.1 Flash and V4 Pro rates & code

The DeepSeek API on AngelAPI gives developers OpenAI-compatible access to DeepSeek V4.1 Flash routes and DeepSeek V4 Pro using one prepaid MYR or USD token pack. Instead of provisioning separate billing keys or topping up USD cards with high minimums, you can start with a RM1.12 pack (10M prepaid tokens) and pay RM0.0186 per million input tokens on deepseek-v4.1-flash.

Live DeepSeek models and exact token rates

Every DeepSeek variant on AngelAPI exposes a 1M context window and 384K maximum output cap. In our 6 December 2026 live gateway snapshot, the Flash routes (deepseek-v4.1-flash) maintain high uptime (98.7%–100% over 24 hours), while heavier Pro supply fluctuates—so production apps should check live model status or keep a Flash fallback configured.

Model IDStatusContext / Max outInput mult (MYR / 1M)Output mult (MYR / 1M)Est. coding (MYR / 1M)
deepseek-v4-prooffline1M / 384K×3.164 (RM0.354)×9.492 (RM1.063)×1.4948 (RM0.167)
deepseek-v4.1-flashonline1M / 384K×0.1659 (RM0.0186)×0.6638 (RM0.0743)×0.0917 (RM0.0103)
deepseek-v4.1-flash-1017online1M / 384K×0.3308 (RM0.0370)×1.3232 (RM0.148)×0.1774 (RM0.0199)
deepseek-v4.1-flash-sgonline1M / 384K×1.3016 (RM0.146)×5.2062 (RM0.583)×0.7258 (RM0.0813)

Code examples: curl, Python, and Node.js

Set ANGELAPI_KEY in your local shell environment rather than hardcoding secrets in scripts. All chat models work with standard OpenAI client libraries when base_url points to https://api.angelapi.cc/v1.

curl
curl https://api.angelapi.cc/v1/chat/completions \
  -H "Authorization: Bearer $ANGELAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "Write a concise binary search in TypeScript."}]
  }'
Python (OpenAI SDK)
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.angelapi.cc/v1",
    api_key=os.environ["ANGELAPI_KEY"],
)

response = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Write a concise binary search in TypeScript."}],
)
print(response.choices[0].message.content)
Node.js (fetch)
const res = await fetch("https://api.angelapi.cc/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.ANGELAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "deepseek-v4.1-flash",
    messages: [{ role: "user", content: "Write a concise binary search in TypeScript." }],
  }),
})
const data = await res.json()
console.log(data.choices[0].message.content)

Streaming, reasoning flags, and API parameters

DeepSeek chat routes on AngelAPI accept standard OpenAI Chat Completions parameters including stream: true (Server-Sent Events for low time-to-first-byte inside terminal agents), temperature, and max_tokens. Models that expose multi-step reasoning also accept reasoning_effort tiers (such as low or high) to trade speed against depth without changing endpoint paths. Keep max_tokens explicit in production scripts so unexpected long-chain generations never consume more balance than budgeted.

Real DeepSeek cost per coding and chat workload

On AngelAPI, 1M prepaid pack tokens cost RM0.112 across every tier—whether you purchase a 10M starter pack for RM1.12 or a 100M pack for RM11.18. With DeepSeek V4.1 Flash’s estimated coding rate (×0.0917), a repository-aware coding loop costs roughly RM0.0103 per million repeated context tokens. For comparison: 10M raw input tokens on standard uncached chat at ×0.1659 take about 1.66M prepaid units (under RM0.19). If your assistant only summarizes diffs, emails, or pull requests, you can run thousands of concise requests inside a single RM1.12 pack before needing to top up. Review pack options below or study our AI API pricing guide and Claude Code session cost breakdown.

PackPrepaid tokensMYR priceRate per 1M units
10M10MRM1.12RM0.112
50M50MRM5.59RM0.112
100M100MRM11.18RM0.112
200M200MRM22.35RM0.112
300M300MRM33.53RM0.112
500M500MRM55.88RM0.112
1B1BRM111.77RM0.112

Production integration and security checklist

  • Keep keys server-side: Store ANGELAPI_KEY in environment secrets, proxy browser apps through your own backend, and rotate keys inside Account settings if exposed.
  • Build automatic model fallback: If your monitoring script detects deepseek-v4-pro marked offline on Status, fall back gracefully to deepseek-v4.1-flash.
  • Image inputs supported: DeepSeek V4.1 Flash handles uploaded images natively, so screenshots of logs or UI regressions can be passed through standard multimodal message payloads without an external OCR service.

Troubleshooting DeepSeek API requests

  • Model offline or 503 error: If DeepSeek V4 Pro is currently marked offline on model status, switch the model string to an online DeepSeek Flash variant.
  • 401 Unauthorized or 402 Insufficient Balance: Ensure the header sends Authorization: Bearer $ANGELAPI_KEY to https://api.angelapi.cc/v1/chat/completions and confirm remaining token balance inside your workspace dashboard.
  • Slow first token on long prompts: Large context inputs increase time-to-first-token; verify recent latency and 24-hour stability in the gateway monitor or use SSE streaming so users see incremental output.

Frequently asked questions

What is the difference between DeepSeek V4.1 Flash and DeepSeek V4 Pro on AngelAPI?

DeepSeek V4.1 Flash is tuned for low-latency coding and high-volume chat at ×0.1659 input and ×0.6638 output, whereas DeepSeek V4 Pro carries a heavier reasoning multiplier (×3.164 input / ×9.492 output) and experiences intermittent upstream availability.

Can I check if DeepSeek V4 Pro is online before running scripts?

Yes. The /status monitor probes every model every 10 minutes and shows exact 24-hour uptime history before your script sends paid traffic.

Do DeepSeek models on AngelAPI support large context windows?

Yes. All four live DeepSeek entries listed in the gateway feed support a 1M context window and up to 384K output tokens.

Which base URL should I use in the OpenAI SDK?

Point base_url to https://api.angelapi.cc/v1 with your AngelAPI key and call POST /chat/completions.