Skip to main content
Specialized Models

Decision model API reference

Call POST /compatible-mode/v1/systemone to use the QwenCloud decision model (decision-model-preview), which returns classification, scoring, and yes/no decisions with full probability distributions and confidence in a single forward pass, without generating text.

POST
https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1/systemone
cURL
# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl -sS -X POST https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1/systemone \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "decision-model-preview",
    "state": {"ticket_id": "T-1001", "content": "Payment not received 24 hours after order, user unable to use core service."},
    "questions": {
      "department": {"type": "choice", "instructions": "Which team should handle this?",
                     "criteria": {"billing": "Payment, refund and billing issues", "technical": "Product faults and integration issues"}},
      "escalate":   {"type": "noul",  "instructions": "Should on-call staff be notified immediately?"},
      "severity":   {"type": "score", "instructions": "How severe is this issue?",
                     "criteria": ["Minor issue, no functional impact", "Some features affected, workaround available",
                                  "Core feature unavailable, no workaround", "Severe business or security impact"]}
    }
  }'
{
  "model": "decision-model-preview",
  "request_id": "7b986c65-b223-9341-b5f0-b988e27ecaac",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "billing",
      "confidence": 0.88,
      "probabilities": {
        "billing": 0.94,
        "technical": 0.06
      }
    },
    "escalate": {
      "type": "noul",
      "noul": 0.99
    },
    "severity": {
      "type": "score",
      "score": 2.25,
      "confidence": 0.91,
      "legend": {
        "0": "Minor issue, no functional impact",
        "1": "Some features affected, workaround available",
        "2": "Core feature unavailable, no workaround",
        "3": "Severe business or security impact"
      },
      "probabilities": {
        "0": 0,
        "1": 0.01,
        "2": 0.73,
        "3": 0.26
      }
    }
  },
  "usage": {
    "input_tokens": 125
  },
  "latency_ms": 52.9
}

Prerequisites

You have created an API key and configured it as the environment variable DASHSCOPE_API_KEY. See Configure an API key as an environment variable. Supported regions: Singapore and China North 2 (Beijing). Use an API key and endpoint from the region you call; see Regions and endpoints.

Request

Protocol: TypeSafe System One (POST /compatible-mode/v1/systemone) A single request carries a business state and several typed questions (choice / noul / score). The model returns the decision result and probability distribution for each question in a single forward pass, with choice and score additionally returning confidence, without generating text, so latency and cost are independent of output length.
decision-model-preview does not support streaming, Function Calling, web search, or structured output. The model output is a structured decision result (probability distributions and confidence), not generated text.
The DashScope SDKs support the decision model: Python SDK 2.0.1 or later provides the client.decision.create interface, and Java SDK 2.23.3 or later provides the com.alibaba.dashscope.decision package. You can also call it with the generic TypeSafe SDK (typesafe-sdk). On failure, the Python SDK raises a DashScopeError exception and the Java SDK raises an ApiException.

Authorizations

string
header
required

QwenCloud API key, in the format Bearer $DASHSCOPE_API_KEY. See Get an API key.

Body

application/json
enum<string>
required

Model name: decision-model-preview.

decision-model-preview
Text
required

The business state to make decisions on: ticket text, a conversation, or a structured object (objects are serialized before being sent to the model).

object
required

A map of questions. The key is a caller-defined question id; the value is a question object with the following fields.

Response

200-application/json
string

Model name echoed back.

string

Request ID, for troubleshooting.

object

A map of answers. The key corresponds to the question id in the request; the value is an answer object with the following fields.

object

Metering information.

number

Server-side latency (milliseconds).

Decision model API reference - QwenCloud