Upload a file
POST https://api.inoneapi.com/v1/files
Upload one file and obtain an InOneAPI file_id for model requests. This endpoint stores and detects files; it does not perform OCR, transcoding, document parsing, or inference.
Send Authorization: Bearer $INONEAPI_API_KEY with multipart/form-data. Only the uploading key can access the file, even when other keys share its user or project. File operations incur no model inference charges and require no positive balance; key rate/concurrency limits and project status still apply.
Request parameters
| Field | Type | Requirement |
|---|---|---|
file | binary | Required, exactly one nonempty file. Filename: at most 255 Unicode characters; no NUL, line breaks, or path separators. |
purpose | string | Required, exactly one value: user_data. |
Let cURL -F or FormData generate the multipart boundary. Do not set Content-Type manually. JSON/Base64 uploads and purposes such as fine-tune or batch are unsupported.
Formats and quotas
| Detected type | Formats | Per-file maximum |
|---|---|---|
| image | PNG, JPEG, WebP, GIF | 10 MiB |
| video | MP4, WebM, MOV | 32 MiB |
| audio | MP3, WAV, OGG, AAC, FLAC, M4A, audio WebM | 10 MiB |
| document | PDF, plain text, CSV, JSON | 10 MiB |
Content detection determines the MIME and media type; changing an extension or declared MIME does not add support. Container and text subtypes follow the response. Each key can hold at most 1000 records totaling 1 GiB created within the last 24 hours, including incomplete uploads.
Request examples
Run the JavaScript example on a Node.js 20+ server. Never expose the key in browser code.
curl https://api.inoneapi.com/v1/files \
-H "Authorization: Bearer $INONEAPI_API_KEY" \
-F purpose=user_data \
-F file=@./sample.pdfSuccessful response
{
"id": "file_ioa_0123456789abcdef0123456789abcdef",
"object": "file",
"filename": "sample.pdf",
"mime_type": "application/pdf",
"media_type": "document",
"bytes": 1024,
"status": "ready",
"created_at": 1789430400,
"purpose": "user_data"
}
HTTP 200 returns metadata. id is the platform file ID; object is file; filename is the name; mime_type is detected MIME; media_type is image/video/audio/document; bytes is the original size; status is ready; created_at is Unix seconds; purpose is user_data. Object keys, content, signed URLs, and expires_at are not returned.
Errors and retries
| HTTP / code | Action |
|---|---|
400 INVALID_FILE_REQUEST | Check multipart encoding, required fields, file count, and filename. |
400 UNSUPPORTED_FILE_TYPE | Use a supported actual format. |
413 FILE_TOO_LARGE | Reduce size; the complete multipart body is also limited. |
429 FILE_QUOTA_EXCEEDED | Delete unused files or wait for the quota window to advance. |
503 FILE_STORAGE_UNAVAILABLE | Storage or metadata failed; check the list before retrying. |
A timeout does not prove that upload failed. There is no general idempotency guarantee; a retry can create another file and consume quota. Interrupted uploads can leave uploading records. Find them through the list and delete after 5 minutes. Authentication and general rate limits follow the error reference.
Retention and next steps
Public API objects use a one-day COS lifecycle rule, executed asynchronously. ready does not guarantee current object availability. Signed URLs generated for each upstream attempt last 5 minutes. Uploads persist content and are outside zero-data mode. Model acceptance depends on upstream capabilities.
File upload and reference guide · GET /v1/files · DELETE /v1/files/{file_id}