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

# 입력 파일

> 사진을 올려서 레퍼런스나 시작 프레임으로 써요.

PNG, JPG, WebP 이미지를 20MB까지 올릴 수 있어요. 파일은 저희 서버를 거치지 않고 저장소로 바로 보내요.

## 올리기

**1. 보낼 주소를 받아요**

```bash theme={null}
curl -X POST https://api.studio.thezet.io/v1/uploads \
  -H "Authorization: Bearer $ZET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content_type": "image/png", "size": 183204}'
```

`id`, `upload_url`, `headers`가 와요. `upload_url`은 10분 동안 쓸 수 있어요.

**2. 파일을 보내요**

응답의 `headers`를 그대로 넣어 PUT해요. API 키는 보내지 않아요. `size`와 파일 크기가 다르면 거절돼요.

```bash theme={null}
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  -H "Content-Length: 183204" \
  --data-binary @photo.png
```

**3. 도착을 확인해요**

```bash theme={null}
curl -X POST https://api.studio.thezet.io/v1/uploads/$ID/complete \
  -H "Authorization: Bearer $ZET_API_KEY"
```

`status`가 `ready`면 쓸 수 있어요. 파일이 아직 없으면 `409 upload_incomplete`예요.

## 입력으로 쓰기

```json theme={null}
{
  "model": "seedance-2.5",
  "prompt": "The boat drifts slowly across the lake",
  "inputs": { "start_frame": "<업로드 ID>" }
}
```

| 필드 | 설명 |
| - | - |
| `inputs.images` | 레퍼런스 이미지예요. 장수 제한은 모델마다 달라요. |
| `inputs.start_frame` | 영상의 시작 프레임이에요. |
| `inputs.end_frame` | 영상의 끝 프레임이에요. 시작 프레임과 함께 써요. |

모델이 받지 않는 입력을 보내면 `400 invalid_params`예요. 무엇을 받는지는 [모델 페이지](https://studio-docs.thezet.io/models/seedance-2.5.md)나 `GET /models`의 `inputs`에 나와 있어요. 레퍼런스 이미지 수에 따라 가격이 달라지는 모델도 있어서, [`POST /estimate`](https://studio-docs.thezet.io/pricing)의 `image_count`로 확인할 수 있어요.

## 다시 쓰기

* 올린 파일 하나를 작업 여러 개에 쓸 수 있어요.
* 끝난 작업의 `outputs[].id`도 다음 작업의 입력으로 쓸 수 있어요. 이미지를 영상으로 바꿀 때 편해요.

## 지우기

```bash theme={null}
curl -X DELETE https://api.studio.thezet.io/v1/uploads/$ID \
  -H "Authorization: Bearer $ZET_API_KEY"
```

파일은 자동으로 지워지지 않아요. 사용자가 사진 삭제를 요청하면 이 호출로 지워 주세요.

| 상황 | 결과 |
| - | - |
| 지웠어요 | `200` `{"id": "...", "status": "deleted"}` |
| 진행 중인 작업이 쓰는 중이에요 | `409 upload_in_use`. `details.generation_ids`에 작업이 나와요. 끝난 뒤 다시 호출해 주세요. |
| 이미 지웠거나 없는 ID예요 | `404 upload_not_found` |

결과물은 이 호출로 지울 수 없어요. [`DELETE /generations/{id}`](https://studio-docs.thezet.io/data#작업-삭제)로 작업과 함께 지워 주세요. 자세한 내용은 [보관과 삭제](https://studio-docs.thezet.io/data.md)를 봐 주세요.


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