Files API
Upload Base64 File
Upload a file with base64-encoded contents via streaming multipart/form-data
POST
File Upload Note: The interactive playground doesn’t support file uploads due to browser limitations. Use the cURL examples below to test file uploads.
Overview
Upload a file whose contents have been Base64-encoded. The request body ismultipart/form-data; the server decodes the Base64 payload as it streams.
Use this endpoint when the source environment cannot transmit raw binary contents (for example, embedding a small file in a JSON-bearing channel that has been wrapped in a multipart form).
For files larger than the simple-upload cap, or any case that needs resumable uploads, use the direct-to-cloud multipart flow (up to 250 GB) instead.
Request
The request must be sent asmultipart/form-data with a form field containing the base64-encoded file contents. The server decodes the contents on the fly.
Supported File Types
The server’sContent-Type validator accepts:
- Images:
image/jpeg,image/png - Video:
video/mp4 - Text & data:
text/plain,text/csv,application/json
application/x-ndjson) is not accepted by this endpoint — use the multipart flow for JSONL.
Maximum size: 512 MB (after Base64 encoding). The Developer Console UI caps its uploads through this endpoint at 255 MB.
Response
Whether the upload was successful. Check this field to detect errors.
Filename of the uploaded file. Use this to download, delete, or fetch metadata for the file.
Internal unique identifier for the uploaded file.