Skip to content

MaaS_DeepSeek

Request Protocol

https

Parameter Name Type Required Description
Content-Type string is Fixed to applicatio n/json
Authorization string is Bearer ${YOUR_AK}

Dialogue Completion

Request URL

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

Request Body Parameters

Parameter Name Secondary Parameter Level 3 Parameter Level 4 Parameter Type Required Description
model - - - string is Model ID used.
messages - - - array[json] is The conversation message list is filled in order from oldest to newest.
role - - string is The role of the message author, with optional values being user, assistant, or system.
content - - object is Message content, which can be of type string or array[json].
When content is a string - string No The message content is plain text.
When content is array[json] - array[json] No The message content is in text structure.
type string No The content type must be one of text or file.
text string No When type is text, fill in the message text.
file object No When type is file, the content of the file to be filled in.
file_id string No
thinking - - - object No Used to control the inference behavior of the model.
reasoning_effort - - string No Controls the inference strength of the model, with optional values being high or max.
max_tokens - - - integer No Limit the maximum number of tokens generated by the model.
response_format - - - object No is used to specify the format of the model output.
stop - - - object No is used to define the stop sequence.
stream - - - boolean No Whether to use the streaming interface, with a default value of false. If set to true, the model will send message increments in SSE format.
stream_options - - - object No Additional options during streaming.
temperature - - - number No Sampling temperature, between 0 and 2, with a default value of 1. It is generally recommended to adjust only this parameter or top_p.
top_p - - - number No Nucleus sampling parameter, with a value range of (0, 1], and a default value of 1. It is generally recommended to adjust only this parameter or temperature.
tools - - - array[json] No List of functions that the model can call.
tool_choice - - - object No Control how the model invokes tools.
logprobs - - - boolean No Whether to return the log probabilities of the output tokens, with the default value being false.
top_logprobs - - - integer No Returns the logarithmic probability of the top N most likely tokens, ranging from 0 to 20. Logprobsshould be set to truewhen used.
user_id - - - string No User identifier on the business side, with a character set of [a-zA-Z0-9\-_], up to 512 characters in length.
frequency_penalty - - - number (deprecated) No Deprecated, this parameter is no longer supported, passing it in will not have any effect.
presence_penalty - - - number (deprecated) No Deprecated, this parameter is no longer supported, passing it in will not have any effect.

Request Example

curl -L -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
  "messages": [
    {
      "content": "You are a helpful assistant",
      "role": "system"
    },
    {
      "content": "Hi",
      "role": "user"
    }
  ],
  "model": "MaaS_Deepseek_V4_pro_20260424",
  "thinking": {
    "type": "enabled"
  },
  "reasoning_effort": "high",
  "max_tokens": 4096,
  "response_format": {
    "type": "text"
  },
  "stop": null,
  "stream": false,
  "stream_options": null,
  "temperature": 1,
  "top_p": 1,
  "tools": null,
  "tool_choice": "none",
  "logprobs": false,
  "top_logprobs": null
}'

Response Example

{
    "id": "chatcmpl-lHhTva9flc1dlUBqu4pPADmq",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "Hello! How can I help you today?",
                "reasoning_content": "We are starting a conversation with the user. The user said \"Hi\". I should respond in a friendly and helpful manner, keeping in mind that the system prompt says \"You are a helpful assistant\". I need to introduce myself and ask how I can help. Keep it concise and warm."
            },
            "finish_reason": "stop",
            "native_finish_reason": "stop"
        }
    ],
    "created": 1780299859,
    "model": "MaaS_Deepseek_V4_pro_20260424",
    "object": "chat.completion",
    "system_fingerprint": "fp_9954b31ca7_prod0820_fp8_kvcache_20260402",
    "usage": {
        "prompt_tokens": 10,
        "completion_tokens": 68,
        "total_tokens": 78,
        "completion_tokens_details": {
            "accepted_prediction_tokens": 0,
            "audio_tokens": 0,
            "image_tokens": 0,
            "reasoning_tokens": 58,
            "rejected_prediction_tokens": 0
        },
        "prompt_tokens_details": {
            "audio_tokens": 0,
            "cached_tokens": 0,
            "image_tokens": 0
        },
        "prompt_cache_hit_tokens": 0,
        "prompt_cache_miss_tokens": 10
    }
}

Anthropic API Call

import anthropic

client = anthropic.Anthropic()

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