
Coze Api
Wraps the Coze API from ByteDance for building integrations with their AI agent platform. You get both streaming and non-streaming chat endpoints, workflow execution, and conversation history management. The skill includes complete Python examples showing how to authenticate with personal access tokens, poll for completion status in non-streaming mode, and handle server-sent events when streaming responses. One thing to note: streaming mode forces auto_save_history to false, while non-streaming requires it true, which feels like an odd API design choice. The documentation is thorough with actual code you can copy, including the full polling loop pattern you'll need since their non-streaming endpoint doesn't block until completion.
- skills.sh installs
- 143
- GitHub stars
- 310
- last updated
- Aug 21, 2026
Install
$ npx -y skills add smallnest/langgraphgo --skill coze-api --agent claude-codeInstalls into .claude/skills of the current project.
Files
Coze API 集成 Skill
扣子(Coze)是字节跳动推出的 AI 智能体开发平台,本 Skill 提供完整的 Coze API 调用指南。
核心功能
- 对话 API (Chat API) - 与智能体进行对话
- 工作流 API (Workflow API) - 执行工作流
- 消息管理 - 查询对话状态和消息列表
快速开始
1. 准备工作
在使用 Coze API 前需要完成以下准备:
获取访问令牌 (Personal Access Token)
- 登录 Coze 平台: https://www.coze.cn
- 进入个人中心 → API 管理
- 创建个人访问令牌(PAT)
- 保存令牌(仅显示一次)
获取 Bot ID
- 进入 Bot 编辑页面
- 从 URL 中获取 Bot ID
- 例如:
https://www.coze.cn/space/123/bot/7348293334 - Bot ID 为:
7348293334
- 例如:
发布 Bot 为 API 服务
- 在 Bot 页面点击"发布"
- 选择"Bot as API"
- 等待审核通过
2. API 基础信息
API 基础 URL
- 国内版:
https://api.coze.cn - API 版本: v3(推荐)
认证方式
Authorization: Bearer {YOUR_PAT_TOKEN}
Content-Type: application/json
使用限制
- 基础版: 每账号 100 次 API 调用(一次性)
- 专业版: 无限制,按 Token 消耗计费
对话 API (Chat API)
非流式对话
发起一次完整对话,等待完整结果后返回。
API 端点
POST https://api.coze.cn/v3/chat
Python 示例代码
import requests
import json
API_URL = "https://api.coze.cn/v3/chat"
RETRIEVE_URL = "https://api.coze.cn/v3/chat/retrieve"
MESSAGE_LIST_URL = "https://api.coze.cn/v3/chat/message/list"
# 配置参数
PAT_TOKEN = "YOUR_PAT_TOKEN"
BOT_ID = "YOUR_BOT_ID"
USER_ID = "unique_user_id"
Sponsors
Details
- Repository
- github.com/smallnest/langgraphgo
- Category
- Backend & APIs
- First seen
- Jun 3, 2026