# 创建推理接入点滚动升级任务

> 全部文档的索引见 [llms.txt](https://ark.volcengine.com/llms.txt)；在任一文档页面地址后追加 `.md` 可获取该页的 Markdown 版本。

`POST https://ark.cn-beijing.volcengineapi.com/?Action=CreateEndpointRolling&Version=2024-01-01`

为指定推理接入点创建模型版本的滚动更新任务，支持灰度切换底层模型而不中断服务。

## 鉴权

本接口支持鉴权方式如下，详情请参见 [Base URL 及鉴权](/docs/base-url-and-authentication)。

* Access Key 鉴权，请在 [Access Key 管理](https://console.volcengine.com/iam/keymanage) 页面，获取 Access Key。本接口仅支持 Access Key 鉴权。

---

<span id="request-parameters"></span>
## 请求参数

### Body 参数

**EndpointId** `string` `必选` | 接入点 ID

需要创建滚动更新的推理接入点 ID

**ModelReference** `object` `必选` | 目标模型配置

滚动更新的目标模型配置，指定要切换到的新模型版本

**CustomModelId** `string` | 定制模型的 ID

`ModelReference.CustomModelId`

**FoundationModel** `object` | 基础模型引用

`ModelReference.FoundationModel`

**ModelVersion** `string` `必选` | 基础模型版本

`ModelReference.FoundationModel.ModelVersion`

**Name** `string` `必选` | 基础模型名称

`ModelReference.FoundationModel.Name`

**Description** `string` | 滚动更新描述

滚动更新任务的描述信息

**TargetRouter** `object` | 目标路由配置

滚动更新完成后的目标智能路由配置

**Mode** `string` `必选` | 路由模式

`TargetRouter.Mode`

路由模式。取值 `Automatic`(自动)、`CandidateSet`(候选集合)、`Ordered`(按顺序)

**Strategy** `string` `必选` | 路由策略

`TargetRouter.Strategy`

路由策略。取值 `EffectFirst`(效果优先)、`CostFirst`(成本优先)、`Balanced`(均衡)

**CandidateModels** `object[]` | 候选模型列表

`TargetRouter.CandidateModels`

**CustomModelId** `string` | 定制模型的 ID

`TargetRouter.CandidateModels.CustomModelId`

**FoundationModel** `object` | 基础模型引用

`TargetRouter.CandidateModels.FoundationModel`

**ModelVersion** `string` `必选` | 基础模型版本

`TargetRouter.CandidateModels.FoundationModel.ModelVersion`

**Name** `string` `必选` | 基础模型名称

`TargetRouter.CandidateModels.FoundationModel.Name`

## 响应参数

**Id** `string` | 滚动更新任务 ID

新建滚动更新任务的 ID，可用于查询任务状态或执行回滚


## 代码示例

## 默认

### cURL

#### Request

```bash
curl 'https://ark.cn-beijing.volcengineapi.com/?Action=CreateEndpointRolling&Version=2024-01-01' \
  -H 'Content-Type: application/json' \
  -H 'X-Date: <X-Date>' \
  -H 'X-Content-Sha256: <X-Content-Sha256>' \
  -H 'Authorization: HMAC-SHA256 Credential=<AK>/<X-Date>/cn-beijing/ark/request, SignedHeaders=content-type;host;x-content-sha256;x-date, Signature=<Signature>' \
  -d '{
    "EndpointId": "ep-20260507230659-skvgn",
    "ModelReference": {
        "CustomModelId": "",
        "FoundationModel": {
            "Name": "doubao-seed-2-0-pro",
            "ModelVersion": "260328"
        }
    },
    "Description": "灰度升级至新版本，观察效果与稳定性",
    "TargetRouter": {
        "Strategy": "Balanced",
        "Mode": "Automatic",
        "CandidateModels": []
    }
}
'
```

#### Response

```
{
    "ResponseMetadata": {
        "RequestId": "20240514212755F607182F05EF08192A",
        "Action": "CreateEndpointRolling",
        "Version": "2024-01-01",
        "Service": "ark",
        "Region": "cn-beijing"
    },
    "Result": {
        "Id": "rolling-20240514212750-abc12"
    }
}
```
