大模型异步调用结果回查
更新时间 2026-06-11 10:19:09
最近更新时间: 2026-06-11 10:19:09
接口信息
API Path
/aipaas/lm/v1/asyncResult/query
请求协议
HTTP
请求方法
GET
请求头部:
| 头部标签 | 必填 | 说明 | 类型 | 数据字典 | 限制 | 头部内容 | 示例 |
|---|---|---|---|---|---|---|---|
| Content-Type | 是 | application/json | [string] | - | - | application/json | application/json |
| X-APP-ID | 是 | 系统管理--API Key,创建应用获取AppID 和AppKey,公网鉴权,公网调用时必传 | [string] | - | - | - | - |
| Authorization | 是 | 公网鉴权,公网调用时必传 | [string] | - | - | - | - |
| Device-Uuid | 否 | 设备管理-设备uuid | [string] | - | - | - | - |
返回结果
Query参数:
| 参数名 | 说明 | 必填 | 类型 | 数据字典 | 限制 | 示例 |
|---|---|---|---|---|---|---|
requestId | 请求ID,调用异步算法时返回 | 是 | [string] | - | - | - |
响应内容
| 参数名 | 说明 | 必填 | 类型 | 数据字典 | 限制 | 示例 |
|---|---|---|---|---|---|---|
| code | 返回状态码 | 是 | [int] | - | - | - |
| message | 具体信息 | 是 | [string] | - | - | - |
成功示例[Mock API]:
返回结果为String类型, 返回字段数据结构与当前请求算法的回告结果一致。失败示例[Mock API]:
{
"code": 992008,
"message": "获取信息失败"
}
功能简介
用于查询异步算法调用的结果信息,只适用于异步生成结果并且请求接收后返回"requestId"的能力。目前具体支持模型请见下文第6节。 异步请求结果获取目前支持推、拉两种模式:
推模式:在发送异步请求时需要传递“callback_url”(接收回调结果的url地址,不同接口字段名可能有细微不同)字段,即接收回调结果的url地址。详见 开发指南 - 异步调用结果获取 - 推模式 -【客户提供接口】大模型异步调用结果回告协议规范。
拉模式:通过发送请求时系统返回的"requestId"字段,主动调用该接口,以实时查询异步调用的结果。
查询大模型生成结果信息接口仅支持查询已经生成的结果,并且生成结果数据在有效期内。 结果未生成或生成结果数据已过期时,接口会返回【992008】获取信息失败; 存在调用结果时,接口返回的信息同各个算法的回告结构。
服务鉴权
服务接口调用时需要严格遵循服务鉴权规则,服务调用鉴权规则请参见:开发指南 - 签名认证方式。
状态码说明
| 返回编码 | 返回信息 | 说明 |
|---|---|---|
| 990003 | 失败 | 系统异常 |
| 992008 | 失败 | 获取信息失败 |
通用状态码请参考【状态码】中的【网关认证】
请求参数示例
/aipaas/lm/v1/asyncResult/query?requestId=yourRequestId支持模型
文生图大模型
图生图大模型
调用示例
Java版本
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import java.util.HashMap;
import java.util.Map;
/** 主类,用于发起HTTP请求并处理响应 */
public class Example {
public static void main(String[] args) {
example();
}
/**
* 方法中使用到的HttpRequest、HttpResponse均来自Hutool工具类。
* 具体maven依赖为:
* <dependency>
* <groupId>cn.hutool</groupId>
* <artifactId>hutool-all</artifactId>
* <version>5.8.29</version>
* </dependency>
*/
public static void example() {
try {
String url = "服务调用地址";
String requestId = "yourRequestId";
// 设置请求头
Map<String, String> headers = new HashMap<>();
//调用鉴权
headers.put("Content-Type", "application/json");
headers.put("X-APP-ID", "yourAppId");
headers.put("Authorization", "yourAuthorization");
// 发起HTTP请求
HttpResponse response =
HttpRequest.get(url)
.form("requestId", requestId)
.execute();
// 输出响应结果
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
}
}