<span id="下载运行绑定技能文件zip"></span>

# Download skill files bound to a runtime as ZIP

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

Download files at the skill version frozen by the current trusted runtime. The version comes from verified runtime claims, not URL parameters or the current skill version.

```text
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/skills/{skill_id}/runtime-files
```

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

## Before you call this API

Set `MOI_ENDPOINT` to the product API prefix `https://api.moi.matrixorigin.cn/v5`. For private deployments, use the corresponding product API URL.

Applies only to child runtime environments already admitted by the product. Use Endpoint, technical API Key, Workspace, and X-MOI-Runtime-Authorization supplied together by that environment. The latter is the complete Bearer line; do not replace it with a personal access token or short-lived browser proof.

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

## Request parameters

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

```bash
curl --fail-with-body "$MOI_ENDPOINT/workspaces/$MOI_WORKSPACE_ID/skills/$SKILL_ID/runtime-files" \
  -H "X-API-Key: $MOI_API_KEY" \
  -H "X-Workspace-ID: $MOI_WORKSPACE_ID" \
  -H "X-MOI-Runtime-Authorization: $MOI_RUNTIME_AUTHORIZATION" \
  --output skill-files.zip
```

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

| Parameter | Type | Description |
| --- | --- | --- |
| `workspace_id` | string | Must match verified runtime claims. |
| `skill_id` | string | Skill bound in claims with one positive version. |
| Query parameters | Not accepted | Nonempty RawQuery is rejected; version/source workspace cannot be supplied. |
| Runtime claims | Trusted context | The backend confirms binding, source limited to current workspace/system, and one frozen version. |

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

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

## Successful response

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

```text
HTTP/1.1 200 OK
Content-Type: application/zip
Content-Disposition: attachment; filename=skill-files.zip
X-MOI-Skill-Version: 7
Cache-Control: private, no-store
X-Content-Type-Options: nosniff

<ZIP二进制字节>
```

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

| Field or response item | Type | Description |
| --- | --- | --- |
| Response body | ZIP bytes | Neither a JSON envelope nor plaintext for one file. |
| `X-MOI-Skill-Version` | HTTP header | Actual frozen version. Example7 is not caller-selected. |
| File source | Protocol behavior | Reads the frozen version and verifies paths/sizes/digests. Current-version updates do not replace the snapshot. |

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

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

## Error response

Missing claims, unbound skills, invalid source/version/workspace, or query parameters may return 403; missing frozen versions/files404. Skill errors follow current mappings. A mock successful regular-PAT download does not verify actual admission.
