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

FieldTypeRequirement
filebinaryRequired, exactly one nonempty file. Filename: at most 255 Unicode characters; no NUL, line breaks, or path separators.
purposestringRequired, 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 typeFormatsPer-file maximum
imagePNG, JPEG, WebP, GIF10 MiB
videoMP4, WebM, MOV32 MiB
audioMP3, WAV, OGG, AAC, FLAC, M4A, audio WebM10 MiB
documentPDF, plain text, CSV, JSON10 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.pdf

Successful 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 / codeAction
400 INVALID_FILE_REQUESTCheck multipart encoding, required fields, file count, and filename.
400 UNSUPPORTED_FILE_TYPEUse a supported actual format.
413 FILE_TOO_LARGEReduce size; the complete multipart body is also limited.
429 FILE_QUOTA_EXCEEDEDDelete unused files or wait for the quota window to advance.
503 FILE_STORAGE_UNAVAILABLEStorage 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}

Upload a file · Documentation · InOneAPI