Skip to main content

发送 prompt

调用条件、权限、请求字段、响应字段与错误处理。

请求与权限

POST https://openapi.qwenwork.ai/v1/session/sessions/{session_id}/prompt 鉴权:Authorization: Bearer <access_token>;使用用户 OAuth 授权获得的访问令牌。 所需业务 Scope:session.session.execute 契约声明的授权方式:组织授权(organization)、个人授权(personal) Scope 需由平台为应用开通;用户须有相应业务权限,目标资源须在其可访问范围内。个人/组织方式是否为该应用开放,以控制台实际配置为准。

功能与限制

省略 session_type 表示云端会话。每次远控请求均须使用 session_type=remote 并提供非空 device_id。云端传入 device_id、类型为空或未知、重复目标参数均返回 422 VALIDATION_ERROR。不提供跨设备聚合列表或自动回退云端。两种类型使用相同认证链路;开放平台按接口声明执行对应 Scope 校验。 云端会话: 把一个 prompt 排入队列作为下一个 turn。 返回 202,表示 prompt 已入队而不是已执行。进展可通过事件流或 GET /sessions/{session_id} 跟踪。 如果 runtime 处于休眠状态,这次调用会先把它恢复,因此耗时可能明显长于平常。请相应设置客户端超时。 向已结束的 session 发送会返回 409。prompt 文本会经过内容安全检查,可能被 403 拒绝。 远控会话: 与云端会话复用公共网关认证;本接口要求下述业务 Scope。不需要控制端设备 ID 或配对。目标远控总开关必须开启。明确关闭时返回 403 FORBIDDEN,detail.reason=ACP_HOST_DISABLED;被拒绝的写请求返回 detail.acceptance=not_accepted。明确不存在的会话返回 404 NOT_FOUND,detail.reason=SESSION_NOT_FOUND。命令只路由到登录在当前认证账号下的目标连接。离线、未知及其他账号的目标统一返回设备不可用。拒绝未知请求体字段。所有写操作要求 Idempotency-Key。超时或断线后不得自动重试,即使使用相同键:受理状态可能未知,桌面去重有界且不保证跨重启持久。错误包含 detail.acceptance(not_accepted 或 unknown)。不提供排队、离线执行或自动回退云端。仅在收到桌面明确的受理回执后返回 202。忙碌会话返回 409,reason=SESSION_BUSY。返回的 turn_id 用于关联后续事件。文件以目标账号下载;后续下载或执行失败通过事件报告。 通过开放平台调用;保持既有 oauth_app Token、身份解析、应用 IP 限制及资源归属校验。云端与远控参数按真实契约保留。 本页说明中的 /sessions 等短路径均相对于公共前缀 /v1/session。实际请求请使用本页顶部的完整路径。 支持的会话类型:cloud、remote 完整 JSON 中的 x-session-variants 分别保留云端和远控的参数、请求体及响应,不能把两类分支字段混用。

路径参数

参数类型必填说明及约束
session_idstring是会话标识:云端为 UUID;远控为所选设备上的不透明标识。
最短长度:1
最长长度:256

查询参数

参数类型必填说明及约束
session_typestring否省略 session_type 表示云端会话。每次远控请求均须使用 session_type=remote 并提供非空 device_id。云端传入 device_id、类型为空或未知、重复目标参数均返回 422 VALIDATION_ERROR。不提供跨设备聚合列表或自动回退云端。两种类型使用相同认证链路;开放平台按接口声明执行对应 Scope 校验。
默认值:"cloud"
可选值:["cloud", "remote"]
device_idstring否仅远控必填。来自设备发现的不透明目标设备标识,必须进行 URL 编码。目标连接必须登录在当前认证账号下。
最短长度:1
最长长度:256

请求头参数

参数类型必填说明及约束
Idempotency-Keystring否仅远控会话:在账号、设备、会话和操作范围内稳定的键。不允许斜杠、反斜杠、空白或控制字符。凭证与控制端 ID 不参与键的构成。
在账号、设备、会话和操作范围内稳定的键。不允许斜杠、反斜杠、空白或控制字符。凭证与控制端 ID 不参与键的构成。
最短长度:1
最长长度:128

请求体

请求体必填。

application/json

子字段的“必填”在所属对象存在时生效;联合类型的各分支分别列出,不代表同时要求所有分支字段。
字段类型必填说明及约束
$schemastring否至少满足一种:分支 1
指向本对象 JSON Schema 的 URL。
格式:"uri"
attachmentsarray否至少满足一种:分支 1
提供给 agent 的补充文本,不在 QwenWork 会话界面展示,也不用于生成标题。最多 10 个 hidden_text 附件,文本合计不超过 100000 个 UTF-8 字节。各项按数组顺序随本次 prompt 提交,不会在后续轮次自动重复注入。内容仍保留在原始事件中,agent 也可能复述,请勿用来存放秘密。省略或传入 [] 表示无附件;不接受 null。
最多元素:10
attachments[]object否至少满足一种:分支 1
额外字段:false
attachments[].textstring是至少满足一种:分支 1
提供给 agent 的非空白文本,计入附件文本合计 100000 个 UTF-8 字节的限制。不赋予 system 角色或额外权限。
最短长度:1
最长长度:100000
attachments[].typestring是至少满足一种:分支 1
附件类型。hidden_text 将文本发送给 agent,但不作为用户正文或附件卡片展示。
可选值:["hidden_text"]
filesarray否至少满足一种:分支 1
要附带的文件,最多 50 个。文件必须已经在存储里 —— 这个 API 不负责上传。
最多元素:50
files[]object否至少满足一种:分支 1
额外字段:false
files[].pathstring是至少满足一种:分支 1
已有文件的存储路径,例如一次上传或此前某个 session 的产物。不能包含 ".."。只能访问当前鉴权账号拥有的文件。
最短长度:1
textstring是至少满足一种:分支 1
给 agent 的指令。1 到 100000 个字符。
最短长度:1
最长长度:100000
$schemastring否至少满足一种:分支 2
指向本对象 JSON Schema 的 URL。
格式:"uri"
filesarray否至少满足一种:分支 2
要附带的文件,最多 50 个。文件必须已经在存储里 —— 这个 API 不负责上传。
最多元素:50
files[]object否至少满足一种:分支 2
额外字段:false
files[].pathstring是至少满足一种:分支 2
已有文件的存储路径,例如一次上传或此前某个 session 的产物。不能包含 ".."。只能访问当前鉴权账号拥有的文件。
最短长度:1
textstring是至少满足一种:分支 2
给 agent 的指令。1 到 100000 个字符。
最短长度:1
最长长度:100000

成功响应

保持各业务接口原始响应结构,不统一添加 code/msg/data 包装。

HTTP 202

已接受 响应类型:application/json
字段类型必含说明及约束
$schemastring否至少满足一种:分支 1
指向本对象 JSON Schema 的 URL。
格式:"uri"
prompt_idstring是至少满足一种:分支 1
排队中这个 prompt 的 id。趁它还在等待时可以用它撤回:DELETE /sessions/{id}/prompt-queue/{prompt_id}。
statusstring是至少满足一种:分支 1
固定为 "queued"。表示 prompt 已被接受,但还没开始执行。请轮询 GET /sessions/{id},或等待 prompt_response 事件。
turn_idstring是至少满足一种:分支 1
这个 prompt 将会作为哪个 turn 执行的 id。turn 还没开始就能拿到 —— 留着它,之后可以查 GET /turns/{turn_id},或者用来过滤事件流。
$schemastring否至少满足一种:分支 2
指向本对象 JSON Schema 的 URL。
格式:"uri"
prompt_idstring是至少满足一种:分支 2
—
session_idstring是至少满足一种:分支 2
—
statusstring是至少满足一种:分支 2
可选值:["accepted"]
turn_idstring是至少满足一种:分支 2
—

错误响应

HTTP说明及处理
default错误。分支判断要基于 code,不要只看 HTTP 状态码 —— 多种情况会共用同一个状态码。
保留响应中的请求 ID 和错误字段用于排查。写操作超时或断线后可能已经生效,不能仅凭没有收到成功响应就自动重试。

完整字段契约

下方 JSON 包含本接口完整请求、响应、错误 Schema、嵌套约束和公开扩展定义,可复制用于核对。未声明的成功示例不作推测。
{
  "components": {
    "schemas": {
      "SessionPublicErrorBody": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "稳定的、供程序判断的错误码。分支判断请基于它而不是 HTTP 状态码,因为多种不同情况会共用同一个状态码。错误码后续可能新增,遇到不认识的值请按该 HTTP 类别下的未预期错误处理。",
            "examples": [
              "VALIDATION_ERROR"
            ],
            "type": "string"
          },
          "detail": {
            "description": "结构化的上下文,形状取决于 code —— 比如校验失败时会给出哪些字段被拒。没有额外信息时为 null。"
          },
          "message": {
            "description": "给人看的说明,用于日志和错误展示。文案不属于契约,可能在不升版本的情况下改动。",
            "examples": [
              "Request validation failed"
            ],
            "type": "string"
          },
          "trace_id": {
            "description": "本次请求的 W3C trace id。反馈问题时请带上它 —— 平台日志里靠它定位这次请求。请求没有携带 trace context 时,这里是 32 个 0 字符。",
            "examples": [
              "00000000000000000000000000000000"
            ],
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "detail",
          "trace_id"
        ],
        "type": "object"
      },
      "SessionPublicHiddenTextAttachment": {
        "additionalProperties": false,
        "properties": {
          "text": {
            "description": "提供给 agent 的非空白文本,计入附件文本合计 100000 个 UTF-8 字节的限制。不赋予 system 角色或额外权限。",
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "description": "附件类型。hidden_text 将文本发送给 agent,但不作为用户正文或附件卡片展示。",
            "enum": [
              "hidden_text"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "text"
        ],
        "type": "object"
      },
      "SessionPublicPromptFile": {
        "additionalProperties": false,
        "properties": {
          "path": {
            "description": "已有文件的存储路径,例如一次上传或此前某个 session 的产物。不能包含 \"..\"。只能访问当前鉴权账号拥有的文件。",
            "examples": [
              "/Uploads/sales.csv"
            ],
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "path"
        ],
        "type": "object"
      },
      "SessionPublicPromptRequest": {
        "additionalProperties": false,
        "description": "仅适用于云端会话。省略 session_type 或使用 cloud。任务输入支持 text、files 和 hidden_text 附件。",
        "properties": {
          "$schema": {
            "description": "指向本对象 JSON Schema 的 URL。",
            "examples": [
              "https://example.com/schemas/PromptRequest.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "attachments": {
            "description": "提供给 agent 的补充文本,不在 QwenWork 会话界面展示,也不用于生成标题。最多 10 个 hidden_text 附件,文本合计不超过 100000 个 UTF-8 字节。各项按数组顺序随本次 prompt 提交,不会在后续轮次自动重复注入。内容仍保留在原始事件中,agent 也可能复述,请勿用来存放秘密。省略或传入 [] 表示无附件;不接受 null。",
            "items": {
              "$ref": "#/components/schemas/SessionPublicHiddenTextAttachment"
            },
            "maxItems": 10,
            "type": "array"
          },
          "files": {
            "description": "要附带的文件,最多 50 个。文件必须已经在存储里 —— 这个 API 不负责上传。",
            "items": {
              "$ref": "#/components/schemas/SessionPublicPromptFile"
            },
            "maxItems": 50,
            "type": "array"
          },
          "text": {
            "description": "给 agent 的指令。1 到 100000 个字符。",
            "examples": [
              "Now chart the monthly totals."
            ],
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "PromptRequest",
        "type": "object"
      },
      "SessionPublicPromptResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "指向本对象 JSON Schema 的 URL。",
            "examples": [
              "https://example.com/schemas/PromptResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "prompt_id": {
            "description": "排队中这个 prompt 的 id。趁它还在等待时可以用它撤回:DELETE /sessions/{id}/prompt-queue/{prompt_id}。",
            "examples": [
              "7d3c9b02-1e46-4a85-9f70-2c58b41ea6d9"
            ],
            "type": "string"
          },
          "status": {
            "description": "固定为 \"queued\"。表示 prompt 已被接受,但还没开始执行。请轮询 GET /sessions/{id},或等待 prompt_response 事件。",
            "examples": [
              "queued"
            ],
            "type": "string"
          },
          "turn_id": {
            "description": "这个 prompt 将会作为哪个 turn 执行的 id。turn 还没开始就能拿到 —— 留着它,之后可以查 GET /turns/{turn_id},或者用来过滤事件流。",
            "examples": [
              "2f7a1e88-4c05-4b93-8d61-3ea90c5b7d24"
            ],
            "type": "string"
          }
        },
        "required": [
          "prompt_id",
          "turn_id",
          "status"
        ],
        "type": "object"
      },
      "SessionPublicRemoteInitialPrompt": {
        "additionalProperties": false,
        "description": "仅适用于远控会话。选择 session_type=remote 并填写 device_id。任务输入仅接受 text 和 files,不支持 attachments,包括 [] 或 null。",
        "properties": {
          "$schema": {
            "description": "指向本对象 JSON Schema 的 URL。",
            "examples": [
              "https://example.com/schemas/RemoteInitialPrompt.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "files": {
            "description": "要附带的文件,最多 50 个。文件必须已经在存储里 —— 这个 API 不负责上传。",
            "items": {
              "$ref": "#/components/schemas/SessionPublicPromptFile"
            },
            "maxItems": 50,
            "type": "array"
          },
          "text": {
            "description": "给 agent 的指令。1 到 100000 个字符。",
            "examples": [
              "Read sales.csv and produce a weekly summary."
            ],
            "maxLength": 100000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "RemoteInitialPrompt",
        "type": "object"
      },
      "SessionPublicRemotePromptResponse": {
        "additionalProperties": false,
        "properties": {
          "$schema": {
            "description": "指向本对象 JSON Schema 的 URL。",
            "examples": [
              "https://example.com/schemas/RemotePromptResponse.json"
            ],
            "format": "uri",
            "readOnly": true,
            "type": "string"
          },
          "prompt_id": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "accepted"
            ],
            "type": "string"
          },
          "turn_id": {
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "prompt_id",
          "turn_id",
          "status"
        ],
        "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。当前 CN Review 暂时放行仅用于路由调试。",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/session/sessions/{session_id}/prompt": {
      "post": {
        "description": "省略 session_type 表示云端会话。每次远控请求均须使用 session_type=remote 并提供非空 device_id。云端传入 device_id、类型为空或未知、重复目标参数均返回 422 VALIDATION_ERROR。不提供跨设备聚合列表或自动回退云端。两种类型使用相同认证链路;开放平台按接口声明执行对应 Scope 校验。\n\n云端会话:\n把一个 prompt 排入队列作为下一个 turn。\n\n**返回 202**,表示 prompt 已入队而不是已执行。进展可通过事件流或 `GET /sessions/{session_id}` 跟踪。\n\n如果 runtime 处于休眠状态,这次调用会先把它恢复,因此耗时可能明显长于平常。请相应设置客户端超时。\n\n向已结束的 session 发送会返回 409。prompt 文本会经过内容安全检查,可能被 403 拒绝。\n\n远控会话:\n与云端会话复用公共网关认证;本接口要求下述业务 Scope。不需要控制端设备 ID 或配对。目标远控总开关必须开启。明确关闭时返回 403 FORBIDDEN,detail.reason=ACP_HOST_DISABLED;被拒绝的写请求返回 detail.acceptance=not_accepted。明确不存在的会话返回 404 NOT_FOUND,detail.reason=SESSION_NOT_FOUND。命令只路由到登录在当前认证账号下的目标连接。离线、未知及其他账号的目标统一返回设备不可用。拒绝未知请求体字段。所有写操作要求 Idempotency-Key。超时或断线后不得自动重试,即使使用相同键:受理状态可能未知,桌面去重有界且不保证跨重启持久。错误包含 detail.acceptance(not_accepted 或 unknown)。不提供排队、离线执行或自动回退云端。仅在收到桌面明确的受理回执后返回 202。忙碌会话返回 409,reason=SESSION_BUSY。返回的 turn_id 用于关联后续事件。文件以目标账号下载;后续下载或执行失败通过事件报告。\n通过开放平台调用;保持既有 oauth_app Token、身份解析、应用 IP 限制及资源归属校验。云端与远控参数按真实契约保留。",
        "operationId": "publishedSend-prompt",
        "parameters": [
          {
            "description": "会话标识:云端为 UUID;远控为所选设备上的不透明标识。",
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "省略 session_type 表示云端会话。每次远控请求均须使用 session_type=remote 并提供非空 device_id。云端传入 device_id、类型为空或未知、重复目标参数均返回 422 VALIDATION_ERROR。不提供跨设备聚合列表或自动回退云端。两种类型使用相同认证链路;上游不校验 OAuth session scope;开放平台按 manifest 执行对应 Scope 校验。",
            "in": "query",
            "name": "session_type",
            "schema": {
              "default": "cloud",
              "enum": [
                "cloud",
                "remote"
              ],
              "type": "string"
            }
          },
          {
            "description": "仅远控必填。来自设备发现的不透明目标设备标识,必须进行 URL 编码。目标连接必须登录在当前认证账号下。",
            "in": "query",
            "name": "device_id",
            "schema": {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "仅远控会话:在账号、设备、会话和操作范围内稳定的键。不允许斜杠、反斜杠、空白或控制字符。凭证与控制端 ID 不参与键的构成。",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "description": "在账号、设备、会话和操作范围内稳定的键。不允许斜杠、反斜杠、空白或控制字符。凭证与控制端 ID 不参与键的构成。",
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "cloud-files": {
                  "value": {
                    "files": [
                      {
                        "path": "/Uploads/report.csv"
                      }
                    ],
                    "text": "Summarise the report."
                  }
                },
                "cloud-hidden-text": {
                  "value": {
                    "attachments": [
                      {
                        "text": "Focus on the quarterly totals.",
                        "type": "hidden_text"
                      }
                    ],
                    "text": "Summarise the report."
                  }
                },
                "cloud-text": {
                  "value": {
                    "text": "Summarise the report."
                  }
                },
                "remote-files": {
                  "value": {
                    "files": [
                      {
                        "path": "/Uploads/report.csv"
                      }
                    ],
                    "text": "Summarise the report."
                  }
                },
                "remote-text": {
                  "value": {
                    "text": "Summarise the report."
                  }
                }
              },
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SessionPublicPromptRequest"
                  },
                  {
                    "$ref": "#/components/schemas/SessionPublicRemoteInitialPrompt"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionPublicPromptResponse"
                    },
                    {
                      "$ref": "#/components/schemas/SessionPublicRemotePromptResponse"
                    }
                  ]
                }
              }
            },
            "description": "已接受",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SessionPublicErrorBody"
                    },
                    {
                      "$ref": "#/components/schemas/SessionRelayError"
                    }
                  ]
                }
              }
            },
            "description": "错误。分支判断要基于 `code`,不要只看 HTTP 状态码 —— 多种情况会共用同一个状态码。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "OpenPlatformBearer": []
          }
        ],
        "summary": "发送 prompt",
        "tags": [
          "会话管理"
        ],
        "x-session-variants": {
          "cloud": {
            "summary": "发送 prompt",
            "description": "把一个 prompt 排入队列作为下一个 turn。\n\n**返回 202**,表示 prompt 已入队而不是已执行。进展可通过事件流或 `GET /sessions/{session_id}` 跟踪。\n\n如果 runtime 处于休眠状态,这次调用会先把它恢复,因此耗时可能明显长于平常。请相应设置客户端超时。\n\n向已结束的 session 发送会返回 409。prompt 文本会经过内容安全检查,可能被 403 拒绝。",
            "parameters": [
              {
                "description": "POST /sessions 返回的会话 ID。",
                "in": "path",
                "name": "session_id",
                "required": true,
                "schema": {
                  "description": "POST /sessions 返回的会话 ID。",
                  "format": "uuid",
                  "type": "string"
                }
              }
            ],
            "requestBody": {
              "content": {
                "application/json": {
                  "examples": {
                    "cloud-files": {
                      "value": {
                        "files": [
                          {
                            "path": "/Uploads/report.csv"
                          }
                        ],
                        "text": "Summarise the report."
                      }
                    },
                    "cloud-hidden-text": {
                      "value": {
                        "attachments": [
                          {
                            "text": "Focus on the quarterly totals.",
                            "type": "hidden_text"
                          }
                        ],
                        "text": "Summarise the report."
                      }
                    },
                    "cloud-text": {
                      "value": {
                        "text": "Summarise the report."
                      }
                    }
                  },
                  "schema": {
                    "$ref": "#/components/schemas/SessionPublicPromptRequest"
                  }
                }
              },
              "required": true
            },
            "responses": {
              "202": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicPromptResponse"
                    }
                  }
                },
                "description": "已接受"
              }
            }
          },
          "remote": {
            "summary": "向远控会话发送任务",
            "description": "与云端会话复用公共网关认证;本接口要求下述业务 Scope。不需要控制端设备 ID 或配对。目标远控总开关必须开启。明确关闭时返回 403 FORBIDDEN,detail.reason=ACP_HOST_DISABLED;被拒绝的写请求返回 detail.acceptance=not_accepted。明确不存在的会话返回 404 NOT_FOUND,detail.reason=SESSION_NOT_FOUND。命令只路由到登录在当前认证账号下的目标连接。离线、未知及其他账号的目标统一返回设备不可用。拒绝未知请求体字段。所有写操作要求 Idempotency-Key。超时或断线后不得自动重试,即使使用相同键:受理状态可能未知,桌面去重有界且不保证跨重启持久。错误包含 detail.acceptance(not_accepted 或 unknown)。不提供排队、离线执行或自动回退云端。仅在收到桌面明确的受理回执后返回 202。忙碌会话返回 409,reason=SESSION_BUSY。返回的 turn_id 用于关联后续事件。文件以目标账号下载;后续下载或执行失败通过事件报告。",
            "parameters": [
              {
                "description": "目标设备的不透明标识,可能包含 :dev 等后缀。目标连接必须属于当前鉴权账号。",
                "explode": false,
                "in": "query",
                "name": "device_id",
                "required": true,
                "schema": {
                  "description": "目标设备的不透明标识,可能包含 :dev 等后缀。目标连接必须属于当前鉴权账号。",
                  "maxLength": 256,
                  "type": "string"
                }
              },
              {
                "description": "目标设备上的会话标识。",
                "in": "path",
                "name": "session_id",
                "required": true,
                "schema": {
                  "description": "目标设备上的会话标识。",
                  "maxLength": 256,
                  "type": "string"
                }
              },
              {
                "description": "在账号、设备、会话和操作范围内稳定的键。不允许斜杠、反斜杠、空白或控制字符。凭证与控制端 ID 不参与键的构成。",
                "in": "header",
                "name": "Idempotency-Key",
                "required": true,
                "schema": {
                  "description": "在账号、设备、会话和操作范围内稳定的键。不允许斜杠、反斜杠、空白或控制字符。凭证与控制端 ID 不参与键的构成。",
                  "maxLength": 128,
                  "minLength": 1,
                  "type": "string"
                }
              }
            ],
            "requestBody": {
              "content": {
                "application/json": {
                  "examples": {
                    "remote-files": {
                      "value": {
                        "files": [
                          {
                            "path": "/Uploads/report.csv"
                          }
                        ],
                        "text": "Summarise the report."
                      }
                    },
                    "remote-text": {
                      "value": {
                        "text": "Summarise the report."
                      }
                    }
                  },
                  "schema": {
                    "$ref": "#/components/schemas/SessionPublicRemoteInitialPrompt"
                  }
                }
              },
              "required": true
            },
            "responses": {
              "202": {
                "content": {
                  "application/json": {
                    "schema": {
                      "$ref": "#/components/schemas/SessionPublicRemotePromptResponse"
                    }
                  }
                },
                "description": "已接受"
              }
            }
          }
        },
        "x-supported-session-types": [
          "cloud",
          "remote"
        ]
      }
    }
  },
  "info": {
    "title": "发送 prompt",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
返回 OpenAPI 总览。