APIMart
Back to all models

DeepSeek R1 API

DeepSeekModel ID deepseek-r1Text modelReleased January 20, 2025

Use DeepSeek R1 to solve a sequence problem step by step with a clean final answer, find the broken step in a proof, or filter its generated solutions down to samples you can use for distillation.

Max input
65,536 tokens
Max output
8,192 tokens
Input → output
Text → Text
  • Streaming
  • OpenAI SDK compatible

DeepSeek R1 API use cases

Each use case comes with an illustrative example: source material, a prompt and a hand-written sample answer, not actual model output. Copy the prompt, swap in your own material and try it on DeepSeek R1.

Try DeepSeek R1 with your own material

Reproduce results from the original R1

When a paper, benchmark or older system used the original R1, rerun the same problems on deepseek-r1. Set temperature to 0.6 as the model card suggests, and average several runs before comparing.

Example: What are the first term and common difference?

Material

Problem
The sum of the first 10 terms of an arithmetic sequence is 100, and the 10th term is 19. Find the first term and the common difference.

PromptPlease reason step by step, and put your final answer within \boxed{}.

Sample answer · written by hand to show the reasoning

The sum of the first 10 terms is S₁₀ = 10 × (a₁ + a₁₀) ÷ 2 = 5 × (a₁ + 19) = 100, so a₁ + 19 = 20 and a₁ = 1. Also a₁₀ = a₁ + 9d = 19, so 9d = 18 and d = 2. Check: the sequence is 1, 3, 5, …, 19, and the first 10 odd numbers add up to exactly 100. Final answer: \boxed{a_1 = 1,\ d = 2}

About the DeepSeek R1 API

  • Math and coding on par with OpenAI o1

    DeepSeek says R1 performs on par with OpenAI o1: 79.8% on AIME 2024, 97.3% on MATH-500, and a Codeforces rating of 2029, ahead of 96.3% of competitors.

  • Reasoning trained with reinforcement learning

    DeepSeek used large-scale reinforcement learning in post-training, boosting math, coding and reasoning with minimal labeled data; it also released R1-Zero, trained with reinforcement learning directly, without supervised fine-tuning.

  • MIT licensed, distillation allowed

    Code and weights are released under the MIT license, which allows commercial use, derivative work and distilling other models from its outputs; DeepSeek also open-sourced six models from 1.5B to 70B distilled from R1.

  • DeepSeek R1 API key and access

    You don’t need a separate DeepSeek R1 API key: one APIMart key works for every model. Check the DeepSeek R1 pricing table on this page for current DeepSeek R1 API pricing, then call an OpenAI Chat Completions-compatible endpoint with the model ID deepseek-r1.

DeepSeek R1 official benchmark results

Selected results DeepSeek published at launch.

  • AIME 2024

    79.8%

    American Invitational Mathematics Examination 2024 problems. OpenAI o1-1217 scores 79.2%.

  • MATH-500

    97.3%

    500 competition-level math problems. OpenAI o1-1217 scores 96.4%.

  • Codeforces

    2029

    Competitive programming rating, ahead of 96.3% of competitors. OpenAI o1-1217 rates 2061.

  • LiveCodeBench

    65.9%

    A continuously updated set of new coding problems. OpenAI o1-1217 scores 63.4%.

  • GPQA-Diamond

    71.5%

    Graduate-level science questions. OpenAI o1-1217 scores 75.7%.

  • MMLU

    90.8%

    Knowledge questions across 57 subjects. OpenAI o1-1217 scores 91.8%.

How to call the DeepSeek R1 API

To call DeepSeek R1, you only need an APIMart API key and your existing OpenAI SDK, or send plain HTTP requests.

POST /v1/chat/completions
curl https://api.apimart.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "deepseek-r1",
  "messages": [
    {
      "role": "user",
      "content": "Describe how to design a clear API in three sentences."
    }
  ],
  "stream": false
}'

DeepSeek R1 access details

Model IDdeepseek-r1
Base URLhttps://api.apimart.ai/v1
Endpoint/chat/completions

Common parameters

model
Required
messages
Required
stream
Optional
max_tokens
Optional
temperature
Optional
All request parameters, response fields and error codes

DeepSeek R1 API request parameters

DeepSeek R1 uses the general chat endpoint, POST /v1/chat/completions, with a JSON body. model and messages are required; every other parameter is optional.

ParameterTypeRequiredDescription
modelstringYesModel ID. Use deepseek-r1 for this model.
messagesarrayYesConversation messages. Each message has a role (system, user, or assistant) and content. Include earlier messages for multi-turn conversations.
streambooleanNoWhether to stream the output. true returns chunks over SSE, false returns the full response at once. Default: true.
temperaturenumberNoOutput randomness, 0–2. Default: 1.0. Lower values give more deterministic output.
top_pnumberNoNucleus sampling, 0–1. Default: 1.0. Adjust this or temperature, not both.
max_tokensintegerNoMaximum number of tokens to generate for the reply.
frequency_penaltynumberNoFrequency penalty, -2.0 to 2.0. Default: 0. Positive values reduce repeated wording.
presence_penaltynumberNoPresence penalty, -2.0 to 2.0. Default: 0. Positive values encourage new topics.
stopstring | arrayNoUp to 4 stop sequences. Generation stops when any of them appears.
nintegerNoNumber of replies to generate. Default: 1.

Response fields

The response contains the fields below. Token usage is returned in usage, which you can use to check costs.

FieldTypeDescription
idstringUnique identifier for the request.
modelstringThe model that handled the request.
choicesarrayList of replies. Each item contains message (role and content) and finish_reason.
usageobjectToken usage: prompt_tokens, completion_tokens, and total_tokens.

Error codes

Failed requests return an error object with code, message, and type.

StatusTypeMeaning
400invalid_request_errorInvalid request parameters.
401authentication_errorThe API key is invalid or missing.
402payment_requiredInsufficient account balance.
403permission_errorNo permission to access this resource.
429rate_limit_errorToo many requests. Retry later.
500server_errorInternal server error.
502bad_gatewayGateway error. The service is temporarily unavailable.

DeepSeek R1 API pricing

The DeepSeek R1 API is billed by token usage, and prices depend on your membership tier. Prices below are per million tokens; 1 US dollar = 10 credits.

ItemGoldCurrent pricePlatinumDiamondOfficial priceYou save
Input4.48Credits~$0.4484.256Credits~$0.42564.032Credits~$0.40325.6Credits~$0.5620%
Output17.92Credits~$1.79217.024Credits~$1.702416.128Credits~$1.612822.4Credits~$2.2420%

Prices are for reference only. View full pricing

Why call DeepSeek R1 API through APIMart

  • 20% below official pricing

    DeepSeek R1 API pricing is billed by token usage. Gold to Diamond member prices are 20%–28% below DeepSeek's official prices.

    See membership prices
  • One API key for 500+ models

    DeepSeek R1, the rest of its family and 500+ models from GPT, Claude, Gemini and more share one API key and one account balance. Switching models is just a change to the model parameter.

  • Change two lines of existing code

    If you already use the OpenAI SDK, point base_url at https://api.apimart.ai/v1 and swap in your APIMart API key. Requests and responses keep the same format.

  • Try it online before you code

    Try DeepSeek R1 with your own material in the Playground, no code or setup needed, and integrate once you like the results.

    Open Playground

Which DeepSeek model should you choose?

Base prices per 1M tokens (USD). Your DeepSeek R1 API key works for every model in the table; just change the model parameter.

Differences between DeepSeek models
ComparisonDeepSeek R1 CurrentDeepSeek R1-0528DeepSeek V3.2DeepSeek V4 ProDeepSeek V4.1 Flash
Best forOriginal reasoning model, Competition math and coding, MIT licensed, distillation allowedDeep reasoning, Math and code, Open weightsAgents and tool use, Long context, Open weightsAgentic coding, Long documents, Hard reasoningAgentic coding, Image understanding, High-volume agents
Input typesTextTextTextTextText, Image
Max input65,536 tokens163,840 tokens163,840 tokens1,000,000 tokens1,000,000 tokens
Max output8,192 tokens32,768 tokens163,840 tokens393,216 tokens393,216 tokens
Input price$0.448$0.408$0.2056$1.0286$0.2286
Output price$1.792$1.2322$0.3084$3.0857$0.9143

DeepSeek R1 FAQ

How does DeepSeek R1 relate to DeepSeek R1-Zero?

According to the model card, R1-Zero was trained with large-scale reinforcement learning directly on the base model, without supervised fine-tuning, and showed self-verification, reflection and long chains of thought. DeepSeek R1 builds on that with a pipeline of two supervised fine-tuning stages and two reinforcement learning stages. This page covers DeepSeek R1, model ID deepseek-r1.

How is DeepSeek R1 different from R1-0528?

R1-0528 is a minor version upgrade from May 2025 that reasons more deeply: AIME 2025 rose from 70.0% to 87.5%, and it added JSON output and function calling and began supporting system prompts. On DeepSeek’s official API the original R1 did not support function calling or JSON output, and its model card advises against system prompts. On APIMart they are separate model IDs: deepseek-r1 for the original, deepseek-r1-0528 for the upgrade.

How should I set prompts and temperature for DeepSeek R1?

Following DeepSeek’s model card: set temperature between 0.5 and 0.7, with 0.6 recommended, to avoid endless repetition or incoherent output; don’t add a system prompt and put all instructions in the user message; for math, add “Please reason step by step, and put your final answer within \boxed{}.”; and when evaluating, average several runs.

Does DeepSeek R1’s 8K output limit include the reasoning?

Not according to DeepSeek’s API docs at the time: max_tokens limited only the final answer after the reasoning, 4K by default and 8K at most; the reasoning was counted separately, up to 32K, and did not count toward the 64K context. On APIMart, the limits shown on this page apply: up to 65,536 input tokens and 8,192 output tokens per request; check the usage field in the response for how much went to reasoning and to the answer.

Can I use DeepSeek R1 outputs to train my own model?

Yes. DeepSeek R1’s code and weights are released under the MIT license, which allows commercial use, modification and derivative works, including distilling other models from its outputs; at launch DeepSeek also stated that API outputs can be used for fine-tuning and distillation. DeepSeek itself used R1-generated data to distill six smaller models, from 1.5B to 70B, based on Qwen and Llama.

DeepSeek R1 has open weights. Why use the API?

The full DeepSeek R1 has 671B parameters, so self-hosting needs a multi-GPU server and someone to run it. Through the API you pay per token with no hardware, and the same key works for other models. Consider self-hosting when data must stay on your own machines or your usage is large and steady; if a smaller model is enough, look at DeepSeek’s open distilled versions.

How can I try this model online?

Click Start chatting or Open Playground to visit the existing APIMart Playground. Select DeepSeek R1 in the text category to start exploring.

Which model ID does the DeepSeek R1 API use?

Set model to deepseek-r1. Copy the exact ID from the page heading or the integration details panel.

Is it compatible with the OpenAI SDK?

You can keep the OpenAI SDK. Set base_url to https://api.apimart.ai/v1, provide your APIMart API key, and use the model ID on this page.

What is the context window of DeepSeek R1?

On APIMart, DeepSeek R1 accepts up to 65,536 input tokens per request. Your prompt, earlier messages, and file content all count toward it.

How many tokens can it output at once?

DeepSeek R1 can output up to 8,192 tokens in a single reply. Use the max_tokens parameter to set a lower limit.

How much does the DeepSeek R1 API cost?

The DeepSeek R1 API on APIMart is billed by token, and prices depend on your membership tier. Gold: $0.448 per million input tokens and $1.792 per million output tokens. Diamond: $0.4032 per million input tokens and $1.6128 per million output tokens. Prices may change; the pricing page has the current rates.

Does it support streaming?

Yes. The general chat endpoint streams over SSE by default. Set stream to false to receive the complete response at once.

How do I get an API key?

Sign in to APIMart and create a key on the API Keys page, then send it in the Authorization: Bearer header. The same key also works for other models on the platform.