Delete a file

DELETE https://api.inoneapi.com/v1/files/{file_id}

Delete the COS object and database metadata owned by this key. The ID can no longer be used for new references. Deletion does not recall content already sent upstream or cancel running generation tasks.

Send Authorization: Bearer $INONEAPI_API_KEY; no request body is needed. Access is restricted to the uploading key, including within the same user or project. These operations incur no model inference charges and require no positive balance, but key rate/concurrency limits and project status still apply.

Request parameters

ParameterLocationTypeDescription
file_idpathstringRequired, the complete upload ID: file_ioa_ followed by 32 lowercase hexadecimal characters. Not a Playground or provider ID.

Request examples

Run the JavaScript examples on Node.js 20+ servers with INONEAPI_API_KEY set.

curl  -X DELETE https://api.inoneapi.com/v1/files/file_ioa_0123456789abcdef0123456789abcdef \
  -H "Authorization: Bearer $INONEAPI_API_KEY"

Response

{
  "id": "file_ioa_0123456789abcdef0123456789abcdef",
  "object": "file",
  "deleted": true
}

HTTP 200 returns id, object: file, and deleted: true, not HTTP 204. Repeated deletion normally returns 404; do not assume the same success object is returned every time.

Errors and boundaries

HTTP / codeCause and action
404 FILE_NOT_FOUNDInvalid, missing, or foreign ID. A cleanup retry may treat this as inaccessible; it cannot reveal whether another key's file exists.
409 FILE_NOT_READYAn uploading record is less than 5 minutes old. Wait to avoid racing an active upload.
503 FILE_STORAGE_UNAVAILABLEObject or metadata deletion failed. Keep the ID, inspect status, and retry with bounds.

A ready file can be deleted immediately. Interrupted uploading records can be deleted after 5 minutes. Object deletion precedes metadata deletion; the operation is not atomic. After a 503 or timeout, the object may be gone while its record remains.

This endpoint also removes stale metadata after COS cleanup. Deleting a key invalidates its IDs, while lifecycle rules reclaim remaining objects. Async providers may still need input files; clean up only after the task no longer needs them.

Files guide · POST /v1/files · Error codes

Delete a file · Documentation · InOneAPI