Skip to main content

List available modes

Call requirements, permissions, request fields, response fields, and error handling.

Request and permissions

GET https://openapi.qwenwork.ai/v1/session/session-modes Authentication: Authorization: Bearer <access_token>; use an access token obtained through user OAuth authorization. Required business Scope: session.mode.read Authorization methods declared by the contract: Organization authorization (organization), personal authorization (personal) The platform must enable the Scope for the application. The user must have the corresponding business permissions, and the target resource must be within their accessible scope. Whether personal or organization authorization is available to the application depends on the actual console configuration.

Behavior and limitations

Returns mode values the caller can pass to POST /sessions. The mode used when mode is omitted is marked default: true. The set is resolved per request and varies by account and deployment, so obtain it from this endpoint rather than hard-coding it. This is also why mode is an open enum: a closed enum would make generated clients reject tiers the account actually has. name is the display name, localized according to Accept-Language (zh or en). So is description—a one-sentence explanation of what the tier does best. This endpoint's response alone is enough to build a selector. mode is the value to send back to this API. Call through the open platform, retaining the existing oauth_app Token, identity resolution, application IP restrictions, and resource ownership checks. Cloud and remote-control parameters retain their actual contract semantics. Short paths such as /sessions in this page are relative to the common prefix /v1/session. Use the full path at the top of this page for actual requests.

Header parameters

ParameterTypeRequiredDescription and constraints
Accept-LanguagestringNoLanguage for the human-readable name and description fields. Only Chinese and English are supported: values starting with zh select Chinese; every other value—including omitting this header—selects English.
Language for the human-readable name and description fields. Only Chinese and English are supported: values starting with zh select Chinese; every other value—including omitting this header—selects English.

Request body

The public contract declares no request body. Do not add identity fields or undeclared business fields.

Successful responses

Preserve the original response structure of each business endpoint; do not add a common code/msg/data wrapper.

HTTP 200

Success Response type: application/json
FieldTypeRequiredDescription and constraints
$schemastringNoURL of the JSON Schema for this object.
Format: "uri"
itemsarrayYesModes available to this account. Resolved per request, not a global catalogue, so do not reuse across accounts.
items[]objectNoAdditional fields: false
items[].defaultbooleanYesWhether this mode is selected when POST /sessions omits mode. Resolved per request; if no mode is marked as default, mode must be passed explicitly.
items[].descriptionstringNoOne-sentence explanation of what this mode does best, localized according to Accept-Language. Display next to name in a selector. May be absent; treat as optional rather than assuming it always has a value.
items[].modestringYesValue to pass as mode in POST /sessions.
items[].namestringYesDisplay name, localized according to Accept-Language. Use this for people and mode for API requests.

Error responses

HTTPDescription and handling
defaultError. Branch on code, not just the HTTP status code—multiple conditions can share the same status code.
Retain the request ID and error fields in the response for troubleshooting. A write operation may already have taken effect after a timeout or disconnection. Do not automatically retry merely because no successful response was received.

Full field contract

The JSON below contains the complete request, response, and error schemas, nested constraints, and public extension definitions for this endpoint. Copy it for verification. Success examples not declared in the contract are not inferred.
{
  "components": {
    "schemas": {
      "SessionPublicErrorBody": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "Stable machine-readable error code. Branch on it rather than the HTTP status code, because different conditions can share the same status. New codes may be added; treat unrecognized values as unexpected errors in that HTTP status class.",
            "examples": [
              "VALIDATION_ERROR"
            ],
            "type": "string"
          },
          "detail": {
            "description": "Structured context whose shape depends on code—for example, the fields rejected by validation. null when no additional information is available."
          },
          "message": {
            "description": "Human-readable explanation for logs and error displays. The wording is not part of the contract and may change without a version increment.",
            "examples": [
              "Request validation failed"
            ],
            "type": "string"
          },
          "trace_id": {
            "description": "W3C trace id for this request. Include it when reporting problems—it locates the request in platform logs. If the request carried no trace context, this is 32 zero characters.",
            "examples": [
              "00000000000000000000000000000000"
            ],
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "detail",
          "trace_id"
        ],
        "type": "object"
      },
      "SessionPublicModeInfo": {
        "additionalProperties": false,
        "properties": {
          "default": {
            "description": "Whether this mode is selected when POST /sessions omits mode. Resolved per request; if no mode is marked as default, mode must be passed explicitly.",
            "type": "boolean"
          },
          "description": {
            "description": "One-sentence explanation of what this mode does best, localized according to Accept-Language. Display next to name in a selector. **May be absent**; treat as optional rather than assuming it always has a value.",
            "type": "string"
          },
          "mode": {
            "description": "Value to pass as mode in POST /sessions.",
            "type": "string"
          },
          "name": {
            "description": "Display name, localized according to Accept-Language. Use this for people and mode for API requests.",
            "type": "string"
          }
        },
        "required": [
          "mode",
          "name",
          "default"
        ],
        "type": "object"
      },
      "SessionPublicModeListResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "URL of the JSON Schema for this object.",
            "examples": [
              "https://example.com/schemas/ModeListResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "items": {
            "description": "Modes available to this account. Resolved per request, not a global catalogue, so do not reuse across accounts.",
            "items": {
              "$ref": "#/components/schemas/SessionPublicModeInfo"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "SessionRelayError": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "error_description",
          "error_code"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "OpenPlatformBearer": {
        "description": "Authorization: Bearer <access_token>; JSON Content-Type: application/json; charset=utf-8. The current CN Review temporarily allows access only for routing debugging.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/session/session-modes": {
      "get": {
        "description": "Returns `mode` values the caller can pass to `POST /sessions`. The mode used when `mode` is omitted is marked `default: true`.\n\nThe set is resolved per request and varies by account and deployment, so obtain it from this endpoint rather than hard-coding it. This is also why `mode` is an open enum: a closed enum would make generated clients reject tiers the account actually has.\n\n`name` is the display name, localized according to `Accept-Language` (`zh` or `en`). So is `description`—a one-sentence explanation of what the tier does best. This endpoint's response alone is enough to build a selector. `mode` is the value to send back to this API.\nCall through the open platform, retaining the existing oauth_app Token, identity resolution, application IP restrictions, and resource ownership checks. Cloud and remote-control parameters retain their actual contract semantics.",
        "operationId": "publishedList-modes",
        "parameters": [
          {
            "description": "Language for the human-readable name and description fields. Only Chinese and English are supported: values starting with zh select Chinese; every other value—including **omitting this header**—selects English.",
            "in": "header",
            "name": "Accept-Language",
            "schema": {
              "description": "Language for the human-readable name and description fields. Only Chinese and English are supported: values starting with zh select Chinese; every other value—including **omitting this header**—selects English.",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPublicModeListResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, for log correlation and troubleshooting. Retries generate new IDs; this is not an idempotency key or distributed Trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open-platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if the sample was not retained.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionPublicErrorBody"
                    },
                    {
                      "$ref": "#/components/schemas/SessionRelayError"
                    }
                  ]
                }
              }
            },
            "description": "Error. Branch on `code`, not just the HTTP status code—multiple conditions can share the same status code.",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, for log correlation and troubleshooting. Retries generate new IDs; this is not an idempotency key or distributed Trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open-platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if the sample was not retained.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "OpenPlatformBearer": []
          }
        ],
        "summary": "List available modes",
        "tags": [
          "执行模式"
        ]
      }
    }
  },
  "info": {
    "title": "List available modes",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.