POST
/v1/files/v1/files
上傳檔案到 Gateway,之後在 chat 或 messages 請求中用回傳的 id(格式 an_<ULID>)引用它。
上傳檔案#
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", ... }檔案 ID 欄位是 `id`
回應與 OpenAI Files 相容,檔案 ID 在 id。重複上傳相同內容會回傳同一個 id,HTTP 由 201 變 200(以 SHA-256 去重)。
端點#
POST /v1/files
GET /v1/files/:id
- 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>這頁有幫助嗎?