文件下载与访问
curl --request GET \
--url https://api.omnimux.ai/api/v1/files/download/{file_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omnimux.ai/api/v1/files/download/{file_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omnimux.ai/api/v1/files/download/{file_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omnimux.ai/api/v1/files/download/{file_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}文件管理
文件下载与访问
GET /api/v1/files/download/ · 通过文件唯一标识获取文件或重定向至 CDN 直链
GET
/
api
/
v1
/
files
/
download
/
{file_id}
文件下载与访问
curl --request GET \
--url https://api.omnimux.ai/api/v1/files/download/{file_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omnimux.ai/api/v1/files/download/{file_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omnimux.ai/api/v1/files/download/{file_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omnimux.ai/api/v1/files/download/{file_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
- 公开寻址(免登录),依赖全局唯一的
file_id访问- 配置独立 R2 公共域名时返回 302 重定向;持有公开链接即可读取,不代表私密存储
- 本地存储模式时由网关流式回源输出并自动设置正确的
Content-Type与Content-Disposition- 文件超出 72 小时 后自动失效并返回
404 Not Found
任务产物直下
浏览器直下已存任务产物的功能已于 2026 年 10 月 12 日上线。
file_id 下载是不同的调用契约。浏览器可在受支持的规范路径 GET /v1/tasks/{task_id}/artifacts/{artifact_key}/content 后附加 delivery=direct,下载时再附加 download=1。保留原有访问查询参数和既有鉴权,不向无关地址附加这些选项;提供给上游模型的规范参考地址不要替换为浏览器专用直下地址。本说明不将直下支持扩展到 OpenAI Videos 的 /v1/videos/{id}/content 兼容路径。
通过既有任务归属或访问授权、状态、保留期限及产物检查后,若 R2 存储命中且图片或视频类型元数据受支持,可以返回 307 Temporary Redirect 到有效期为 5 分钟 的签名 R2 GET 地址。重定向带有 Cache-Control: private, no-store 和 Referrer-Policy: no-referrer;签名绑定最终响应的类型、private, no-store 缓存策略和安全的展示方式。使用 download=1 时,跨域后的最终 R2 响应设置 Content-Disposition: attachment,不只依赖网页的 download 属性。图片、视频预览和已保存封面可使用同一条直下路径。
默认规范请求,包括提供给模型的参考地址,仍返回原有字节响应;HEAD 不采用直下重定向。本地存储、不支持直下或签名失败时仍使用既有服务器路径。首次从上游回存以及参考媒体检查或处理仍经过服务器,不承诺服务器完全不传文件正文,也不承诺已经测得速度提升。
普通文件下载显式附加 delivery=direct 的 GET 请求,可返回 307 到有效期为 5 分钟 的签名 R2 GET,包括未配置独立公开地址的情况。这一路径保留可用状态、过期和独立内容域名检查,签名要求最终响应按附件返回。不附加该选项时,既有公开地址下发及本地或不支持时的回退保持不变。普通文件下载不需要任务路径使用的 download=1 选项。
当前桶的公开地址仍可由任何持有链接的人读取。签名 GET 限制的是该凭证的有效期,不是公开对象的全部访问入口。网关鉴权和过期检查不能使桶变成私密存储,也不能保证已知公开链接立即撤销。
路径参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
file_id | string | 是 | 上传成功时返回的文件全局唯一标识(如 file_8e6d425c0e564bde) |
响应说明
- 未过期文件 (200 OK / 302 Found):返回文件二进制数据流或重定向至 R2 公共存储直链。
- 过期或已删除文件 (404 Not Found):
{ "success": false, "code": 404, "msg": "文件已过期" }