http
Base URL: https://openapi.tripo3d.com/v3
Endpoint: POST /files/presign
Get a presigned upload URL for direct file upload to storage — faster performance for large files. No SDK required — use a standard HTTP PUT request. Recommended for files exceeding 60 MB; for smaller files you can also use File Upload (multipart, max 150 MB).
Upload flow
- Call
POST /v3/files/presignwithformatto obtainpresigned_urlandfile_token. - Upload the file with HTTP PUT to
presigned_url(direct to storage, no auth needed). - Use
file_tokenin theinputfield of subsequent API calls (e.g. Import Model, Retopology, Convert Model).
Note
- This endpoint requires an API Key. Include it in the Authorization header as Bearer {api_key}.
Request Parameters
Request Body
formatstringRequired
File extension without leading dot (e.g. glb, fbx, png).
Notes
- Images:
jpeg,jpg,png,webp,bmp,tiff. - Models:
glb,gltf,fbx,obj,stl,3mf,usdz.
Response
presigned_urlstringRequired
Presigned PUT URL valid for 30 minutes. Upload the file with HTTP PUT to this URL.
file_tokenstringRequired
File reference token (e.g.,
file_abc123). Use in the input field after upload completes.expires_inintegerRequired
Presigned URL validity in seconds. Fixed at 1800 (30 minutes).
Examples
curl
# Step 1: Get presigned URL
curl -s -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"format":"glb"}' \
https://openapi.tripo3d.com/v3/files/presign
# Step 2: Upload file directly to storage (no Auth needed)
curl -X PUT \
-H "Content-Type: application/octet-stream" \
-T model.glb \
""
# Step 3: Create task using file_token
curl -s -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"default","input":"" }' \
https://openapi.tripo3d.com/v3/models/importPython
import requests
API_KEY = "YOUR_API_KEY"
BASE = "https://openapi.tripo3d.com"
headers = {"Authorization": f"Bearer {API_KEY}"}
# 1. Get presigned URL
resp = requests.post(f"{BASE}/v3/files/presign",
json={"format": "glb"}, headers=headers)
data = resp.json()["data"]
presigned_url = data["presigned_url"]
file_token = data["file_token"]
# 2. Upload file directly to storage
with open("model.glb", "rb") as f:
put_resp = requests.put(presigned_url, data=f,
headers={"Content-Type": "application/octet-stream"})
assert put_resp.status_code == 200
# 3. Create task with file_token
task_resp = requests.post(f"{BASE}/v3/models/import",
json={"model": "default", "input": file_token},
headers=headers)
print(task_resp.json())JavaScript
import fs from 'fs';
const API_KEY = 'YOUR_API_KEY';
const BASE = 'https://openapi.tripo3d.com';
// 1. Get presigned URL
const presignRes = await fetch(`${BASE}/v3/files/presign`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ format: 'glb' }),
});
const { data } = await presignRes.json();
const { presigned_url, file_token } = data;
// 2. Upload file directly to storage
const fileBuffer = fs.readFileSync('model.glb');
await fetch(presigned_url, {
method: 'PUT',
headers: { 'Content-Type': 'application/octet-stream' },
body: fileBuffer,
});
// 3. Create task with file_token
const taskRes = await fetch(`${BASE}/v3/models/import`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ model: 'default', input: file_token }),
});
console.log(await taskRes.json());Presign response
{
"code": 0,
"data": {
"presigned_url": "https://storage.example.com/bucket/path/input.glb?X-Amz-Signature=...",
"file_token": "file_abc123",
"expires_in": 1800
}
}