DeepSeek-R1 — Free API

Created by DeepSeek ⭐ Score: 46
github-models/deepseek-r1
🛠️ Function Calling JSON Mode chat reasoning

What is DeepSeek-R1?

DeepSeek-R1 is a reasoning-specialized model that uses chain-of-thought deliberation before producing final answers, making it particularly strong at math, logic puzzles, and multi-step coding problems. Available free on GitHub Models with 64K context and 8K output, it is fully OpenAI SDK-compatible — swap in the GitHub Models base URL and your GitHub token to use it with any OpenAI-compatible tool. The free tier allows up to 15 RPM and 150 requests per day, somewhat more generous than the GPT-4 family on GitHub Models. If your task benefits from explicit step-by-step reasoning rather than fast single-pass generation, R1 is one of the strongest free reasoning models available.

Model ID
deepseek-r1
Base URL
https://models.github.ai/inference

DeepSeek-R1 API Code Example

Paste your API key and run. See the config generator for Claude Code, Cursor, and more tools.

from openai import OpenAI

client = OpenAI(
    base_url="https://models.github.ai/inference",
    api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="deepseek-r1",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://models.github.ai/inference",
  apiKey: "YOUR_API_KEY",
});

const completion = await openai.chat.completions.create({
  model: "deepseek-r1",
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(completion.choices[0].message.content);
curl https://models.github.ai/inference/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "deepseek-r1",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Other Free Models from GitHub Models

More About GitHub Models

How to get an API key, rate limits, platform limitations, and tool configuration — everything you need to set up GitHub Models as a free LLM API backend.

View GitHub Models full guide →