DeepSeek

DeepSeek-V4.1-Flash is a multimodal Mixture-of-Experts (MoE) model with 552B backbone parameters that natively processes images and text, and generates text autoregressively.


Request Format

from openai import OpenAI

client = OpenAI(
    base_url="https://api-cdn.deploy.com/api/v1",
    api_key="DEPLOY_API_KEY",
)
response = client.chat.completions.create(
    model="deepseek-ai/deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Explain TCP and UDP in two sentences."}],
)

print(response.choices[0].message.content)
curl https://api-cdn.deploy.com/api/v1/chat/completions \
  -H "Authorization: Bearer $DEPLOY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-ai/deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Response Format

{
  "id": "bf7eb425-c8ee-11f1-bc46-67542ee84316",
  "object": "chat.completion",
  "created": 1792106317,
  "model": "deepseek-ai/deepseek-v4.1-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?",
        "reasoning_content": "The user just said \"Hello!\" That's a simple greeting. I should respond warmly and openly, inviting them to share what they need. No need for tools or complex analysis here—just a friendly, natural reply that sets a helpful tone. I'll keep it simple and engaging."
      },
      "finish_reason": "stop",
      "logprobs": null
    }
  ],
  "usage": {
    "prompt_tokens": 32,
    "completion_tokens": 68,
    "total_tokens": 100,
    "prompt_tokens_details": { "cached_tokens": 0 },
    "completion_tokens_details": { "reasoning_tokens": 58 }
  }
}

Parameters

For a more detailed explanation on possible parameters, refer to OpenAI's Create chat completion documentation.

FieldTypeDefinitionDefault Value
modelstrRequired. The model key to be used. Use deepseek-ai/deepseek-v4.1-flash.deepseek-ai/deepseek-v4.1-flash
messagesarrRequired. Conversation history. Each object has a role (user or assistant) and content (str).-
streambool
Routes the request to the streaming path vs non-streaming path.
false
max_completion_tokensintOutput token cap.-
temperaturefloatRandomness. Greedy sampling at 0 ; identical results are not guaranteed.1
top_pfloatNucleus sampling cutoff.1
top_kintLimits sampling to the top K tokens.-
reasoning_effortstr

Constrains effort on reasoning for reasoning models. Supported values are none, low, high, max.

Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.

Setting this value as none disables thinking.

high
nintHow many chat completion choices to generate for each input message. Currently, we only support 1.1
presence_penaltyfloatNumber between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics.0
frequency_penaltyfloatNumber between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim.0
logprobsboolWhether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.false
max_thinking_tokensintMaximum number of thinking tokens allowed before generating the final answer.-