Upload file
multipart 上传图片/视频/音频,返回公网 url。
POST
/
v1
/
files
上传文件
curl --request POST \
--url https://sigrunai.com/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://sigrunai.com/v1/files"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://sigrunai.com/v1/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sigrunai.com/v1/files"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 20000,
"msg": "<string>",
"data": {
"url": "<string>",
"name": "<string>",
"media_type": "image",
"bytes": 123
}
}Upload an image, video, or audio reference and get a public
Success response:
url you can pass into create-task requests.
Auth
Authorization: Bearer <your API Key>
Request
multipart/form-data with field name file.
| Limit | Details |
|---|---|
| Size | Max 32MB |
| Images | .jpg .jpeg .png .webp .gif .bmp .avif .heic .heif |
| Videos | .mp4 .mov .webm .mkv .avi .m4v |
| Audio | .mp3 .wav .m4a .aac .ogg .flac .opus |
Response fields
| Field | Type | Description |
|---|---|---|
url | string | Public URL for images / videos / audios |
name | string | Original filename |
media_type | string | image / video / audio |
bytes | int | File size in bytes |
Example
curl -X POST 'https://sigrunai.com/v1/files' \
-H 'Authorization: Bearer sk_xxx' \
-F 'file=@./ref.png'
{
"code": 20000,
"msg": "ok",
"data": {
"url": "https://cdn.sigrunai.com/openapi/files/xxxxxxxx.png",
"name": "ref.png",
"media_type": "image",
"bytes": 123456
}
}
Last modified on October 15, 2026
⌘I
上传文件
curl --request POST \
--url https://sigrunai.com/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://sigrunai.com/v1/files"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://sigrunai.com/v1/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sigrunai.com/v1/files"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 20000,
"msg": "<string>",
"data": {
"url": "<string>",
"name": "<string>",
"media_type": "image",
"bytes": 123
}
}