Skip to main content
Upload a model archive (model.tar.gz) too large for one Upload Model request. The platform hands out a presigned URL for each 10 MiB part, the client sends the parts straight to storage, and one more command assembles them.
  1. initiate_upload with the archive’s size. The answer is an operation id and a part plan.
  2. PUT each part to its presigned URL, and keep the ETag each one answers with.
  3. complete_upload with the ETags, in part order. The platform then processes the archive exactly as it does a single-part upload.
  4. Poll Get Operation until the operation is completed or failed.
If anything fails after step 1, send cancel_upload to discard the parts already sent. The Python SDK does all four steps, and the cancel, in Onnx.upload().

POST /revisions/:id/data/command (Command: initiate_upload)

Request Body

Response

operation carries id, blob_id, org_id, revision_id, type (upload), status (in_progress) and parts — nothing about where storage keeps the upload. Each part is: Parts are 10 MiB each and in order, and the last one holds the remainder, so together they cover the archive exactly and none is empty — an archive that is an exact multiple of 10 MiB included. Only this response carries the URLs: Get Operation shows each part as its size and offset alone.

Errors

Example

Sending the parts

PUT each part’s size bytes, read from its offset, to its upload.url, with its upload.headers. Send no API key or token: the URL itself is the authorization. Storage answers each PUT with an ETag header, quotes included; keep it exactly as received.
A part that fails can be sent again. Its URL works for an hour from initiate_upload.

POST /revisions/:id/data/command (Command: complete_upload)

Request Body

Each element is exactly {"hash": "<the ETag storage returned for that part>"}; the platform numbers the parts by their position in the array.

Response

Returns {"status": "success"}. The archive is assembled and its processing queued; follow it with Get Operation.

Errors

The operation must be this revision’s own. An id from another revision or blob, one that names a single-part upload, and one that does not exist all answer the same 403, so an operation id cannot be probed from elsewhere.

Example

POST /revisions/:id/data/command (Command: cancel_upload)

Discards an upload’s parts in storage. Send it when an upload cannot be completed; the presigned URLs stop working. The operation record itself is left as it was, in_progress, so stop polling it.

Request Body

Response

Returns {"status": "success"}.

Errors

Example

Request

See also