> ## 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.

# Upload Model

Upload an ONNX model file (`model.tar.gz`) to a revision.

## **POST** `/revisions/:id/data/command` (Command: `upload`)

### Request Body

| Parameter | Type    | Required | Description                        |
| :-------- | :------ | :------- | :--------------------------------- |
| `engine`  | string  | Yes      | Must be `onnx`.                    |
| `command` | string  | Yes      | Must be `upload`.                  |
| `path`    | string  | Yes      | File name, must be `model.tar.gz`. |
| `size`    | integer | Yes      | Size of the file in bytes.         |

### Response

| Parameter      | Type   | Description                                             |
| :------------- | :----- | :------------------------------------------------------ |
| `operation_id` | string | ID of the background upload operation.                  |
| `url`          | string | Presigned S3 URL to upload the file to (if applicable). |

### Example

<CodeGroup>
  ```json Request theme={null}
  {
    "engine": "onnx",
    "command": "upload",
    "path": "model.tar.gz",
    "size": 154829
  }
  ```

  ```json Response theme={null}
  {
    "operation_id": "op_upload_123",
    "url": "https://s3.amazonaws.com/..."
  }
  ```
</CodeGroup>
