> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ariacompute.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# PIN 从目录创建数据集

> PIN API 的 POST /v1/datasets/from-catalog。按目录 ID 导入精选数据集，支持本地或流式访问模式。

使用此接口将精选目录中的数据集导入到你的账户。指定目录条目，并选择本地存储或流式访问。响应可能是立即创建的 201，或在下载进行中的 202 受理。

## 接口

```http theme={null}
POST /v1/datasets/from-catalog
```

## 认证

需要有效的 `Authorization: Bearer <jwt-or-api-key>` 头。

## 请求体

<ParamField body="catalog_id" type="string" required>
  数据集在目录中的标识符。
</ParamField>

<ParamField body="access" type="string" required>
  访问模式：`local` 或 `stream`。
</ParamField>

## 响应

<ResponseField name="id" type="string">
  已创建或待处理数据集的唯一标识符。
</ResponseField>

<ResponseField name="name" type="string">
  数据集名称。
</ResponseField>

<ResponseField name="status" type="string">
  当前状态，例如 `ready` 或 `downloading`。
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://ariapin.example.com:8001/v1/datasets/from-catalog \
    -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
    -H "Content-Type: application/json" \
    -d '{"catalog_id":"ds_catalog_1","access":"local"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "code": 0,
    "data": {
      "id": "ds_abc",
      "name": "General Instruction Tuning",
      "status": "ready"
    },
    "message": ""
  }
  ```
</ResponseExample>
