> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Multipart Download

Download a model artifact too large for one [Download Model](/blob-types/onnx/download) response. The platform
answers with a part plan: a presigned storage URL and a byte range for each 10 MiB part, which the client fetches
directly and writes at its offset.

## **POST** `/revisions/:id/data/query` (Command: `initiate_download`)

A read, so it goes to the query route and needs Read access. The command route accepts it too, with the write
access that route requires.

### Request Body

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `command` | string | Yes | Must be `initiate_download`. |
| `path` | string | Yes | One of `model.tar.gz`, `model.onnx`, `model.json`. |

### Response

| Parameter | Type | Description |
| :- | :- | :- |
| `operation` | object | The part plan, in `operation.parts`. |

No operation is recorded and there is nothing to poll: `operation` holds only `parts`. Each part is:

| Field | Type | Description |
| :- | :- | :- |
| `size` | integer | Bytes in this part. |
| `offset` | integer | Where the part starts in the artifact. |
| `download.url` | string | The presigned URL to `GET` the part from. Valid for one hour. |
| `download.headers` | object | Headers to send with that `GET`: `Range`, the part's bytes. |

Parts are 10 MiB each and in order, and the last one holds the remainder, so together they cover the artifact
exactly and none is empty. Each `Range` is `bytes=<first>-<last>`, both ends inclusive. `GET` each URL with its
`Range` header and no API key or token, check that `size` bytes came back, and write them at `offset`.

### Errors

| Status | Error | Cause |
| :- | :- | :- |
| 400 | `invalid_request_body` | `path` is not one of the three, or an unlisted field was sent. |
| 403 | `forbidden` | The revision does not exist, or the caller cannot read its blob. |
| 404 | `artifact_not_found` | The revision does not hold this artifact: nothing uploaded, or processing unfinished. |
| 409 | `blob_not_ready` | The blob is being deleted, or has failed. |
| 409 | `revision_not_ready` | The revision's status is not `ready`. |

### Example

<CodeGroup>
  ```json Request theme={null}
  {
    "command": "initiate_download",
    "path": "model.onnx"
  }
  ```

  ```json Response theme={null}
  {
    "status": "success",
    "operation": {
      "parts": [
        {
          "size": 10485760,
          "offset": 0,
          "download": {"url": "https://…", "headers": {"Range": "bytes=0-10485759"}}
        },
        {
          "size": 2097152,
          "offset": 10485760,
          "download": {"url": "https://…", "headers": {"Range": "bytes=10485760-12582911"}}
        }
      ]
    }
  }
  ```
</CodeGroup>

## See also

* [Download Model](/blob-types/onnx/download) — one response, for an artifact of 4 MiB or less.
* [Describe Model](/blob-types/onnx/describe) — each artifact's size, to choose between the two.
* [Python SDK → ONNX](/sdk/onnx) — `Onnx.download()` picks the route and assembles the parts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.