Upload a file
Use cURL or an SDK to upload files directly to the API.
/v1/uploadsUpload a file with a single request and create an asset immediately.
Send the file bytes as the raw request body.
Set Content-Type to the file MIME type, Content-Length to the exact byte size,
and x-file-name to the original filename.
Allowed files are images, videos, audio, and .srt, .ass, or .lrc captions.
3D files, JSON (including Lottie JSON), documents, and unknown formats are rejected.
Videos are limited to 800 MiB and 30 minutes, audio to 25 MiB and 30 minutes,
and captions to 10 MiB. The service verifies storage metadata and file content after upload;
invalid files are deleted and return a 422 problem response.
When x-project-id is provided, the created asset is also bound to that project.
Authorization
BearerAuth Send an existing generated API key as Authorization: Bearer sk_indream_....
OAuth access tokens are not accepted by the Open API.
Enter the API key manually in the interactive docs playground.
The value is stored only in the current browser and is not injected from server environment variables.
In: header
Header Parameters
Original filename for the uploaded file.
1 <= length <= 512Exact raw request body size in bytes. Used for upload preflight validation.
1 <= valueOptional project to bind the created asset to.
uuidRequest Body
application/octet-stream
binaryResponse Body
application/json
application/json
application/json
application/json
application/json
curl --fail-with-body https://api.indream.ai/v1/uploads \ -H 'Authorization: Bearer <YOUR_API_KEY>' \ -H 'Content-Type: image/png' \ -H "Content-Length: $(wc -c < hero.png | tr -d ' ')" \ -H 'x-file-name: hero.png' \ --data-binary @hero.png{
"data": {
"assetId": "9179b887-04ef-4ce5-ab3a-b5bbd39ea3c8",
"type": "string",
"source": "string",
"filename": "string",
"mimetype": "string",
"size": 0,
"fileUrl": "string",
"fileKey": "string",
"width": 0,
"height": 0,
"duration": 0
},
"meta": {}
}{
"type": "FORBIDDEN",
"title": "Forbidden",
"status": 403,
"detail": "The current account is not eligible for this Open API route",
"errorCode": "OPEN_API_RUNTIME_ACCESS_FORBIDDEN"
}{
"type": "FORBIDDEN",
"title": "Forbidden",
"status": 403,
"detail": "The current account is not eligible for this Open API route",
"errorCode": "OPEN_API_RUNTIME_ACCESS_FORBIDDEN"
}{
"type": "FORBIDDEN",
"title": "Forbidden",
"status": 403,
"detail": "The current account is not eligible for this Open API route",
"errorCode": "OPEN_API_RUNTIME_ACCESS_FORBIDDEN"
}{
"type": "FORBIDDEN",
"title": "Forbidden",
"status": 403,
"detail": "The current account is not eligible for this Open API route",
"errorCode": "OPEN_API_RUNTIME_ACCESS_FORBIDDEN"
}