Notice: MAI Image 2.7 launch limited-time 20% off, covering the full text-to-image and image editing lineup, try it now
Notice: Black Friday 2026 × Cyber Monday: Get up to 30% extra on top-ups, DeepSeek free to use · View the promotion
Open navigation

Delete Output

Endpoint: POST /v1/storages/delete

Permanently deletes one or more stored outputs. Deleting a persistent output stops its storage billing. Deletion takes effect immediately in listings and billing; the underlying file is purged in the background. Batch up to 50 with partial-success semantics.

Headers

HeaderValueRequiredNotes
AuthorizationBearer YOUR_API_KEYyesAccount API key. Required on every request.
Content-Typeapplication/jsonnoOptional. The body is always parsed as JSON; if sent, application/json is accepted.

Request body

A JSON array of output ids, taken from List Stored Outputs. Up to 50 per request.

curl -X POST "https://api.hiapi.ai/v1/storages/delete" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '["90216", "90215"]'

Response

{
  "code": 200,
  "message": "success",
  "data": {
    "accepted": ["90216"],
    "rejected": [
      { "id": "90215", "reason": "pending_archiving" }
    ]
  }
}
  • accepted — ids that were deleted. They drop out of List Stored Outputs and stop accruing storage charges immediately.
  • rejected — ids that were not deleted, each with a reason.

Rejection reasons

reasonMeaning
not_ownedNo such output for this account.
already_deletedOutput has already been deleted.
pending_archivingOutput is still being written to storage — retry once it finishes.
storage_op_pendingAnother storage operation is already in progress for this output — retry later.
static_immutablePlatform-owned static asset — it cannot be deleted.

Deletion is permanent

Deleted files cannot be recovered.

Up to 50 per call

Each request deletes at most 50 outputs. If you send more than 50 ids the whole request is rejected (HTTP 400) and nothing is deleted — split larger sets across several calls.