Upload a file
Upload a document once, then use it by `file_id` in a chat completion, a response, or a vector store.
/filesUpload a document once, then use it by file_id in a chat completion, a response, or a vector store.
Send the file as multipart/form-data, with the file in the file part and purpose set to user_data. A file over 5 MB is refused with 413. Olive reads PDFs, Office documents, images, and plain text and Markdown.
Nothing is read at upload. The first request that uses the file converts it to text, which can take time for a long or scanned document. To do that work ahead of your first question, send the file to POST /responses/input_tokens.
Uploads share one budget with file downloads and vector store attaches: 20 per hour and 200 per day, with a burst of 10. A file belongs to your account, and another account's id answers 404. It stays until you delete it with DELETE /files/{file_id}.
Authorization
BearerAuth Your Avey API key, sent as Authorization: Bearer <key>. This is the header the OpenAI SDKs already send, so pass the key as the client's ordinary api_key and no further configuration is needed.
In: header
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
The multipart form of an upload.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl https://api.avey.ai/llm/files \ -H "Authorization: Bearer $AVEY_API_KEY" \ -F purpose=user_data \ -F file=@discharge-summary.pdf{ "id": "file-Cn3MSNn72ENTiiq11Qda4A", "object": "file", "bytes": 184320, "created_at": 1769904000, "filename": "discharge-summary.pdf", "purpose": "user_data"}