# Download skill file

Download a static file imported with the skill pack. The success response is the binary content of the file and does not use a JSON success envelope.

```text
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/skills/{skill_id}/files/content?path={path}
```

## Before you call this API

Configure the [regional API endpoint and authentication](https://omnifabric.cloudsigma.com/docs/developer/endpoints-and-authentication.html.md), and select the target workspace.

First [query the skill file](https://omnifabric.cloudsigma.com/docs/reference/api/ai-studio/agents/skills/list-skill-files.html.md) to obtain `file_path`.

Set the operation-specific values used in the request:

- `$SKILL_ID`: Skill ID.

## Request example

```bash
curl -OJ "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/files/content?path=references%2Fguide.md" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

## Path parameters

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | Yes | The current workspace ID. |
| `skill_id` | string | Yes | Skill ID. |

## Query parameters

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `path` | string | Yes | The relative path of the file in the skill package. Cannot be a directory, an absolute path, a path containing `..`, or a backslash. |

## Successful response

Returns `200` and the file contents on success. The response is not a JSON envelope. The response sets the following headers:

| Response header | Description |
| --- | --- |
| `Content-Type` | The actual media type of the file. |
| `Content-Disposition` | `attachment` and provide a UTF-8 encoded file name. |
| `X-Content-Type-Options` | Fixed to `nosniff`. |

## Error response

Returns JSON on error:

```json
{
  "code": 3,
  "message": "<错误信息>",
  "details": {
    "reason": "SKILL_PACKAGE_FILE_NOT_FOUND"
  }
}
```

### Common HTTP errors

```{list-table}
:header-rows: 1
:widths: 12 22 32 34

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `400`
  - `2`（`INVALID_ARGUMENT`）
  - `path` Missing or unsafe skill pack relative path.
  - Use the `file_path` returned as-is by Query Skill File.
* - `401`
  - `6`（`UNAUTHENTICATED`）
  - Lack of valid identity credentials.
  - Check API Key.
* - `403`
  - `5`（`PERMISSION_DENIED`）
  - The current identity does not have permission to read the skill file.
  - Check workspace authorization.
* - `404`
  - `3`（`NOT_FOUND`）
  - The skill or specified file does not exist.
  - Check skill ID and `path`.
* - `503`
  - `15`（`UNAVAILABLE`）
  - Skill pack storage is unavailable.
  - Try again later.
```

## Follow-up operations

If you need to continue management after the download is completed, return to [Query skill details](https://omnifabric.cloudsigma.com/docs/reference/api/ai-studio/agents/skills/get-skill.html.md).
