Files
Upload and manage files for use with vector stores. Files are uploaded via multipart form data and can be added to vector stores for RAG.
List files
Authorization
api_key API key authentication using Bearer token format
In: header
Query Parameters
Maximum number of files to return (default: 20, max: 100)
int641 <= value <= 100Sort order by created_at timestamp (default: desc)
Cursor for forward pagination. Returns results after this file ID.
Hadrian Extension: Cursor for backward pagination. Returns results before this file ID.
Filter by purpose
Hadrian Extension: Owner type for multi-tenancy (organization, project, or user)
Hadrian Extension: Owner ID for multi-tenancy
uuidResponse Body
application/json
application/json
curl -X GET "https://loading/api/v1/files?after=file-550e8400-e29b-41d4-a716-446655440000&before=file-550e8400-e29b-41d4-a716-446655440000&purpose=assistants&owner_type=string&owner_id=497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"data": [
{
"bytes": 0,
"content_type": "string",
"created_at": "2019-08-24T14:15:22Z",
"expires_at": "2019-08-24T14:15:22Z",
"filename": "string",
"id": "file-550e8400-e29b-41d4-a716-446655440000",
"object": "string",
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "organization",
"purpose": "assistants",
"status": "uploaded",
"status_details": "string"
}
],
"first_id": "string",
"has_more": true,
"last_id": "string",
"object": "string"
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Upload a file
Authorization
api_key API key authentication using Bearer token format
In: header
Request Body
multipart/form-data
File upload with metadata
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://loading/api/v1/files"{
"bytes": 0,
"content_type": "string",
"created_at": "2019-08-24T14:15:22Z",
"expires_at": "2019-08-24T14:15:22Z",
"filename": "string",
"id": "file-550e8400-e29b-41d4-a716-446655440000",
"object": "string",
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "organization",
"purpose": "assistants",
"status": "uploaded",
"status_details": "string"
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get file metadata
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
File ID
uuidResponse Body
application/json
application/json
curl -X GET "https://loading/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"bytes": 0,
"content_type": "string",
"created_at": "2019-08-24T14:15:22Z",
"expires_at": "2019-08-24T14:15:22Z",
"filename": "string",
"id": "file-550e8400-e29b-41d4-a716-446655440000",
"object": "string",
"owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
"owner_type": "organization",
"purpose": "assistants",
"status": "uploaded",
"status_details": "string"
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Delete a file
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
File ID
uuidResponse Body
application/json
application/json
application/json
curl -X DELETE "https://loading/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"deleted": true,
"id": "string",
"object": "string"
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get file content
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
File ID
uuidResponse Body
application/octet-stream
application/json
curl -X GET "https://loading/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08/content"{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}