You can call Qwen models using the DashScope API. This topic describes the input and output parameters and provides call examples.
- China (Beijing)
- Singapore
- US (Virginia)
- Germany (Frankfurt)
- Japan (Tokyo)
- Hong Kong (China)
- Plain text models, such as qwen-plus:
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation - Multimodal models, such as qwen3.7-plus or qwen3-vl-plus:
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
- Python code
- Java code
{WorkspaceId} with your actual Workspace ID.
You must obtain an API key and configure it as an environment variable. If you use the DashScope SDK to make calls, you must also install the DashScope SDK.
Request bodymodelstring(Required)The name of the model to use.Supported models include Qwen large language models (commercial and open source editions), Qwen-VL, Qwen-Coder, Qwen-Audio, math models, DeepSeek (provided by Alibaba Cloud and SiliconFlow), Kimi (provided by Alibaba Cloud), GLM (provided by Alibaba Cloud), and MiniMax (provided by Alibaba Cloud and MiniMax).For specific model names and billing details, seeSelect a model.messagesarray(Required)The context to pass to the large language model (LLM), arranged in conversational order.When you call over HTTP, place messages in the input object.
Message types System Message object (Optional)A system message that is used to set the role, tone, task objectives, or constraints for the LLM. It is usually placed first in the messages array.We do not recommend that you set a system message for QwQ models. A system message does not take effect for QVQ models.
Properties content string(Required)The content of the message.rolestring(Required)The role for the system message. The value is fixed to system.object(Required)A user message that is used to pass questions, instructions, or context to the model.
Properties content string or array(Required)The content of the message. If the input is only text, this parameter is a string. If the input includes multimodal data, such as images, or if explicit caching is enabled, this parameter is an array.
Properties text string(Required)The input text.imagestring (Optional)The image file for image understanding. You can pass an image in one of the following three ways:
{"image":"https://xxxx.jpeg"}detail string (Optional)Image processing detail. Max, Plus, and Flash models support this parameter starting with Qwen4. The default is high.When max_pixels is omitted:
max_pixels value overrides the pixel limit selected by detail. The maximum is 16777216. In Chat Completions, place max_pixels alongside image_url; in DashScope, place it alongside image.For high-resolution images, high typically uses more input tokens than low.For Chat Completions, detail can be passed within image_url or at the same level as image_url; for DashScope, it is passed at the same level as image.array or string (Optional)For Qwen4-Max, Qwen3.8, Qwen3.7, Qwen3.6, and Qwen3.5 series models, video input as a public URL image list supports 4–8000 images; Base64 image lists support up to 250 images.The video to pass when you use a Qwen-VL or QVQ model.
float(Optional)The number of frames to extract per second. The value must be in the range of [0.1, 10]. The default value is 2.0.
Description fps has two functions:
fps value is suitable for high-speed motion scenarios, such as sports events and action movies. A smaller fps value is suitable for long videos or scenarios with relatively static content.
Examples
integer(Optional)The maximum number of frames that can be extracted from a video. If the number of frames calculated based on fps exceeds max_frames, the system automatically adjusts to extract frames uniformly within the max_frames limit. This ensures that the total number of frames does not exceed the limit.
Value range
Examples {"type": "video_url","video_url": {"url":"https://xxxx.mp4"},"max_frame": 2000}
When you call with an OpenAI-compatible API, you cannot customize the min_pixelsinteger(Optional)Sets the minimum pixel threshold for the input image or video frames. If the total pixels of an input image or video frame are less than min_pixels, the image or frame is enlarged until its total pixels are higher than min_pixels.
Value range
Examples
integer(Optional)Sets the maximum pixel threshold for the input image or video frames. If the total pixels of an input image or video are within the [min_pixels, max_pixels] range, the model recognizes the original image. If the total pixels of the input image are greater than max_pixels, the image is scaled down until the total pixels are below max_pixels.
Value range
Examples
integer(Optional)The total pixel budget for frames sampled from a video.
Maximum value
Examples
stringThis is a required parameter for audio understanding models, such as qwen-audio-turbo.The audio file to pass when you use the audio understanding feature.Example: {"audio":"https://xxx.mp3"}cache_controlobject(Optional)This is supported only by models that support explicit caching. It is used to enable explicit caching.
Properties type string (Required)Fixed to ephemeral.string(Required)The role of the user message, fixed to user.object (Optional)The model's reply to the user message.
Properties content string (Optional)The message content. Optional only when the tool_calls parameter is specified in the assistant message.rolestring(Required)Fixed to assistant.partialboolean (Optional)Whether to enable partial mode. Related documentation and supported models: Partial mode.tool_calls array (Optional)After Function Calling is initiated, the returned tool and input parameter information, containing one or more objects. Obtained from the tool_calls field of the model response in the previous round.
Properties id stringThe ID of the tool response.type stringThe tool type. Currently, only function is supported.function objectThe tool and input parameter information.
Properties name stringThe tool name.arguments stringThe input parameter information, in JSON format string.integerThe index of the current tool information in the tool_calls array.object (Optional)The output information of the tool.
Properties content string(Required)The output content of the tool function, which must be in string format.rolestring(Required)Fixed to tool.tool_call_idstring (Optional)The id returned after Function Calling is initiated, which can be obtained via response.output.choices[0].message.tool_calls[$index]["id"] and is used to identify the tool corresponding to the Tool Message.float (Optional)The sampling temperature, which controls the diversity of the text generated by the model.A higher temperature value makes the generated text more diverse; conversely, a lower temperature value makes the generated text more deterministic.Value range: [0, 2)
temperature default value
When calling via HTTP, put temperature into the parameters object. It is not recommended to change the default temperature value of QVQ models.top_p float (Optional)The probability threshold for nucleus sampling, which controls the diversity of the text generated by the model.A higher top_p value makes the generated text more diverse. Conversely, a lower top_p value makes the generated text more deterministic.Value range: (0, 1.0].
top_p default value
In the Java SDK, it is topP. When calling via HTTP, put top_p into the parameters object. We do not recommend changing the default top_p value of the QVQ model.top_k integer (Optional)The size of the candidate set sampled during generation. For example, when set to 50, only the 50 highest-scoring tokens in a single generation form the candidate set for random sampling. A larger value increases the randomness of generation; a smaller value increases the determinism. A value of None, or a top_k greater than 100, means the top_k policy is disabled, and only the top_p policy takes effect.The value must be greater than or equal to 0.
top_k default value QVQ series: 10;QwQ series: 40;qwen-math series and qwen-audio-turbo series: 1;All other models: 20;GLM series (Alibaba Cloud direct): 20;DeepSeek/Kimi/MiniMax series do not support the top_k parameter. In the Java SDK, it is topK. When calling via HTTP, put top_k in the parameters object. We do not recommend changing the default top_k value of the QVQ model.enable_thinking boolean (Optional)Whether to enable thinking mode when using hybrid thinking models. Applicable to Qwen4, Qwen3.8, Qwen3.7, Qwen3.6, Qwen3.5, Qwen3, and Qwen3-VL models, as well as the DeepSeek-V4-Pro/V4-Flash series (Alibaba Cloud direct), DeepSeek-V3.2/V3.2-exp/V3.1 series (Alibaba Cloud direct, SiliconFlow direct), Kimi-K2.6/K2.5 series (Alibaba Cloud direct), and GLM series. The DeepSeek-V4 series enables thinking by default, and you can adjust the reasoning effort via the reasoning_effort parameter.Valid values:
In the Java SDK, it is enableThinking; when calling via HTTP, put enable_thinking in the parameters object.thinking_display string (Optional)qwen4-max: "summarized". Chain-of-thought summary and encryption.By default, the complete chain-of-thought is returned. After this feature is enabled, the original chain-of-thought is no longer returned in plaintext; instead, a summary and the complete ciphertext are returned. The summary is for display, and the ciphertext is for recovering historical thinking.preserve_thinking boolean (Optional) The default value is false (qwen4-max, qwen3.8-max/qwen3.8-flash default value is true)Whether to append the reasoning_content of assistant messages in the conversation history to the model input. Applicable to scenarios where the model needs to refer to the historical thinking process.kimi/kimi-k3.1-pro and kimi/kimi-k3.1-pro-highspeed support this parameter, and it is disabled by default.Currently supported: qwen4-max, qwen3.8-max, qwen3.8-max-0902, qwen3.8-flash (enabled by default), qwen3.7-max, qwen3.7-max-2026-05-20 and subsequent snapshots, qwen3.7-plus, qwen3.7-plus-2026-05-26, qwen3.6-plus, qwen3.6-plus-2026-04-02, qwen3.7-flash, qwen3.7-flash-2026-07-15, qwen3.6-flash, qwen3.6-flash-2026-04-16, kimi-k2.6 (deployed on Alibaba Cloud Model Studio), kimi-k2.7-code (deployed on Alibaba Cloud Model Studio, enabled by default), kimi/kimi-k2.7-code-highspeed (Moonshot direct, enabled by default), kimi/kimi-k2.7-code (Moonshot direct, enabled by default).Important: When using qwen4-max or qwen3.8-max/qwen3.8-flash, preserve_thinking defaults to true, and you must pass back all reasoning_content from the conversation history in full. Appending reasoning_content to the content field when passing it back is not supported.
When calling via HTTP, put preserve_thinking in the parameters object. The Java SDK is not supported yet.thinking_budget integer (Optional)The maximum length of the thinking process. Applicable to Qwen4, Qwen3.8, Qwen3.7, Qwen3.6, Qwen3.5, Qwen3-VL, Qwen3, GLM (directly provided by Alibaba Cloud), and Kimi (directly provided by Alibaba Cloud) series models, among which kimi-k3 and kimi-k3.1-pro do not support this parameter. Related documentation: Limit thinking length. Default value: 131072 (qwen4-max).Other models: the default value is the model's maximum chain-of-thought length. See Select ModelFor the Java SDK, it is thinkingBudget. When calling via HTTP, put thinking_budget in the parameters object. Other models: the default value is the model's maximum chain-of-thought length.reasoning_effort string (Optional)qwen4-maxDefault value: reasoning_effort=high.
qwen4-max does not support setting both reasoning_effort and thinking_budget at the same time. thinking_budget must be a positive integer and cannot be set to 0.When only thinking_budget is set, the thinking level is determined according to the following table, and the passed-in budget value is retained.
high and 131072 are used.Controls the model's reasoning effort. Different models support different optional values and default values.kimi-k3.1-pro (deployed on Alibaba Cloud Model Studio): the default value is max.
enable_thinking defaults to true. You can set it to false to disable thinking, but it is recommended to keep it enabled, as disabling it significantly affects the model output quality.DeepSeek-V4 and GLM series (default value is high)Valid values:
max, only max is supported)Valid values:
maxValid values:
enable_thinking only supports true, and passing false will cause the API request to fail.For the deepseek-v4-flash-0731 and deepseek-v4-pro-0813 models: the default value ishighValid values:
medium is mapped to high, and xhigh is mapped to high.For qwen3.8 series models: the default value isxhighValid values:
max maps to xhigh, high maps to xhigh, minimal maps to low, and none maps to enable_thinking=False.Setting values other than the optional values and mapping values above will cause an error.Important: The qwen3.8 series does not support setting reasoning_effort and thinking_budget at the same time; setting both will cause an error. However, the two support mutual conversion:
When calling via HTTP, put reasoning_effort into the parameters object.tool_stream boolean (optional) The default value is falseIt only affects the streaming output behavior of complex tool parameters and takes effect only in streaming calls. Ordinary tool parameters (all parameter types are string) are streamed as long as streaming is enabled, and tool_stream has no effect on them. Complex tools refer to tools whose definitions contain parameters of the array or object type. Currently, only the Qwen and GLM series support this.Supported Qwen series:
Complex tools refer to tools whose definitions contain parameters of the array or object type.Supported GLM series: glm-5 and glm-5.1 (directly provided by Alibaba Cloud).Usage reference for the GLM series:
When calling via HTTP, put tool_stream into the parameters object.enable_code_interpreter boolean (optional) The default value is falseWhether to enable the code interpreter feature. Related documentation: Code InterpreterValid values:
The Java SDK is not supported. When calling via HTTP, put enable_code_interpreter into the parameters object.clear_thinking boolean (optional) The default value is falseUsed to control whether the reasoning_content (thinking process) of historical turns is provided to the model as context in multi-turn conversations. Only the GLM series models glm-5.3, glm-5.2, glm-5.1, and glm-5 support this. The default value is true for glm-5.3 and false for the other models.
float (optional)The repetition degree of consecutive sequences in model generation. Increasing repetition_penalty can reduce the repetition degree of model output, and 1.0 means no penalty. There is no strict value range; it only needs to be greater than 0.
Default value of repetition_penalty
In the Java SDK, it is repetitionPenalty. When calling via HTTP, put repetition_penalty into the parameters object. It is not recommended to change the default repetition_penalty value of QVQ models.frequency_penalty float (Optional)Supported by qwen4-max. Applies a penalty based on the number of times a Token has already appeared, to adjust the generation of repeated content.presence_penaltyfloat(Optional)Controls the degree of content repetition when the model generates text.Value range: [-2.0, 2.0]. Positive values reduce repetition, and negative values increase it.In scenarios that call for diversity, fun, or creativity, such as creative writing or brainstorming, it is recommended to increase this value; in scenarios that emphasize consistency and terminology accuracy, such as technical documentation or formal texts, it is recommended to decrease this value.
presence_penalty default value qwen4-max (non-thinking mode), Qwen3.8 (non-thinking mode), Qwen3.7 (non-thinking mode), Qwen3.6 (non-thinking mode), Qwen3.5 (non-thinking mode), Qwen3 (non-thinking mode), Qwen3-Instruct series/1.7b/4b (thinking mode), QVQ series, qwen-max, qwen2.5-vl series, Qwen3-VL (non-thinking): 1.5;qwen-plus/qwen-plus-latest/2025-04-28 (thinking mode): 0.5;All others: 0.0.DeepSeek series (directly provided by Alibaba Cloud): deepseek-r1-distill-qwen distilled version: 1;Kimi series (directly provided by Alibaba Cloud): kimi-k2.7-code, kimi-k2.6, kimi-k2.5: 0.0;Kimi series (directly provided by Moonshot AI): 0.0;MiniMax series (directly provided by Alibaba Cloud): MiniMax-M2.5: 0.0;Other DeepSeek/Kimi/GLM/MiniMax models have no default value.
How it works If the parameter value is positive, the model applies a penalty to Tokens that already exist in the current text (the penalty is independent of how many times the text has appeared), reducing the probability of these Tokens appearing again, thereby reducing content repetition and increasing word diversity.
Examples Prompt: Translate this sentence into Chinese: "This movie is good. The plot is good, the acting is good, the music is good, and overall, the whole movie is just good. It is really good, in fact. The plot is so good, and the acting is so good, and the music is so good."Parameter value 2.0: This movie is good. The plot is great, the acting is great, the music is very pleasant, and overall the whole movie is just wonderful. In fact, it is truly excellent. The plot is so brilliant, the acting is outstanding, and the music is so melodious.Parameter value 0.0: This movie is good. The plot is good, the acting is good, the music is good, and overall the whole movie is good. In fact, it is really good. The plot is very good, the acting is very good, and the music is equally good.Parameter value -2.0: This movie is good. The plot is good, the acting is good, the music is good, and overall the whole movie is good. In fact, it is really good. The plot is very good, the acting is very good, and the music is very good. It is not recommended to change the default presence_penalty value of QVQ models. The Java SDK does not support setting this parameter*.* When calling over HTTP, put presence_penalty into the parameters object.vl_high_resolution_images boolean(Optional) Default value is falseFor qwen4-max, even if vl_high_resolution_images=true, an explicitly passed max_pixels still takes effect.Whether to raise the pixel limit of input images to the pixel value corresponding to 16384 Tokens. Related documentation: Process high-resolution images.
In the Java SDK, it is vlHighResolutionImages (minimum required version is 2.20.8). When calling via HTTP, put vl_high_resolution_images in the parameters object.vl_enable_image_hw_output boolean (optional), default value is falseWhether to return the dimensions of the scaled image. The model scales input images; when set to True, the height and width of the scaled image are returned. When streaming output is enabled, this information is returned in the last chunk. Supports Qwen-VL models.In the Java SDK, it is vlEnableImageHwOutput, and the minimum Java SDK version is 2.20.8*.* When calling via HTTP, put vl_enable_image_hw_output in the parameters object.max_tokens integer (optional, to be deprecated soon)
This parameter will be deprecated soon; for new integrations, use The meaning of this parameter varies by model, as follows:
In the Java SDK, it is maxTokens (for Qwen VL/Audio models, it is maxLength, and versions after 2.18.4 also support setting it to maxTokens). When calling via HTTP, put max_tokens in the parameters object.max_completion_tokens integer (optional)The maximum length of the model output, including the chain-of-thought and the model response. When the model output exceeds this value, generation stops early and the returned finish_reason is length.For GLM models, see the table in the max_tokens parameter for the default and maximum values; for other models, both the default and maximum values are the model's maximum output length.Difference from max_tokens: max_completion_tokens always limits the model's complete output (chain-of-thought + response); the specific limit of max_tokens varies by model and thinking_budget settings, see the descriptions above. For thinking models, max_completion_tokens is recommended.The following models are supported:
Except for the ZHIPU direct GLM models listed in the table above, none of the above models include other third-party direct-supply models.
There may be a discrepancy of up to 10 tokens between the actual number of output tokens and the set The Java SDK does not currently support this parameter. When calling via HTTP, put max_completion_tokens in the parameters object.seed integer (optional)Random number seed. Used to ensure that generation results are reproducible under the same input and parameters. If the same seed is passed on each call with other parameters unchanged, the model will return the same result as much as possible.Value range: [0,2 31 −1].
seed default value For all other models, it is 1234. When calling via HTTP, put seed in the parameters object.stream boolean (optional), default value is falseWhether to stream the response. Parameter values:
This parameter is supported only by the Python SDK. To enable streaming output with the Java SDK, call the Qwen3 commercial models (thinking mode), Qwen3 open-source models, QwQ, and QVQ support streaming output only.incremental_output boolean (optional) Default is false (the default value is true for Qwen3-Max, Qwen3-VL, Qwen3 open-source models, QwQ, and QVQ models)Whether to enable incremental output in streaming mode. We recommend setting it to true first.Python SDK 2.0 returns increments by default during streaming output (incremental_output defaults to true), so this parameter does not need to be set.Parameter values:
In the Java SDK, this is incrementalOutput. When calling via HTTP, put incremental_output into the parameters object. QwQ models and Qwen3 models in thinking mode support only
Qwen3 open-source models do not support setting this parameter to response_formatobject (optional) Default value is {"type": "text"}The format of the returned content. Valid values:
Related documentation: Structured output. The models supported by If you specify In the Java SDK, this is responseFormat*.* When calling via HTTP, put response_format into the parameters object.
Properties type string(Required)The format of the returned content. Valid values:
object (optional)Required when type is json_schema; it defines the JSON structure that the model output must follow. Related documentation: Obtain output in a specified format.With the DashScope method, you must manually construct the JSON Schema; for the format and examples, see Obtain output in a specified format. The Java SDK is not supported yet.
Properties name string (required)The name of the Schema.schemaobject (required)The JSON Schema object that describes the output structure. Use properties to define the field structure, required to declare the list of mandatory fields, and additionalProperties to control whether fields not defined in the Schema are allowed in the output (recommended to set to false, i.e., only output defined fields). Supported data types: string, number, integer, boolean, object, array, enum. Related documentation: Configuration guide.strictboolean (optional)Whether to strictly follow the structure defined by schema. We recommend setting it to true.string (optional) Default is text (the default value is message for Qwen3-Max, Qwen3-VL, QwQ models, Qwen3 open-source models, and Qwen-Long models)The format of the returned data. We recommend setting it to message first, which makes it easier to have multi-turn conversations.Python SDK 2.0 always returns the message format, so you do not need to set this parameter; this parameter only matters for HTTP API calls.
The platform will later change the default value to In the Java SDK, this is resultFormat. When calling via HTTP, put result_format into the parameters object.
When the model is Qwen-VL/QVQ/Audio, setting Qwen3-Max, Qwen3-VL, and Qwen3 models in thinking mode can only be set to If you use the Java SDK to call Qwen3 open-source models and pass inlogprobs boolean (Optional) Default value: falseWhether to return the log probabilities of output tokens. Valid values:
When calling via HTTP, put logprobs into the parameters object.top_logprobs integer (Optional) Default value: 0Specifies the number of highest-probability candidate tokens returned by the model at each generation step.Value range: [0,5]Takes effect only when logprobs is true.In the Java SDK, this is topLogprobs. When calling via HTTP, put top_logprobs into the parameters object.n integer (Optional) Default value: 1The number of responses to generate. Value range: 1-4. For scenarios that require multiple responses (such as creative writing and ad copy), you can set a larger n value.kimi/kimi-k3.1-pro and kimi/kimi-k3.1-pro-highspeed do not support this parameter.
Currently, only Setting a larger n value does not increase input token consumption, but increases output token consumption. When calling via HTTP, put n into the parameters object.stop string or array (Optional)Specifies stop words. When the text generated by the model contains a string or token_id specified by stop, generation stops immediately.You can pass in sensitive words to control the model's output.When stop is an array, you cannot use both When calling via HTTP, put stop into the parameters object.tools array (Optional)An array containing one or more tool objects for the model to call in Function Calling. Related documentation: Function CallingWhen using tools, you must set result_format to message.When initiating Function Calling or submitting tool execution results, you must set the tools parameter.
Properties type string(Required)The tool type. Currently, only function is supported.functionobject(Required)
Properties name string (required)The name of the tool function. It must consist of letters and digits, and can contain underscores and hyphens, with a maximum length of 64.descriptionstring(Required)The description of the tool function, which helps the model determine when and how to call the tool function.parametersobject(Optional) The default value is {}The parameter description of the tool, which must be a valid JSON Schema. For a description of JSON Schema, see link. If the parameters parameter is empty, it indicates that the tool has no input parameters (for example, a time query tool).
To improve the accuracy of tool calling, we recommend that you pass in When calling via HTTP, put tools into the parameters object. The qwen-vl and qwen-audio series models are not supported for now.tool_choice string or object(Optional) The default value is autoThe tool selection policy. If you need to force a specific tool calling behavior for certain types of questions (for example, always using a specific tool or disabling all tools), you can set this parameter.
In the Java SDK, it is toolChoice. When calling via HTTP, put tool_choice into the parameters object.parallel_tool_calls boolean (Optional) The default value is falseWhether to enable parallel tool calling.kimi/kimi-k3.1-pro and kimi/kimi-k3.1-pro-highspeed do not support this parameter.Valid values:
In the Java SDK, it is parallelToolCalls. When calling via HTTP, put parallel_tool_calls into the parameters object.enable_search boolean(Optional) The default value is falseWhether the model uses internet search results as reference when generating text. Valid values are as follows:
In the Java SDK, this is enableSearch. When calling through HTTP, put enable_search into the parameters object. Enabling the Internet search function may increase Token consumption.search_options object (optional)The policy for web search. Only takes effect when enable_search is true. For more information, see Web search.When calling through HTTP, put search_options into the parameters object. In the Java SDK, this is searchOptions.
Properties enable_source boolean (optional) The default value is falseWhether to display the retrieved search results in the response. Parameter values:
boolean (optional) The default value is falseWhether to enable corner marker annotation in the [1] or [ref_1] style. Takes effect when enable_source is true. Parameter values:
string (optional) The default value is "[<number>]"The corner marker style. Takes effect when enable_citation is true. Parameter values:
boolean (optional) The default value is falseWhether to forcibly enable search. Parameter values:
string (optional) The default value is turboThe policy for searching Internet information.Valid values:
boolean (Optional) The default value is false.In streaming output with enable_source set to true, you can use prepend_search_result to configure whether the first returned data packet contains only search source information. The valid values are:
The DashScope Java SDK is not currently supported. string (Optional)In addition to the content moderation capabilities of the Qwen API, you can use the AI guardrail to further identify non-compliant information in the input and output content. The value is a JSON string. input and output correspond to the input and output. When a field is set to cip, the AI guardrail further inspects content in that direction. The two fields can be set separately:
-H "X-DashScope-DataInspection: {\"input\": \"cip\", \"output\": \"cip\"}".When you call with the Python SDK, configure it using headers: headers={'X-DashScope-DataInspection': '{"input":"cip","output":"cip"}'}.For detailed usage, see Input and output AI safety guardrails. To enable the guardrail without modifying your calling code, use the workspace-level switches.This is not supported by the Java SDK. This is not applicable to Qwen-Audio series models.skill array(Optional)The skill parameter, which is used to enable specific generation skills, such as PPT generation. Only the qwen-doc-turbo model supports this. For more information, see Generate a PPT.When you call over HTTP, place skill in the parameters object. When using skill, stream must be set to true.
Properties type string(Required)The skill type. The currently supported value is:
string (Optional)The PPT generation mode. The valid values are:
string (Optional)The PPT template ID. This is used if mode is general or if mode is not set. The valid values are:
|
|
Chat response object (streaming and non-streaming output formats are consistent)request_idstringThe unique ID for this call.The Java SDK returns the parameter as requestId.code stringThe error code. Returned when the call fails.When a Python SDK 2.0 call fails, it does not return envelope fields; instead, it throws a DashScopeError (e.code/e.status_code/e.message/e.request_id).output objectThe information about the call result.
Properties text stringThe reply that is generated by the model. If the input parameter result_format is set to text, the reply content is returned in this field.finish_reasonstringThis parameter is not empty if the input parameter result_format is set to text.This can occur in the following four situations:
arrayThe model output information. The choices parameter is returned when result_format is message.
Properties finish_reason stringThis can occur in the following four situations:
objectThe message object that is output by the model.
Properties role stringThe role of the output message, fixed as assistant.contentstring or arrayThe content of the output message. This is an array if you use qwen-vl or qwen-audio series models, and a string in other cases.If function calling is initiated, this value is empty.
Properties text stringThe content of the output message if you use qwen-vl or qwen-audio series models.image_hwarrayWhen the vl_enable_image_hw_output parameter is enabled for Qwen-VL series models, there are two cases:
stringqwen4-max, thinking_display="summarized": Send the enabling parameter in every turn. Echo encrypted content unchanged; do not read, truncate, re-encode, modify, or concatenate it across turns. A summary cannot replace reasoning history. Thinking summary and encryption.reasoning_content stringThe model's deep thinking content.tool_callsarrayIf the model needs to call a tool, the tool_calls parameter is generated.
Properties function objectThe name of the tool that is being called and its input parameters.
Properties name stringThe name of the tool that is being called.argumentsstringThe parameters to be input into the tool, as a JSON string.Due to the randomness of the LLM's response, the output JSON string may not always satisfy your function. We recommend that you validate the parameters before you input them into the function. integerThe index of the current tool_calls object in the tool_calls array.id stringThe ID of this tool response.type stringThe tool type, which must be function.objectThe probability information of the current choices object.
Properties content arrayAn array of tokens with log probability information.
Properties token stringThe current token.bytes arrayA list of the raw UTF-8 bytes of the current token. This is useful for accurately reconstructing the output content, especially when you handle emojis and Chinese characters.logprob floatThe log probability of the current token. A null value indicates an extremely low probability.top_logprobs arrayThe most likely tokens at the current token position and their log probabilities. The number of elements is consistent with the input parameter top_logprobs.
Properties token stringThe current token.bytes arrayA list of the raw UTF-8 bytes of the current token. This is useful for accurately reconstructing the output content, especially when you handle emojis and Chinese characters.logprob floatThe log probability of the current token. A null value indicates an extremely low probability.objectThe information that is searched on the web. This parameter is returned after you set the search_options parameter.
Properties search_results arrayThe results that are searched on the web.
Properties site_name stringThe name of the website from which the search result originated.iconstringThe URL of the source website's icon. If there is no icon, this is an empty string.indexintegerThe serial number of the search result, which indicates its index in search_results.titlestringThe title of the search result.urlstringThe link address of the search result.arrayThe domain-specific enhancement information that is returned after you enable the enable_search_extension parameter.
Properties result stringThe domain-specific enhancement tool output information.toolstringThe tool that is used for domain-specific enhancement.mapThe token information for this chat request.
Properties input_tokens integerThe length of the user input content after it is converted to tokens. For more information, see Additional information.output_tokens integerThe length of the model output content after it is converted to tokens.input_tokens_details object (Optional)Details of the length of the input content after it is converted to tokens.
Properties text_tokens integer (Optional)The length of the input text after it is converted to tokens.image_tokens integer (Optional)The length of the input image after it is converted to tokens.video_tokens integer (Optional)The length of the input video file or image list after it is converted to tokens.integerThis field is returned when the input is plain text, and is the sum of input_tokens and output_tokens.image_tokens integerThis field is returned if the input content includes an image. It is the length of the user's input image content after it is converted to tokens.video_tokens integerThis field is returned if the input content includes a video. It is the length of the user's input video content after it is converted to tokens.audio_tokens integerThis field is returned if the input content includes an audio. It is the length of the user's input audio content after it is converted to tokens.output_tokens_details object (Optional)Details of the length of the output content after it is converted to tokens. This field is returned only by some models.
Properties text_tokens integer (Optional)The length of the output text after it is converted to tokens.reasoning_tokens integer (Optional)The length of the thinking process after it is converted to tokens. This field is returned only for reasoning models.audio_tokens integer (Optional)The length of the output audio after it is converted to tokens. This field is returned only for audio output models.objectA fine-grained classification of input tokens.
Properties cached_tokens integerThe number of tokens that hit the cache. For more information about context cache, see Context cache.cache_creation objectInformation about explicit cache creation.
Properties ephemeral_5m_input_tokens integerThe length of the tokens that are used to create an explicit cache with a 5-minute validity period.integerThe length of the tokens that are used to create an explicit cache.cache_type stringIf you use explicit caching, the parameter value is ephemeral. Otherwise, this parameter does not exist. |