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>这页有帮助吗?