Download and Access File
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 management
Download and Access File
GET /api/v1/files/download/ · Retrieve uploaded file or redirect to CDN URL
GET
/
api
/
v1
/
files
/
download
/
{file_id}
Download and Access File
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))
}
- Public access by unique
file_id(no login required)- Automatically responds with 302 Redirect to Cloudflare R2 CDN URL when public domain is configured
- Streams file directly with correct
Content-TypeandContent-Dispositionin local storage mode- Returns
404 Not Foundwhen file has expired past 72 hours
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
file_id | string | Yes | Unique file identifier returned upon upload (e.g. file_8e6d425c0e564bde) |
Response
- Active File (200 OK / 302 Found): Binary stream of file or 302 redirect to R2 CDN URL.
- Expired or Deleted File (404 Not Found):
{ "success": false, "code": 404, "msg": "文件已过期" }