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

Promote to Persistent

Endpoint: POST /v1/storages/promote

Promotes one or more temporary outputs to persistent so they are kept long-term instead of expiring after about 7 days. Persistent storage is billed by size. Promotion is asynchronous and applies 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/promote" \
  -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": "cap_exceeded" }
    ]
  }
}
  • accepted — ids queued for promotion. Promotion runs in the background; the output keeps the same path and switches to the persistent CDN domain once processed. Poll List Stored Outputs until storage_tier flips to persistent. When the switch completes the old temporary URL (on the temp host) stops working — re-read the item to get the persistent URL instead of reusing the cached one.
  • rejected — ids that were not promoted, each with a reason.

Rejection reasons

reasonMeaning
not_ownedNo such output for this account.
insufficientAccount balance is at or below zero. The whole batch is rejected — top up, then retry.
cap_exceededPromoting would exceed your persistent-storage cap. Free space or contact us to expand.
not_promotableNot a completed temporary output (already persistent, still generating, or failed).
already_deletedOutput has already been deleted.
storage_op_pendingAnother storage operation is already in progress for this output — retry later.

No demote

There is no way to move a persistent output back to temporary. To stop paying for it, delete it.

Up to 50 per call

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