DeepSeek-R1 Architecture & Reasoning API: How Open Reasoning Models Work
DeepSeek-R1 is an open-weights reasoning model that uses large-scale Reinforcement Learning (RL) without supervised fine-tuning warm-up (R1-Zero) followed by cold-start multi-stage training to produce transparent chain-of-thought thinking tokens at 90% lower API inference costs than proprietary models.
1.The Pure RL Paradigm (DeepSeek-R1-Zero to R1)
2.Reasoning Tokens & Thinking Token Accounting
3.Distilled Small Models (R1-Qwen and R1-Llama)
from openai import OpenAI
client = OpenAI(
base_url="https://api.apihundred.com/v1",
api_key="your_api100_key"
)
# DeepSeek-R1 streams reasoning_content alongside standard content
stream = client.chat.completions.create(
model="deepseek-r1",
messages=[
{"role": "user", "content": "Prove that there are infinitely many primes p such that p+2 is not prime."}
],
stream=True
)
for chunk in stream:
delta = chunk.choices[0].delta
# Check for thinking token stream
if hasattr(delta, "reasoning_content") and delta.reasoning_content:
print(f"[Thinking]: {delta.reasoning_content}", end="", flush=True)
elif delta.content:
print(delta.content, end="", flush=True)Frequently Asked Questions
How does DeepSeek-R1 differ from OpenAI o1?
DeepSeek-R1 is an open-weights model with transparent chain-of-thought tokens accessible via standard API fields (reasoning_content), whereas OpenAI o1 is closed-source and suppresses raw thinking tokens for commercial privacy.
Do thinking tokens count against API rate limits and token billing?
Yes. Reasoning tokens consume GPU compute during inference and are billed as input or completion tokens according to the gateway pricing matrix.
What is GRPO in DeepSeek-R1?
Group Relative Policy Optimization (GRPO) evaluates outputs against a group baseline rather than requiring an explicit critic neural network, drastically reducing GPU VRAM training requirements.

