/v1/files/v1/files
Upload a file to the Gateway and reference it in subsequent chat or messages requests by the returned id (format an_<ULID>).
Upload a file#
curl https://api.atptoken.ai/v1/files \
-H "Authorization: Bearer atp-..." \
-F "file=@./input.pdf"
# → 201 { "id": "an_01H...", "object": "file", "bytes": 152340, "filename": "input.pdf", ... }The response follows OpenAI Files: the file ID is in id. Uploading identical content returns the same ID, with HTTP 200 instead of 201 (SHA-256 deduplication).
Endpoints#
Use an upload as a media reference URL#
A /v1/files id is not an asset:// reference, and the media endpoints cannot fetch it by id. Seedance video accepts asset:// URIs only from the separate asset API; see video generation. To feed an uploaded image to an image-edit or image-to-video model, read the Location header of GET /v1/files/{id} without following the redirect and pass that URL:
- POST
/v1/files - GET
/v1/files/{id}
curl -sD - -o /dev/null https://api.atptoken.ai/v1/files/an_01H... \
-H "Authorization: Bearer atp-..." | grep -i '^location:'
# → location: https://<object-store>/gateway-files/...?<presigned>That presigned URL is downloadable without authentication — which is what the upstream provider needs — and lives about 15 minutes. Resolve it immediately before creating the task; do not cache it. See image generation and video generation.