---
title: "Upload File Stream"
method: POST
path: "/api/common/upload/stream"
tags: ["File Upload"]
---

# Upload File Stream

`POST /api/common/upload/stream`

## Request

- Base URL: `https://api.poyo.ai`
- URL: `https://api.poyo.ai/api/common/upload/stream`
- Auth: HTTP bearer

Upload files using multipart/form-data format. Supports image uploads and video uploads. Videos are stored under the temp/videos prefix by default, are limited to 100MB, and expire after 24 hours.

## Request body `multipart/form-data`

- UploadStreamRequest
  - `file` string, binary, required: File binary data to upload. **Supported image formats**: JPEG, PNG, GIF, WebP **Supported video formats**: MP4, WebM, QuickTime/MOV, AVI, MKV **Maximum**: 1 file per request. Videos are limited to 100MB. **Retention**: Images expire after 72 hours. Videos expire after 24 hours when stored under the temp/videos lifecycle prefix. **Note**: The system automatically identifies and categorizes file types.
  - `upload_path` string: Custom storage directory path. Supports both naming conventions: - **snake_case**: `upload_path` - **camelCase**: `uploadPath` If not specified, the system uses `temp`. Video uploads using the default `temp` path are stored as `temp/videos`. **Note**: API routing normalizes custom paths under the `temp/` prefix.
  - `file_name` string: Custom filename for the uploaded file. Supports both naming conventions: - **snake_case**: `file_name` - **camelCase**: `fileName` If not specified, the system will generate a unique filename in the format: `{timestamp}_{random}_{extension}` **Example auto-generated name**: `20251229130857_a8B9cD2e.png`

## Response `200`

File uploaded successfully

- UploadResponse
  - `success` boolean, required: Indicates whether the upload was successful
  - `code` integer, required: HTTP status code
  - `msg` string, required: Response message
  - `data` object, required
    - `file_id` string, required: Unique file identifier (MD5 hash)
    - `file_name` string, required: The stored filename
    - `original_name` string, required: The original filename from the URL
    - `file_size` integer, required: File size in bytes
    - `mime_type` string, required: MIME type of the uploaded file
    - `upload_path` string, required: Storage path (includes temp/ prefix)
    - `file_url` string, uri, required: Direct access URL for the uploaded file
    - `download_url` string, uri, required: Download URL (same as file_url)
    - `upload_time` string, date-time, required: Upload timestamp in ISO 8601 format
    - `expires_at` string, date-time, required: Expiration timestamp in ISO 8601 format (72 hours after upload)

## Other responses

- `400`: Bad request - Unsupported file type or empty file
- `401`: Unauthorized - Missing or invalid authentication
- `413`: Payload too large - Video exceeds 100MB limit
- `422`: Unprocessable Entity - Missing required file field
- `429`: Rate limit exceeded - 10 requests per 60-second fixed window per authenticated user, per upload endpoint
- `500`: Server error - Storage connection or upload failure

---

[API](https://skmtc.dev/poyo/apis/poyo-ai-hunyuan-3d-v3-1-api.md) - [All operations](https://skmtc.dev/poyo/apis/poyo-ai-hunyuan-3d-v3-1-api/llms.txt) - [OpenAPI document](https://skmtc.dev/poyo/apis/poyo-ai-hunyuan-3d-v3-1-api/revisions/4b46904b78eb?raw)
