Download Model
Page Outline
Generates a time-limited signed download URL for the serialized model artifact of a specific version, allowing the caller to retrieve the model file directly from object storage.
Base Path: /api/v1/models
Method: GET
Path: /{model_id}/download
Auth: Requires a valid Bearer token (Authorization: Bearer <JWT>)
Path Parameters
| Parameter | Type | Description |
|---|---|---|
model_id | string | Unique identifier of the model |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
version_id | string | — | Version to download. Defaults to the currently promoted version |
format | string | pkl | Artifact format: pkl (Python pickle), onnx, joblib |
expires_in | integer | 3600 | Signed URL expiry in seconds (max: 86400) |
Behavior
- Does not stream the file directly — returns a signed URL that expires after
expires_inseconds. - Not all format options are available for every model or algorithm. Returns
HTTP 422if the requested format was not generated during training (e.g.,onnxrequires opt-in during training config). - An audit log entry is written with action
model.artifact_downloaded, recording the version and format downloaded. - Returns
HTTP 404if the model or version is not found. - Returns
HTTP 403if the caller does not have download permissions on the model.
Response
Returns a DownloadLink object.
{
"model_id": "mdl-7f3a19bc",
"version_id": "ver-001",
"format": "pkl",
"download_url": "https://s3.amazonaws.com/rivergen-models/mdl-7f3a19bc/v3/model.pkl?X-Amz-Signature=...",
"expires_at": "2026-03-13T17:10:00Z",
"file_size_bytes": 4829340
}