> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lululab.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 上传参考素材

文生图、文生视频可以跳过本节。商品类任务至少需要一张商品图。先申请临时上传地址，再把文件传到该地址。从第二步上传响应中取得 location 和 mimeType，分别填入后续请求的 url 和 mimeType。

```bash 上传商品图片 theme={null}
# 1. Ask LuluLab for a temporary upload destination.
curl -X POST https://customer.lululab.ai/uploads \
  -H "Authorization: $LULULAB_API_KEY"

# 2. POST the file to presignedUrl. This response contains location and mimeType.
curl -X POST "PRESIGNED_URL" \
  -F "file=@product.jpg;type=image/jpeg"
```

### 申请上传地址的响应字段

| 字段 / 类型 | 必填 | 可选值与说明 |
| - | - | - |
| `id` (`UUID`) | 是 | 本次临时上传的文件 ID。 |
| `presignedUrl` (`URL`) | 是 | 将文件以 multipart/form-data POST 到此地址；仅用于上传，不是素材引用。 |
| `mimeType` (`string`) | 是 | 预设媒体类型；以实际上传响应为准。 |
| `expiresAt` (`date-time`) | 是 | 上传地址的到期时间。 |

> [!NOTE]
>
> presignedUrl 有有效期，不能直接当图片引用。第二步是 multipart/form-data POST；使用返回的 location 作为图片地址。文件应归属于当前 Key 的账户。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.