Skip to content

MaaS_DeepSeek

Model Overview

item value
Model ID (model) deepseek-flash
context window 1M (marked as "1M" on the origin server; the source document does not specify the exact token count)
Maximum Output Up to 384K; the max_tokenscap for Chat Completions is 393216
Default output limit Non-reasoning mode: 8K; reasoning mode: 64K;when reasoning_effort= max, 128K
Max Chain-of-Thought Source document not specified
input modality Text, Image
output modality Text
Default Thinking Mode Enable (thinking.typedefaults to enabled, with the default effort set to high)
thinking gear none / low / high / max; minimal→low, medium, xhigh→high, ultra→max
Image Support Supported, only usermessages; JPEG / PNG / GIF / WebP; a single image is converted to a maximum of 1024 tokens
Context Caching Supported, disk caching is enabled by default, no parameters required

Request Protocol

https

Parameter Name Type Required Description
Content-Type string Yes application/json; multipart/form-data for file uploads
Authorization string Yes Bearer {API_KEY}

OpenAI Chat Completions

Request URL

POST https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions

Request Body Parameters

Parameter Name Secondary Parameters Three-level parameters CET-4 Parameters Type Required Description
model - - - string Yes Fixed as MaaS_Deepseek_V4.1_Flash_20260910 (vendor's original model: deepseek-flash; optional origin server options: deepseek-flash, deepseek-v4-pro)
messages - - - array[json] Yes Conversation message list, with at least 1 entry
role - - string Yes system / user / assistant / tool
content - - string or array Yes system, toolare strings;usermessages can be an array of content blocks for image passing
type - string Yes Content block type: text/ image_url/ file
text - string Conditions type= textthe text content
image_url - object Conditions type= image_urlwhen in use
url string Yes http (s)external link (max. 8192 characters) or base64 data URL
detail string No low (downsampled to 512×512) / high/ original/ auto;highis equivalent to original
file_id - string Conditions type= file, the ID returned by the Files API (in the format of file-api-. ..)
file_data - string Conditions type= file, inline base64 data URL within the request, which is mutually exclusive with file_id
filename - string No Can be set when using file_data; not allowed to be used together with file_id
name - - string No Participants can choose a name to distinguish participants with the same role
tool_call_id - - string Conditions role= toolis required, and the corresponding tool call ID shall be sent via postback
reasoning_content - - string Conditions Chain of thought from the previous round in thinking mode; when the request carries tools, a complete postback is mandatory, otherwise a 400 will be returned
prefix - - boolean No Prefix Continuation Switch (Beta, see "Chat Prefix Completion")
thinking - - - object No Thinking Mode Switch:{"type":"enabled"\|"disabled"}, default enabled
reasoning_effort - - - string No none/ low/ high/ max, default: high;nonedisables reasoning
max_tokens - - - integer No Value ranges from 1 to 393216; when not set, it is 8K for non-thinking mode and 64K for thinking mode effort= max, and 128K in this case
response_format - - - object No {"type":"json_object"}Enable JSON output; default{"type":"text"}
stop - - - string or array No Up to 16 stop sequences
stream - - - boolean No Enable SSE streaming, ending with data: [DONE]
stream_options - - - object No Must be used together with stream: true, otherwise a 400 error will be returned
include_usage - - boolean No When set to true, each chunk carries a usagefield (only the last non-empty one is valid); the last chunk always carries the full usage information regardless of the setting.
temperature - - - number No 0\~2, default value is 1; invalid in thinking mode (no error will be reported)
top_p - - - number No 0\~1, default is 1; in reasoning mode, values below 0.95 will be raised to 0.95; in non-reasoning mode, it is fixed at 1.0 and the input value is ignored
tools - - - array No Tool list, only supports function; tool names must be unique
type - - string Yes fixed function
function - - object Yes function definition
name - string Yes Only a-z, A-Z, 0-9, _, -allowed, maximum 128 characters
description - string No for the model to determine when to invoke
parameters - object No JSON Schema; omitted indicates no parameters
strict - boolean No Default: false; Strict mode (Beta) requires the /betabase_url, and mandates that all objectshave additionalProperties= falsewith all fields marked as required
tool_choice - - - string or object No none/ auto/ required, or{"type":"function", "function":{"name":". .."}}; defaults to nonewhen no tools are present, defaults to autowhen tools are present;requiredwill return 400 with the specified tool in reasoning mode
logprobs - - - boolean No Whether to return the log probabilities of output tokens
top_logprobs - - - integer No 0\~20, required to simultaneously logprobs= true
user_id - - - string No Character set[a-zA-Z0-9\-_], maximum length 512; used for content security, KVCache isolation and scheduling isolation
frequency_penalty - - - number No Deprecated. Passing a value here has no effect.
presence_penalty - - - number No Deprecated. Passing a value here has no effect.

Request Example

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {API_KEY}' \
  -d '{
    "model": "MaaS_Deepseek_V4.1_Flash_20260910",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ],
    "thinking": {"type": "enabled"},
    "reasoning_effort": "high",
    "stream": false
  }'

Response Example

{
  "id": "chatcmpl-xxxxxxxxxxxxxxxx",
  "object": "chat.completion",
  "created": 1700000000,
  "model": "MaaS_Deepseek_V4.1_Flash_20260910",
  "system_fingerprint": "xxxxxxxx",
  "choices": [
    {
      "index": 0,
      "finish_reason": "stop",
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?",
        "reasoning_content": null,
        "tool_calls": null
      },
      "logprobs": null
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 10,
    "total_tokens": 22,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "prompt_cache_hit_tokens": 0,
      "prompt_cache_miss_tokens": 12
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    }
  }
}

finish_reasonpossible values: stop/ length/ content_filter/ tool_calls/ insufficient_system_resource/ aborted. In thinking mode, the chain of thought is located in message.reasoning_content, which is at the same level as content.

Example of streaming request

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {API_KEY}' \
  -d '{
    "model": "MaaS_Deepseek_V4.1_Flash_20260910",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true,
    "stream_options": {"include_usage": true}
  }'

```plain text data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}],"usage":null}

data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":6,"completion_tokens":2,"total_tokens":8,"prompt_tokens_details":{"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":6}}}

data: [DONE]

### SDK Calling Method

```python
from openai import OpenAI

client = OpenAI(
    api_key="{API_KEY}",
    base_url="https://genaiapi.cloudsway.net/v1/ai/{endpointPath}",
)

response = client.chat.completions.create(
    model="MaaS_Deepseek_V4.1_Flash_20260910",
    messages=[{"role": "user", "content": "Hello!"}],
    reasoning_effort="high",
    extra_body={"thinking": {"type": "enabled"}},
)
print(response.choices[0].message.content)

Note: When using the OpenAI SDK to pass thinking, it should be placed in extra_body;reasoning_effortis a top-level parameter

OpenAI Responses

Request URL

POST https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses

Request Body Parameters

Parameter Name Secondary Parameters Three-level parameters Type Required Description
model - - string Yes Fixed as MaaS_Deepseek_V4.1_Flash_20260910 (vendor's original model: deepseek-flash)
input - - string or array Conditions Pure strings are processed as individual usermessages, or as an array of input items; at least one of this field and instructionsmust be filled in.
type -
string No Input item type: message/ function_call/ function_call_output/ custom_tool_call/ custom_tool_call_output/ reasoning; other types are ignored
role - string No Role of themessage item: user/ assistant/ system/ developer (developeris regarded as user)
content - string or array No content string or content block array
type string Yes input_text / output_text / input_image
text string Conditions Text content block
image_url string Conditions input_imageis the http (s)link or base64 data URL of the image, and it is mutually exclusive with file_id.
file_id string Conditions input_imagereferences the image from the Files API;file_idis present, detailis ignored
detail string No low/ high/ original/ auto; lowdownsampled to 512×512
output - string or array No function_call_output/ custom_tool_call_outputoutputs, which can be an array of content blocks (supporting input_image)
instructions - - string No System-level instruction, inserted as the first system message
reasoning - - object No Thinking Mode Configuration
effort - string No none/ low/ high/ max;nonedisables reasoning;minimal→ low, medium, xhigh→ high; model default (enabled) applies if not set
summary - string No The origin server accepts this field but does not generate a digest
max_output_tokens - - integer No Output limit, including visible output and inference tokens
stream - - boolean No Semantic SSE, with termination events being response.completed/ response.incomplete/ response.failed, and no data: [DONE]
temperature - - number No 0\~2, default value is 1; invalid in thinking mode
top_p - - number No 0\~1, default value is 1; the lower limit is 0.95 in thinking mode, and fixed at 1.0 in non-thinking mode
text - - object No Text Output Configuration
format - object No {"type":"text"} (default) / {"type":"json_object"} / {"type":"json_schema"}
type string No text / json_object / json_schema
name string Conditions type= json_schemais required
schema object Conditions type= json_schemais required, and the output must conform to this JSON Schema
verbosity - string No The origin server accepts this field but does not activate it
tools - - array No Only functiontakes effect;customonly supports{"type":"custom", "name":"apply_patch"}; built-in tools (web_search, file_search, code_interpreter, etc.) are ignored
type - string Yes function
name - string Yes Non-empty, no more than 128 characters, matching ^[a-zA-Z0-9_-]+$, and globally unique
description - string No for the model to determine when to invoke
parameters - object No JSON Schema; omitted indicates no parameters
tool_choice - - string or object No none / auto (default) / required, or {"type":"function","name":"..."}
top_logprobs - - integer No 0\~20
user - - string No Character set[a-zA-Z0-9\-_], with a maximum length of 512; used for security audit, KVCache and scheduling isolation.
parallel_tool_calls - - boolean No Ignored (parallel tool calls are always enabled)
max_tool_calls - - integer No Ignored
previous_response_id - - string No Not supported (stateless interface)
conversation - - - No Not supported
store - - - No Not supported, the response is always store: false
background - - - No Not supported
metadata - - - No Not supported
include - - - No Not supported
prompt - - - No Not supported
truncation - - - No Not supported; returns 400 when exceeding context limit
service_tier - - - No Not supported
safety_identifier - - - No Not supported
prompt_cache_key / prompt_cache_retention - - - No Not supported; cache is managed automatically
context_management - - - No Not supported
stream_options - - - No Not supported

Unsupported parameters are silently ignored without throwing errors. File input (of the filetype) is not supported; images are only allowed in user/ developermessages and the function_call_output/ custom_tool_call_output outputfield. If they appear in system/ assistantmessages, a 400 error will be returned.

Request Example

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {API_KEY}' \
  -d '{
    "model": "MaaS_Deepseek_V4.1_Flash_20260910",
    "instructions": "You are a helpful assistant.",
    "input": "Hi, how are you?",
    "reasoning": {"effort": "high"}
  }'

Response Example

{
  "id": "resp-xxxxxxxxxxxxxxxx",
  "object": "response",
  "created_at": 1700000000,
  "status": "completed",
  "error": null,
  "incomplete_details": null,
  "model": "MaaS_Deepseek_V4.1_Flash_20260910",
  "output": [
    {
      "type": "reasoning",
      "id": "rs-xxx",
      "status": "completed",
      "content": [{"type": "reasoning_text", "text": "..."}]
    },
    {
      "type": "message",
      "id": "msg-xxx",
      "status": "completed",
      "role": "assistant",
      "content": [{"type": "output_text", "text": "I am doing well, thanks!"}]
    }
  ],
  "usage": {
    "input_tokens": 12,
    "input_tokens_details": {"cached_tokens": 0},
    "output_tokens": 20,
    "output_tokens_details": {"reasoning_tokens": 8},
    "total_tokens": 32
  }
}

status values: in_progress / completed / incomplete / failed; incomplete_details.reason values: max_output_tokens / content_filter.

Example of streaming request

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {API_KEY}' \
  -d '{
    "model": "MaaS_Deepseek_V4.1_Flash_20260910",
    "input": "Hi, how are you?",
    "stream": true
  }'

(Event stream: response.created → response.in_progress → response.output_item.added/done → response.content_part.added/done → response.reasoning_text.delta/done → response.output_text.delta/done → response.function_call_arguments.delta/done → response.custom_tool_call_input.delta/done → terminates with response.completed / response.incomplete / response.failed, and each event carries a sequence_number.)

SDK Calling Method

from openai import OpenAI

client = OpenAI(
    api_key="{API_KEY}",
    base_url="https://genaiapi.cloudsway.net/v1/ai/{endpoint}",
)

response = client.responses.create(
    model="MaaS_Deepseek_V4.1_Flash_20260910",
    instructions="You are a helpful assistant.",
    input="Hi, how are you?",
    reasoning={"effort": "high"},
)
print(response.output_text)

Anthropic Messages

Request URL

POST https://genaiapi.cloudsway.net/{endpoint}/v1/messages

Header (Additional to This Agreement)

Parameter Name Type Required Description
x-api-key string Yes origin server marked as Fully Supported (Anthropic protocol authentication header)
anthropic-version string No Origin server is ignored; configuration passed will not take effect
anthropic-beta string Conditions /messagesis ignored; required for Anthropic-compatible endpoints of Files files-api-2025-04-14

Request Body Parameters

Parameter Name Secondary Parameters Three-level parameters CET-4 Parameters Type Required Description
model - - - string Yes Fixed as MaaS_Deepseek_V4.1_Flash_20260910 (vendor's original model: deepseek-flash)
max_tokens - - - integer Yes Origin server marked as Fully Supported; mandatory under this protocol
messages - - - array[json] Yes Anthropic message format, which differs from the messagesstructure of Chat Completions
role - - string Yes user / assistant
content - - string or array Yes Array of strings or content blocks
type - string Yes text / image / thinking / tool_use / tool_result / server_tool_use / web_search_tool_result are supported; document, search_result, redacted_thinking, code_execution_tool_result, mcp_tool_use, mcp_tool_result, container_upload are not supported
text - string Conditions type= textfor text (cache_control, citationsare ignored)
source - object Conditions type= imageImage source at the time
type string Yes base64 / url / file
media_type string Conditions Required when base64: image/jpeg / image/png / image/gif / image/webp
data string Conditions base64image data
url string Conditions urlexternal link, with a maximum length of 8192 characters
file_id string Conditions fileWhen referencing images via the Files API, the following header must be included: anthropic-beta: files-api-2025-04-14
id / name / input / tool_use_id / content / is_error - - Conditions tool_use / tool_result fields: id, input, name, tool_use_id, content are supported; cache_control, is_error are ignored
system - - - string No origin server labeling Fully Supported
stream - - - boolean No Origin server annotation: Fully Supported (not specified in the source document of the event list)
stop_sequences - - - array No origin server labeling Fully Supported
temperature - - - number No The origin server is marked as Fully Supported, with the range [0.0 \~ 2.0]
top_p - - - number No Only the thinking mode is enabled, with a lower limit of 0.95; the non-thinking mode is fixed at 1.0
top_k - - - integer No origin server ignored
thinking - - - object No Supported;budget_tokensis ignored
output_config - - - object No Only effortis supported
effort - - string No low/ high/ max (the name of the thinking tier field under the Anthropic protocol)
metadata - - - object No Only user_idis supported, others are ignored
user_id - - string No for security audit, KVCache and scheduling isolation
tools - - - array No Tool Definition
name - - string Yes origin server marked as Fully Supported
input_schema - - object Yes origin server marked as Fully Supported
description - - string No origin server marked as Fully Supported
cache_control - - - No Ignored
tool_choice - - - object No nonesupported;auto/ any/ toolsupported (disable_parallel_tool_useis ignored)
container - - - - No Ignored
mcp_servers - - - - No Ignored
service_tier - - - - No Ignored

Note: The origin server maps Claude model names as follows — claude-opus*→ deepseek-v4-pro, claude-haiku*, claude-sonnet*→ deepseek-flash; unrecognized model names passed in will automatically fall back to the underlying Flash model. Whether the MaaS side will inherit this mapping is subject to the platform configuration.This protocol supports inserting tool call messages and systemmessages in the middle of a conversation (the Chat Completions protocol does not support inserting tool calls).

Request Example

curl -X POST 'https://genaiapi.cloudsway.net/{endpoint}/v1/messages' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -d '{
    "model": "MaaS_Deepseek_V4.1_Flash_20260910",
    "max_tokens": 1000,
    "system": "You are a helpful assistant.",
    "messages": [
      {"role": "user", "content": [{"type": "text", "text": "Hi, how are you?"}]}
    ],
    "output_config": {"effort": "high"}
  }'

Response Example

{
  "id": "msg_xxxxxxxxxxxxxxxx",
  "type": "message",
  "role": "assistant",
  "model": "MaaS_Deepseek_V4.1_Flash_20260910",
  "content": [
    {"type": "text", "text": "I am doing well, thanks!"}
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {"input_tokens": 12, "output_tokens": 20}
}

(contentand usageshall be subject to the specific field names returned by the MaaS endpoint; the origin server compatibility table only provides the field support status, not the complete list of response fields)

Example of streaming request

curl -X POST 'https://genaiapi.cloudsway.net/{endpoint}/v1/messages' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -d '{
    "model": "MaaS_Deepseek_V4.1_Flash_20260910",
    "max_tokens": 1000,
    "messages": [{"role": "user", "content": "Hi, how are you?"}],
    "stream": true
  }'

(origin server marked streamFully Supported, but the list of event types has not been published — "not specified in the source document")

SDK Calling Method

import anthropic

client = anthropic.Anthropic(
    api_key="{API_KEY}",
    base_url="https://genaiapi.cloudsway.net/{endpoint}/v1",
)

message = client.messages.create(
    model="MaaS_Deepseek_V4.1_Flash_20260910",
    max_tokens=1000,
    system="You are a helpful assistant.",
    messages=[
        {"role": "user", "content": [{"type": "text", "text": "Hi, how are you?"}]}
    ],
)
print(message.content)