# ZCode

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

本文介绍如何在 ZCode 中配置并使用方舟 Agent Plan 企业版。

<span id="pre-operation"></span>
# 前提条件

需由管理员账号完成以下操作后，子账号方可配置并使用 ZCode：

1. 购买方舟 Agent Plan 企业版套餐：[一、购买 Agent Plan 企业版](/docs/agent-plan-enterprise-get-started#purchase-plan)。
2. 为子账号分配席位：[二、分配席位](/docs/agent-plan-enterprise-get-started#assign-seats)。

<span id="install-zcode"></span>
# 安装 ZCode

访问 [ZCode 官网](https://zcode.z.ai/cn#all-downloads)，下载并安装适合您操作系统的版本。安装步骤可参考 [ZCode 官方安装教程](https://zcode.net.cn/en/docs/install#setup-guide)，安装完成后按提示登录。

<span id="4dd21a01"></span>
# 配置 ZCode

Agent Plan 企业版同时兼容 OpenAI 与 Anthropic 接口协议，ZCode 均支持。以下以 **OpenAI 协议**为例；如需使用 Anthropic 协议，将 API 格式改为 **Anthropic** 并把 Base URL 换成 `https://ark.cn-beijing.volces.com/api/plan` 即可。

<span id="method-1-auto-helper"></span>
## 方式 1：一键配置（推荐）

Ark CLI 是火山方舟平台官方命令行工具，支持在本地终端快速完成认证与资源管理，并可将能力安装到常用 AI Agent 中，降低手动配置的时间成本和出错风险。

1. 安装 Ark CLI

    环境要求：Node.js 18 或更新版本。支持 macOS、Linux、Windows。

```Bash
npm install -g @volcengine/ark-cli@latest
arkcli --version
```

2. 登录 Ark CLI

    根据界面提示选择登录方式，推荐选择 **火山 SSO (浏览器登录)**，在浏览器中完成授权即可。

```Bash
arkcli auth login
```

3. 一键配置 ZCode

```Bash
arkcli helper
```
运行 ArkCLI Helper，根据界面提示完成配置。
* **选择 Profile**：`agent-plan-team_cn-beijing_team`。
* **选择默认 model**：按需选择。
* **选择 AI Agent**：`ZCode`。
    支持配置 Harness 能力，根据界面提示按需选择`配置`或者`跳过`。

配置完成后，ZCode 会自动识别配置的模型。启动 ZCode 即可使用。

<span id="method-2-manual"></span>
## 方式 2：手动配置

1. 打开 ZCode 客户端，单击左下角 **设置** 图标，进入 **模型设置**，单击 **添加供应商**。

![zcode-setting.png](https://arkdocs.tos-cn-beijing.volces.com/images/CodingPlan/zcode-setting.png)

2. 在弹出的表单中填写以下字段，保存供应商。

    * **名称**：自定义，便于识别，例如 `Ark Agent Plan 企业版`。
    * **Base URL**：`https://ark.cn-beijing.volces.com/api/plan/v3`（OpenAI 协议）；若使用 Anthropic 协议，填 `https://ark.cn-beijing.volces.com/api/plan`。
    * **API Key**：填写您的 [专属 API Key](https://ark.volcengine.com/region:cn-beijing/subscription/agent-plan-enterprise/mine)。
        请勿混用方舟平台的普通 API Key。
    ![image-20260909-103103-932.png](https://arkdocs.tos-cn-beijing.volces.com/images/agent-plan/agent-plan-enterprise-api-key.png)
    * **API 格式**：取决于选择的 Base URL。

        |API 格式 |Base URL |
        |---|---|
        |Anthropic Messages |`https://ark.cn-beijing.volces.com/api/plan` |
        |Chat Completions |`https://ark.cn-beijing.volces.com/api/plan/v3` |
        |Responses |`https://ark.cn-beijing.volces.com/api/plan/v3` |

3. 单击 **添加模型**，在表单中填写以下字段，保存模型。可以多次点击 **添加模型**，为一个供应商添加多个模型。

    * **模型 ID**：填入所选套餐支持的 Model Name，详见 [支持模型及 Harness](/docs/agent-plan-enterprise-plan-overview#supported-models-harness)，需配置文本生成模型。
    * **上下文窗口**：按所选模型的最大上下文长度填写，取值参见 [支持模型及 Harness](/docs/agent-plan-enterprise-plan-overview#supported-models-harness)。
    * **最大输出 Token**（可选）：按需填写，默认可留空跟随模型上限。

除了在客户端 UI 中添加供应商，也可以直接编辑本地配置文件 `~/.zcode/v2/config.json`（Windows 系统为 `%USERPROFILE%\.zcode\v2\config.json`）。首次通过 UI 完成任意配置后该文件会自动生成，已有内容时在 `provider` 对象中追加一条即可。

API 格式为**Anthropic Messages**时，`~/.zcode/v2/config.json` 示例

```JSON
{
  "provider": {
    ...
    "volcengine-enterprise-agent-plan": {
      "name": "Ark Agent Plan 企业版",
      "kind": "anthropic",
      "options": {
        "apiKey": "<ARK_API_KEY>",
        "baseURL": "https://ark.cn-beijing.volces.com/api/plan",
        "apiKeyRequired": true
      },
      "enabled": true,
      "source": "custom",
      "models": {
        "ark-code-latest": {
          "limit": { "context": 256000, "output": 32768 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-evolving": {
          "limit": { "context": 1024000, "output": 262144 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.1-pro": {
          "limit": { "context": 1024000, "output": 256000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.1-lite": {
          "limit": { "context": 1024000, "output": 256000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.0-mini": {
          "limit": { "context": 256000, "output": 128000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4.1-flash": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4.1-flash-economy": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4-flash": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "deepseek-v4-pro": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "glm-5.3": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "glm-5.3-flash": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "glm-latest": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "kimi-k2.8-preview": {
          "limit": { "context": 1024000, "output": 1024000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "kimi-k3.1-pro": {
          "limit": { "context": 1024000, "output": 1024000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        }
      }
    }
    ...
  }
}
```

API 格式为**Chat Completions**时，`~/.zcode/v2/config.json` 示例

```JSON
{
  "provider": {
    ...
    "volcengine-enterprise-agent-plan": {
      "name": "Ark Agent Plan 企业版",
      "kind": "openai-compatible",
      "options": {
        "apiKey": "<ARK_API_KEY>",
        "baseURL": "https://ark.cn-beijing.volces.com/api/plan/v3",
        "apiKeyRequired": true
      },
      "enabled": true,
      "source": "custom",
      "models": {
        "ark-code-latest": {
          "limit": { "context": 256000, "output": 32768 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-evolving": {
          "limit": { "context": 1024000, "output": 262144 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.1-pro": {
          "limit": { "context": 1024000, "output": 256000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.1-lite": {
          "limit": { "context": 1024000, "output": 256000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.0-mini": {
          "limit": { "context": 256000, "output": 128000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4.1-flash": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4.1-flash-economy": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4-flash": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "deepseek-v4-pro": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "glm-5.3": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "glm-5.3-flash": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "glm-latest": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "kimi-k2.8-preview": {
          "limit": { "context": 1024000, "output": 1024000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "kimi-k3.1-pro": {
          "limit": { "context": 1024000, "output": 1024000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        }
      }
    }
    ...
  }
}
```

API 格式为**Responses**时，`~/.zcode/v2/config.json` 示例

```JSON
{
  "provider": {
    ...
    "volcengine-enterprise-agent-plan": {
      "name": "Ark Agent Plan 企业版",
      "kind": "openai",
      "options": {
        "apiKey": "<ARK_API_KEY>",
        "baseURL": "https://ark.cn-beijing.volces.com/api/plan/v3",
        "apiKeyRequired": true
      },
      "enabled": true,
      "source": "custom",
      "models": {
        "ark-code-latest": {
          "limit": { "context": 256000, "output": 32768 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-evolving": {
          "limit": { "context": 1024000, "output": 262144 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.1-pro": {
          "limit": { "context": 1024000, "output": 256000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.1-lite": {
          "limit": { "context": 1024000, "output": 256000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "doubao-seed-2.0-mini": {
          "limit": { "context": 256000, "output": 128000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4.1-flash": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4.1-flash-economy": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "deepseek-v4-flash": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "deepseek-v4-pro": {
          "limit": { "context": 1024000, "output": 393216 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "glm-5.3": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "glm-5.3-flash": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "glm-latest": {
          "limit": { "context": 1024000, "output": 131072 },
          "modalities": { "input": ["text"], "output": ["text"] }
        },
        "kimi-k2.8-preview": {
          "limit": { "context": 1024000, "output": 1024000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "kimi-k3.1-pro": {
          "limit": { "context": 1024000, "output": 1024000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        }
      }
    }
    ...
  }
}
```

> **注意**
>
> * `<ARK_API_KEY>` 替换为您的 [专属 API Key](https://ark.volcengine.com/region:cn-beijing/subscription/agent-plan-enterprise/mine)。
> * 请勿混用方舟平台的普通 API Key。
> * 上述示例列出的是 Agent Plan 企业版目前在售的文本生成模型全集。不同套餐（Team Small / Team Medium / Team Large / Team Max）支持的模型不同，请以 [支持模型及 Harness](/docs/agent-plan-enterprise-plan-overview#supported-models-harness) 中的支持矩阵为准，删除您所选套餐不支持的条目，避免调用时收到 model not found 错误。

4. 保存完成后，回到 ZCode 主界面。

<span id="use-zcode"></span>
# 使用 ZCode

1. 在 ZCode 主界面顶部的模型下拉中，选中刚添加的模型。
2. 在对话框输入你的需求（如生成代码、修复 bug、重构、写单元测试），回车即可开始对话开发。ZCode 支持规划、编码、评审与上线等全流程研发场景。

> 更多使用技巧和高级功能参见 [ZCode 官方文档](https://zcode.net.cn/en/docs)。
