API Path
/aipaas-file/lm
请求协议
HTTPS
请求方法
GET
请求头部 :
| 头部标签 | 必填 | 说明 | 类型 | 数据字典 | 限制 | 头部内容 | 示例 |
|---|---|---|---|---|---|---|---|
| Content-Type | 是 | application/json | [string] | application/json | application/json | ||
| X-APP-ID | 是 | 买家中心-已购能力-【X-APP-ID】,公网鉴权,公网调用时必传 | [string] | ||||
| Authorization | 是 | 公网鉴权,公网调用时必传 | [string] | ||||
| Device-Uuid | 否 | 设备管理-设备uuid | [string] |
响应内容 :
| 参数名 | 说明 | 必填 | 类型 | 数据字典 | 限制 | 示例 |
|---|
成功示例[Mock API] :
文件二进制流
/aipaas-file/lm/test-bucket/2202010_1735679.mp4
在大模型异步调用反馈结果里,如果是生成图片或者语音,会返回对应结果图片或结果语音文件资源地址,具体可见各个接口文档返回结果描述;若需要获取生成结果内容,需要通过本接口获取。另注意星河不会保证识别结果长期有效,故需要用户获取完结果单独存储。
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依赖为:
*
* cn.hutool
* hutool-all
* 5.8.29
*
*/
public static void example() {
try {
String url = "服务调用地址";
String param = "yourResource";
// 设置请求头
Map 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 + param)
.execute();
// 输出响应结果
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
}
}