Files
899d2946d1 feat(api): support artifact HEAD requests (#1636)
Return authenticated stream and download metadata without a response
body. Keep path checks and GET behavior, ignore Range for HEAD, and
return 404 if a file disappears before metadata lookup.

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>

Co-authored-by: Rudy Celekli <rudy@gradiahq.com>
2026-10-14 11:43:37 +08:00

18 lines
836 B
Markdown

# Inspect artifact metadata
The artifact endpoints accept `HEAD` as well as `GET`:
```sh
curl --head http://localhost:8080/api/v1/stream/TASK_ID/final-1.mp4
curl --head http://localhost:8080/api/v1/download/TASK_ID/final-1.mp4
```
HEAD returns the full artifact's content length and media type without sending
its bytes. Downloads also return the existing attachment filename and file
metadata headers. Supply the same authentication as GET when an API key is
configured. Missing files and paths outside task storage retain their existing
error statuses. Range and If-Range do not select partial representations for
HEAD; send GET with Range to retrieve part of a stream. An empty artifact has
length zero. A successful metadata request does not validate video decoding or
guarantee that a subsequent request will see the same file.