---
title: "Mint a hosted-media artifact"
method: POST
path: "/v1/media/host"
tags: ["Video"]
---

# Mint a hosted-media artifact

`POST /v1/media/host`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/media/host`
- Auth: HTTP bearer

Hosts a media artifact for local serving and returns a capability URL. Provide
exactly one input: `filePath` (a ToolPiper-produced artifact on disk) or
`manifestUrl` (a captured HLS/DASH manifest to save). The returned `url` points
at the unauthenticated, unguessable byte-serve `GET /v1/media/med_{id}` (Range
capable). When the artifact is still being produced, `jobId` is returned so the
caller can poll or cancel via `/v1/stream/save/{jobId}`.

## Request body

- object
  - `filePath` string: Path to a ToolPiper-produced artifact (mutually exclusive with manifestUrl)
  - `manifestUrl` string: Captured HLS/DASH manifest URL to save (mutually exclusive with filePath)
  - `kind` string: Stream kind hint for manifestUrl (e.g. hls, dash)
  - `expiresAt` integer: Optional expiry as epoch milliseconds

## Response `202`

Artifact minted (may still be producing)

- object
  - `id` string, required: Capability id (med_-prefixed)
  - `url` string, required: Loopback byte-serve URL for the artifact
  - `expiresAt` integer, required: Expiry as epoch milliseconds
  - `jobId` string: Producing save job id, when the artifact is still pending

## Other responses

- `400`: Missing or invalid input (neither filePath nor manifestUrl provided)
- `410`: Source is gone or no longer available
- `422`: Unsupported kind or DRM-protected source
- `429`: Too many concurrent hosting requests
- `502`: Could not fetch the manifest

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
