How to Run DeepSeek R1 & V3 API for Free
DeepSeek has revolutionized the AI landscape with its powerful open-source models that rival even the most expensive proprietary options. DeepSeek R1 and V3 have garnered attention from the tech community for their exceptional performance in reasoning, coding, and math tasks. In this tutorial, we'll explore multiple methods to access these powerful AI models completely free of charge.
Tired of Postman? Want a decent postman alternative that doesn't suck?
Apidog is a powerful all-in-one API development platform that's revolutionizing how developers design, test, and document their APIs.
Unlike traditional tools like Postman, Apidog seamlessly integrates API design, automated testing, mock servers, and documentation into a single cohesive workflow. With its intuitive interface, collaborative features, and comprehensive toolset, Apidog eliminates the need to juggle multiple applications during your API development process.
Whether you're a solo developer or part of a large team, Apidog streamlines your workflow, increases productivity, and ensures consistent API quality across your projects.
Table of Contents
- Understanding DeepSeek Models
- Method 1: Using Nebius AI Studio with OpenRouter
- Method 2: Integrating with Bolt.DIY
- Method 3: Using DeepSeek with Cursor IDE
- Method 4: Accessing via Kluster.ai
- Method 5: Using Hyperbolic
- Method 6: Direct API Integration
- Troubleshooting
Understanding DeepSeek Models
DeepSeek offers two flagship models that have gained significant traction in the AI community:
DeepSeek V3
DeepSeek V3 is their general-purpose large language model designed for a wide array of tasks including content generation, creative writing, and detailed explanations. It's particularly effective for long-form content and complex reasoning.
DeepSeek R1 (Reasoner)
DeepSeek R1, also known as DeepSeek Reasoner, is specifically optimized for tasks requiring step-by-step reasoning, mathematical problem-solving, and coding. It excels in scenarios where logical deduction and analytical thinking are paramount.
Both models are released under the permissive MIT license, allowing anyone to leverage, fine-tune, or host them according to their needs without commercial restrictions.
Method 1: Using Nebius AI Studio with OpenRouter
This method leverages Nebius AI Studio's free credits combined with OpenRouter's unified API gateway to access DeepSeek models without cost.
Step 1: Set Up Nebius AI Studio
- Sign up for a Nebius AI Studio account at nebius.ai
- Upon registration, you'll automatically receive $1 in free credits
- Navigate to your account dashboard and find the API Keys section
- Generate a new API key and copy it to a secure location for later use
Step 2: Configure OpenRouter
- Create an account on OpenRouter
- Go to the Models section and search for "DeepSeek"
- Browse the available models - you'll see options for both DeepSeek R1 and V3
- Select your preferred model to view provider details
- Locate the Nebius provider and click on the key icon to set up integration
- In the configuration popup, paste your Nebius API key and save
- Return to the OpenRouter dashboard and generate an OpenRouter API key
- Copy this key as you'll need it to access the models
Step 3: Test Your Configuration
To verify your setup is working correctly, you can make a direct API call:
curl https://api.openrouter.ai/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_OPENROUTER_API_KEY" \
-d '{
"model": "deepseek/deepseek-chat", # For V3
# "model": "deepseek/deepseek-r1", # For R1
"messages": [
{"role": "user", "content": "What are you capable of?"}
]
}'
Method 2: Integrating with Bolt.DIY
Bolt.DIY is an open-source development tool that lets you build AI-powered applications. Here's how to integrate DeepSeek models:
Step 1: Set Up Bolt.DIY
Clone the Bolt.DIY repository:
git clone https://github.com/ottomated/bolt.diy.git cd bolt.diy npm install
Launch the application:
npm run dev
Access the interface in your browser at
http://localhost:5173
Step 2: Modify the OpenRouter Integration
Navigate to the file
/app/lib/modules/llm/providers/open-router.ts
in your project directoryLocate the model definitions section
Modify or add an entry for DeepSeek models:
{ name: 'deepseek/deepseek-chat', // For V3 // name: 'deepseek/deepseek-r1', // For R1 label: 'Nebius-DeepSeek-V3', provider: 'OpenRouter', maxTokenAllowed: 8000, },
Step 3: Configure Bolt.DIY Interface
- In the Bolt.DIY interface, select "OpenRouter" as your provider
- Choose the "Nebius-DeepSeek-V3" option from the dropdown menu
- Enter your OpenRouter API key (generated in Method 1) when prompted
- Click the checkmark to save your configuration
- Start creating AI-powered applications with DeepSeek!
Method 3: Using DeepSeek with Cursor IDE
Cursor is an AI-enhanced code editor that can leverage DeepSeek models for coding assistance.
Step 1: Install Cursor
- Download and install Cursor from cursor.sh
- Launch the application and complete the initial setup
Step 2: Configure OpenRouter in Cursor
- Go to Settings > Models
- Click on "Add Model"
- Enter the appropriate model ID:
- For V3:
deepseek/deepseek-chat
- For R1:
deepseek/deepseek-r1
- For V3:
- Enable the OpenAI API Key toggle
- Paste your OpenRouter API key
- Override the OpenAI baseURL with OpenRouter's baseURL:
https://api.openrouter.ai/api/v1
- Click "Save" and then "Verify" to confirm your configuration
Step 3: Using DeepSeek in Cursor
- Open the Cursor chat panel
- Select your configured DeepSeek model from the dropdown menu
- Start coding and leverage DeepSeek's powerful code generation capabilities
Method 4: Accessing via Kluster.ai
Kluster.ai offers another route to access DeepSeek models with free credits.
- Create an account on kluster.ai
- Verify your email (check spam folder if necessary)
- Upon registration, you'll receive 100 free credits
- Navigate to the API section to generate an API key
- Use this key with your preferred API client or integration
Method 5: Using Hyperbolic
Hyperbolic is another service that provides access to DeepSeek models with free credits.
- Sign up for an account at Hyperbolic
- You'll receive 10 free credits upon registration
- Generate an API key from your account dashboard
- Use this key with your applications or even run the models on Kaggle for completely free usage
Using Hyperbolic with Kaggle
- Create a Kaggle account if you don't have one
- Start a new notebook
- Install the necessary packages:
!pip install hyperbolic-ai
- Connect to Hyperbolic:
from hyperbolic_ai import Hyperbolic client = Hyperbolic(api_key="YOUR_HYPERBOLIC_API_KEY")
- Use DeepSeek models:
response = client.chat.completions.create( model="deepseek/deepseek-r1", messages=[ {"role": "user", "content": "Solve this math problem: If x^2 + 5x + 6 = 0, what are the values of x?"} ] ) print(response.choices[0].message.content)
Method 6: Direct API Integration
You can also directly integrate with the DeepSeek API using their OpenAI-compatible format:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_DEEPSEEK_API_KEY",
base_url="https://api.deepseek.com"
)
response = client.chat.completions.create(
model="deepseek-chat", # For V3
# model="deepseek-reasoner", # For R1
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
stream=False
)
print(response.choices[0].message.content)
For Node.js:
import OpenAI from "openai";
const openai = new OpenAI({
baseURL: 'https://api.deepseek.com',
apiKey: 'YOUR_DEEPSEEK_API_KEY'
});
async function main() {
const completion = await openai.chat.completions.create({
messages: [
{role: "system", content: "You are a helpful assistant."},
{role: "user", content: "Hello!"}
],
model: "deepseek-chat", // For V3
// model: "deepseek-reasoner", // For R1
});
console.log(completion.choices[0].message.content);
}
main();
Troubleshooting
API Key Issues
- Double-check that your API keys are correctly copied and pasted
- Ensure you're using the right key for each service (Nebius, OpenRouter, etc.)
- Verify that your account has sufficient credits available
Model Access Problems
- Confirm that you're using the correct model ID:
- DeepSeek V3:
deepseek/deepseek-chat
ordeepseek-chat
- DeepSeek R1:
deepseek/deepseek-r1
ordeepseek-reasoner
- DeepSeek V3:
- Check if there are any region restrictions for your chosen provider
Integration Challenges
- For Bolt.DIY, ensure that you've properly modified the open-router.ts file
- When using Cursor, verify that the OpenRouter baseURL is correctly set
- If experiencing issues with direct API integration, check your network connectivity and firewall settings
Conclusion
DeepSeek's R1 and V3 models represent a significant advancement in open-source AI capabilities, delivering performance comparable to expensive proprietary alternatives. By leveraging the methods outlined in this tutorial, you can access these powerful models completely free of charge.
Whether you prefer working with Bolt.DIY, Cursor, or direct API integration, the flexibility of DeepSeek's models allows you to enhance your applications with state-of-the-art AI capabilities without breaking the bank. Start exploring the potential of DeepSeek today and unlock new possibilities for your projects!