Upload files directly to vector stores using base64-encoded content in a single API call.
Upload files directly to a vector store using base64-encoded content. This method allows you to upload files without first uploading them to the file storage system.
organization_id string required
The unique identifier of the organization (format: org_*).
vector_store_id string required
The unique identifier of the vector store (format: vs_*).
files array required
Array of file objects to upload (max 10 files per request).
files[].filename string required
Original filename with extension.
files[].content string required
Base64-encoded file content (without data URL prefix).
files[].mime_type string required
MIME type of the file.
| Type | MIME Type | Max Size |
|---|---|---|
application/pdf | 50 MB | |
| Text | text/plain | 10 MB |
| Markdown | text/markdown | 10 MB |
| CSV | text/csv | 10 MB |
| JSON | application/json | 10 MB |
| Word | application/vnd.openxmlformats-officedocument.wordprocessingml.document | 50 MB |
| PowerPoint | application/vnd.openxmlformats-officedocument.presentationml.presentation | 50 MB |
| Excel | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | 50 MB |
A success response with uploaded file details including processing status.
- Bash
- Python
- JavaScript
# Read file and encode to base64
FILE_CONTENT=$(base64 -i document.pdf)
curl -X POST "https://api.aitronos.com/v1/organizations/org_abc123/vector-stores/vs_xyz789/files/upload-base64" \
-H "X-API-Key: $FREDDY_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"files\": [
{
\"filename\": \"document.pdf\",
\"content\": \"$FILE_CONTENT\",
\"mime_type\": \"application/pdf\"
}
]
}"Response:
{
"success": true,
"message": "1 file(s) uploaded successfully",
"files": [
{
"id": "vsf_abc123def456",
"file_id": "file_xyz789ghi012",
"filename": "document.pdf",
"size": 28042,
"mime_type": "application/pdf",
"processing_status": "pending",
"created_at": "2025-01-14T10:12:01.850Z"
}
]
}After upload, files are queued for processing:
- pending - File uploaded, waiting in queue
- processing - File being chunked and embedded
- completed - File ready for search (typically 2-5 seconds)
- failed - Processing error occurred
Check processing status:
GET /v1/organizations/{org_id}/vector-stores/{vector_store_id}/files/{file_id}/statusAttach vector stores directly to chat requests:
{
"inputs": [
{
"role": "user",
"content": "What is in the uploaded document?"
}
],
"vector_store_ids": ["vs_abc123"],
"stream": false
}- Create assistant with
file_searchtool enabled - Attach vector stores to assistant
- Use assistant in chat requests
- Max files per request: 10
- Max file size: 50 MB (PDFs, Office docs), 10 MB (text files)
- Max concurrent uploads: 100 per organization
- Processing queue: Files processed in order, typically 2-5 seconds per file
- Batch uploads: Upload multiple files in a single request when possible
- Check status: Poll status endpoint after upload to confirm processing completion
- Handle errors: Implement retry logic for transient failures
- File naming: Use descriptive filenames for better organization
- MIME types: Always provide accurate MIME types for proper processing
- Base64 encoding: Remove data URL prefix (
data:application/pdf;base64,) before sending
- Files are scoped to organizations - users can only access files in their organization
- Files are stored securely with encryption at rest
- Vector embeddings are isolated per organization
- API keys and bearer tokens provide authentication
- All uploads are validated for file type and size
- Maximum 10 files per request
- Files must be base64-encoded
- Processing is asynchronous (2-5 seconds typical)
- Vector stores have a maximum capacity (contact support for limits)
- Some file types require specific processing (OCR for images, parsing for Office docs)