<span id="签发模型临时文件读取链接"></span>

# Issue a temporary model file link

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Issue a temporary read link containing a single-file capability credential.

```text
POST https://api.moi.matrixorigin.cn/v5/workspaces/{id}/files/{file_id}/model-url
```

<span id="调用前准备"></span>

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`; use the corresponding product API URL for a dedicated deployment.

Prepare a personal access token for the target workspace. WORKSPACE_ID must match the path workspace; FILE_ID comes from actual file results. BASE_URL includes the product prefix in the same environment. Example files/IDs are placeholders.

<span id="请求参数"></span>

## Request parameters

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --fail-with-body -sS -X POST "$BASE_URL/workspaces/$WORKSPACE_ID/files/$FILE_ID/model-url" \
  -H "X-API-Key: $MOI_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

:::::
:::::{tab-item} Parameters

No business request body. Set the path workspace and file ID to actual targets.

Success directly returns url and expires_at without an outer code/data envelope. Link holders may read the corresponding file under valid conditions. Link credentials are not interchangeable with ordinary PATs. Expiration, file state, and service configuration each affect availability.

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "url": "https://model.example.invalid/v5/catalog-files/file-example/content?capability=example-capability",
  "expires_at": "2026-11-12T12:00:00Z"
}
```

:::::
:::::{tab-item} Fields

url is an absolute URL containing capability query parameters. expires_at is a UTC RFC3339 expiration time. Do not assume a fixed TTL.

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error responses

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": 2,
  "message": "示例错误信息"
}
```

:::::
:::::{tab-item} Fields

Errors use numeric code/message and may occur at identity or permission boundaries before issuance. An unconfigured link service or unavailable tenant database may return 503/15; a confirmed missing file returns 404/3. Issuance-specific errors differ from the content endpoint's uniform 404.

:::::
::::::
:::::::
