> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-robin-i18n-sync.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAPI 规范

> Comfy Cloud API 的机器可读的 OpenAPI 规范

<Warning>
  **弃用：** v1 Cloud API 已弃用，推荐使用 [Comfy API v2](/zh/api-reference/v2/overview)。端点、请求/响应格式和行为可能会在不另行通知的情况下进行修改。
</Warning>

# Comfy Cloud API 规范

本页面提供 Comfy Cloud API 的完整 OpenAPI 3.0 规范。

<Note>
  **需要订阅：** 通过 API 运行工作流需要有效的 Comfy Cloud 订阅。详情请参阅[定价页面](https://www.comfy.org/cloud/pricing?utm_source=docs\&utm_campaign=cloud-api)。
</Note>

## 交互式 API 参考

通过交互式文档探索完整的 API：

<Card title="Cloud API 参考" icon="code" href="/zh/api-reference/cloud/overview">
  浏览端点、查看模式并尝试请求
</Card>

## 使用规范

OpenAPI 规范可用于：

* **生成客户端库**：使用 [OpenAPI Generator](https://openapi-generator.tech/) 等工具生成任何语言的客户端库
* **导入到 API 工具**：如 Postman、Insomnia 或 Paw
* **生成文档**：使用 Redoc 或 Swagger UI 等工具
* **验证请求**：在您的应用程序中验证请求

## 下载

您可以下载原始 OpenAPI 规范文件：

<Card title="openapi-cloud.yaml" icon="download" href="https://raw.githubusercontent.com/Comfy-Org/docs/main/openapi-cloud.yaml">
  下载 OpenAPI 3.0 规范
</Card>

## 认证

所有 API 请求都需要在 `X-API-Key` 请求头中传递 API 密钥。

### 获取 API 密钥

请参阅[获取 API 密钥](/zh/development/api-development/getting-an-api-key)了解带有截图的分步说明。

### 使用 API 密钥

```yaml theme={null}
X-API-Key: your-api-key
```

## 基础 URL

| 环境   | URL                       |
| ---- | ------------------------- |
| 生产环境 | `https://cloud.comfy.org` |

## WebSocket 连接

如需实时更新，请连接到 WebSocket 端点：

```
wss://cloud.comfy.org/ws?clientId={uuid}&token={api_key}
```

请参阅 [Cloud API 参考](/zh/development/cloud/api-reference#实时进度-websocket)了解消息类型和处理方法。
