Overview
After uploading a file to storage, call this endpoint to confirm the upload and trigger automatic file processing. The system will download the file, analyze it, extract metadata, and prepare it for use in chat completions.Authentication
Request
Request Body
- file_id string (required) — UUID of the file from the
/upload-urlresponse - filename string (required) — Original filename with extension
- file_size number (required) — File size in bytes
Response
The response varies based on file type. Here are examples for different file types:CSV File Response
PDF File Response
Excel File Response
Image File Response
JSON File Response
Field Reference
- success boolean — Whether file processing succeeded
- file_id string — UUID of the file
- filename string — Original filename
- file_size number — File size in bytes
- processed_at string — ISO 8601 timestamp of processing
- metadata object — File-specific metadata (varies by type)
- processing_summary string — Human-readable summary of file contents
File Processing Details
| File Type | Processing Time | What’s Analyzed |
|---|---|---|
| CSV | < 1 second | Column names, data types, row count, preview |
| Excel | 1-2 seconds | Sheet names, columns per sheet, row counts |
| 2-10 seconds | OCR text extraction, page count | |
| Images | < 1 second | Dimensions, format, color mode |
| JSON | < 1 second | Structure, keys, depth |
| Text | < 1 second | Character count, line count |
Error Responses
File Not Found in Storage
404 Not Found
Solution: Ensure the file was uploaded to the pre-signed URL before confirming.
Invalid File Type
400 Bad Request
Solution: Use a supported file type (CSV, PDF, Excel, images, JSON, text).
File Too Large
400 Bad Request
Processing Failed
500 Internal Server Error
Authentication Required
401 Unauthorized
Complete Upload Flow Example
Next Steps
After confirming the upload:-
Use the file in chat completions by including the
file_id→ See Chat Completion API - Retrieve file metadata anytime → See Get Files Metadata
- Upload more files to use together in a single chat → See Generate Upload URL
Best Practices
- Wait for confirmation response: Don’t use the file in chat until confirmation succeeds
- Handle processing errors: Check
successfield before proceeding - Store metadata: Save the processing summary and metadata for reference
- Validate file types: Check file extension client-side before uploading
- Timeout handling: Set appropriate timeouts (PDFs may take 5-10 seconds to process)