Model API

Deepseek R1 API

Deepseek R1 routed by the Aiduct API gateway.

Model ID

deepseek-r1

Provider

zenmux

Capability

chat

Status

Available

Pricing and limits

Pricing is not published for this model yet. Use the model catalog and dashboard usage records for current availability.

Use this model

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AIDUCT_API_KEY,
  baseURL: "https://api.aiduct.ai/v1",
});

const response = await client.chat.completions.create({
  model: "deepseek-r1",
  messages: [{ role: "user", content: "Say hello in one sentence." }],
});

Supported parameters

messagestemperaturetop_pmax_tokensstreamstoptoolstool_choiceresponse_formatuser

What is Deepseek R1?

Deepseek R1 is a large language model developed by DeepSeek, designed with an emphasis on advanced reasoning capabilities. The model builds on the foundation of deep learning architectures optimized for complex problem-solving, multi-step logic, and technical tasks that require careful chain-of-thought processing. Unlike general-purpose chat models, R1 is engineered to excel at scenarios where accuracy and structured reasoning matter more than conversational fluency alone.

When you access Deepseek R1 through Aiduct, you're connecting to an intelligent routing layer that selects optimal infrastructure for your request. The Aiduct gateway handles provider failover, load balancing, and protocol translation, so you can focus on building features rather than managing vendor integrations.

What Deepseek R1 Does Best

Deepseek R1 shines in workloads that demand methodical reasoning and precision. If your application involves mathematical problem-solving, code generation with correctness constraints, technical documentation analysis, or multi-step logical inference, R1 is purpose-built for these scenarios.

The model performs particularly well on:

  • Mathematical reasoning: solving algebra, calculus, and competition-level math problems with step-by-step derivations.
  • Code synthesis and debugging: generating correct implementations for algorithmic challenges and identifying subtle bugs in existing code.
  • Structured analysis: breaking down complex technical specifications, legal documents, or research papers into actionable insights.
  • Multi-hop question answering: chaining together facts from multiple sources to arrive at a coherent conclusion.

R1 is less optimized for creative writing, casual conversation, or tasks where stylistic variety is the primary goal. If you need a model that can produce marketing copy or engage in open-ended dialogue, consider a general-purpose chat model instead.

Who Should Use Deepseek R1

Deepseek R1 is ideal for backend and full-stack engineers building applications where correctness and logical rigor are non-negotiable. Common use cases include:

  • Developer tools: AI-powered code review, automated test generation, and debugging assistants that need to understand control flow and edge cases.
  • Education platforms: tutoring systems that walk students through problem-solving steps in STEM subjects.
  • Research and analytics: tools that parse academic papers, extract structured data, and synthesize findings across multiple documents.
  • Enterprise automation: agents that interpret technical specifications, validate compliance requirements, or generate audit reports.

If your users expect the model to "show its work" or if incorrect outputs have meaningful downstream costs, R1's reasoning-first design is a strong fit.

How to Call Deepseek R1 via Aiduct

Aiduct exposes Deepseek R1 through an OpenAI-compatible endpoint at https://api.aiduct.ai/v1. You can use the standard OpenAI SDK or any HTTP client that supports the ChatCompletion format.

Python Example (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.aiduct.ai/v1",
    api_key="your-aiduct-api-key"
)

response = client.chat.completions.create(
    model="deepseek-r1",
    messages=[
        {"role": "system", "content": "You are a helpful assistant specializing in mathematical reasoning."},
        {"role": "user", "content": "Prove that the square root of 2 is irrational."}
    ],
    temperature=0.7
)

print(response.choices[0].message.content)

cURL Example

curl https://api.aiduct.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-aiduct-api-key" \
  -d '{
    "model": "deepseek-r1",
    "messages": [
      {"role": "system", "content": "You are a technical assistant."},
      {"role": "user", "content": "Explain the time complexity of quicksort in the worst case."}
    ],
    "temperature": 0.5
  }'

Both examples work identically to OpenAI's API. If you're migrating from OpenAI, you only need to change the base_url and api_key fields.

Pricing and Cost Considerations

Aiduct's pricing for Deepseek R1 is usage-based and calculated per token. Because pricing can change as upstream providers adjust their rates, we do not publish static numbers on this page. For current input and output token costs, visit the Aiduct pricing page.

When evaluating cost, consider that reasoning models often generate longer outputs than general-purpose chat models. If R1 produces a detailed step-by-step proof, you'll pay for those additional output tokens. For cost-sensitive applications, you can tune max_tokens to cap response length or use temperature to control verbosity.

Deepseek R1 via Aiduct vs. Direct Provider Access

Accessing Deepseek R1 through Aiduct offers several operational advantages over integrating directly with DeepSeek or other providers:

  • Unified interface: Aiduct supports OpenAI ChatCompletion, OpenAI Responses, and Anthropic Messages protocols on the same API key. You can switch models or providers without rewriting client code.
  • Intelligent routing: The Aiduct gateway routes requests to the best available infrastructure, handling failover and load balancing transparently.
  • Single billing relationship: One invoice for all models, regardless of upstream provider. No need to manage separate accounts, credits, or rate limits across vendors.
  • Protocol translation: If you prefer Anthropic's Messages format but want to call Deepseek R1, Aiduct translates the request automatically.

Direct provider access gives you the lowest possible latency and full control over provider-specific features. If you're building a latency-critical application and only need one model, direct integration may be simpler. For teams managing multiple models or prioritizing operational flexibility, Aiduct's abstraction layer reduces maintenance overhead.

Common Gotchas and Best Practices

Reasoning Models Generate Longer Outputs

Deepseek R1 is trained to produce detailed explanations and intermediate steps. If you're used to concise answers from general-purpose models, you may see 2-3x more tokens in R1's responses. Set max_tokens appropriately to avoid unexpected costs or truncated outputs.

Temperature Affects Reasoning Quality

For tasks that require deterministic correctness—like code generation or mathematical proofs—use a low temperature (0.2-0.5). Higher temperatures introduce variability that can break logical chains. If you need creative exploration, test incrementally rather than jumping to temperature=1.0.

System Prompts Matter

R1 responds well to explicit instructions about reasoning style. If you want concise answers, say so in the system prompt. If you need the model to show intermediate steps, request it explicitly. Vague prompts like "be helpful" produce less predictable results.

Rate Limits and Retries

Aiduct enforces per-key rate limits to ensure fair resource allocation. If you hit a 429 response, implement exponential backoff in your client. The OpenAI SDK handles retries automatically, but custom HTTP clients need explicit logic.

Model Versioning

The deepseek-r1 identifier points to the current production version of the model. DeepSeek may release updates or new variants over time. If you need to pin a specific model version, check the Aiduct documentation for versioned identifiers (e.g., deepseek-r1-20240101).

Getting Started

To start using Deepseek R1 via Aiduct:

  1. Sign up for an Aiduct account and generate an API key.
  2. Replace your existing OpenAI base URL with https://api.aiduct.ai/v1.
  3. Set model="deepseek-r1" in your ChatCompletion request.
  4. Monitor token usage and adjust max_tokens or temperature as needed.

Aiduct's OpenAI-compatible interface means you can integrate R1 into existing codebases with minimal changes. If you're already using the OpenAI SDK, the migration takes minutes rather than hours.

When to Choose Deepseek R1

Choose Deepseek R1 when correctness and structured reasoning are your top priorities. If your application involves technical problem-solving, code generation, or multi-step analysis, R1's architecture is optimized for these workloads. For conversational AI, creative writing, or tasks where stylistic flexibility matters more than logical rigor, a general-purpose chat model may be a better fit.

Aiduct's unified API makes it easy to test multiple models side-by-side. You can compare R1's reasoning quality against other providers without rewriting client code or managing separate integrations. For production workloads that demand both reasoning depth and operational reliability, Deepseek R1 via Aiduct delivers the performance and flexibility modern engineering teams need.

FAQ

How do I switch from OpenAI to Deepseek R1 on Aiduct?+

Change your OpenAI client's base_url to https://api.aiduct.ai/v1 and set model to 'deepseek-r1'. Your existing code and API key management remain the same.

Does Deepseek R1 support function calling or tool use?+

Function calling support depends on the upstream model capabilities. Check the Aiduct documentation for current feature availability, as DeepSeek may add tool use in future releases.

Why are R1's responses longer than other models?+

Deepseek R1 is trained to produce detailed reasoning steps. For concise outputs, lower max_tokens or explicitly request brevity in your system prompt.

Can I use Deepseek R1 with the Anthropic Messages protocol?+

Yes. Aiduct natively supports Anthropic Messages, OpenAI ChatCompletion, and OpenAI Responses on the same API key, with automatic protocol translation.

What temperature should I use for code generation with R1?+

Use 0.2-0.5 for deterministic correctness. Higher temperatures introduce variability that can break logical reasoning in code synthesis tasks.

How does Aiduct handle failover if Deepseek R1 is unavailable?+

Aiduct's routing layer automatically retries on alternative infrastructure. You'll see standard HTTP error codes if all upstream providers are down.

Last refreshed Jul 9, 2026