POST /v1/files — upload a file and get back a reusable file_id.
file_id, reference it in chat completions.
| purpose | Used for |
|---|---|
assistants | General-purpose attachment (most common) |
vision | Image inputs |
user_data | Per-user documents (RAG, analysis) |
batch | Batch inference inputs (coming soon) |
file_id instead of uploading twice. Key format: [A-Za-z0-9_.-:]{1,255}.
Content-Type. Mismatch → 400.Cache-Control: private, max-age=0. Download only via our signed proxy.max_file_size_bytes — single uploadmax_files_per_workspace — total countmax_storage_bytes_per_workspace — total sizeX-Storage-Used-Bytes, X-Storage-Limit-Bytes, X-Files-Used, X-Files-Limit.API key in format: Bearer inf_***
Same key within 24h returns the originally created file instead of uploading twice. Format: [A-Za-z0-9_.-:]{1,255}
File uploaded successfully.
"file_1hR9xTPZqK4mVLc2nJ7fY5wB"
"file"
245192
1713204900
"report.pdf"
assistants, vision, user_data, batch "assistants"
"processed"