CoPaw API Chat
Use this skill to work with CoPaw over HTTP API, not through the web UI.
When to use
- - You need to talk to a local CoPaw instance programmatically.
- You need the correct sequence: create chat/session → send message → read SSE.
- You need to understand agent scoping, auth layers, or related API groups before building automation.
Workflow
- 1. Read
references/overview-auth-scoping.md first. - If the task is about chatting with CoPaw, then read
references/chats-console-sse.md. - If the task touches agent/model/skill/tool management, read
references/agents-models-skills-tools.md. - If the task touches workspace, MCP, or cron, read
references/workspace-mcp-cron.md. - If you need ready-to-run examples, read
references/practical-recipes.md.
Minimal practical path
- 1. Confirm agent id (
default unless proven otherwise). - Create a chat with
POST /api/chats. - Reuse the returned
session_id/user_id/channel context. - Send the message with
POST /api/agents/{agentId}/console/chat. - Read the response as SSE.
Important rules
- - Do not assume stateless request/response. CoPaw is chat/session-centric.
- Distinguish confirmed API behavior from interpretation.
- Prefer agent-scoped routes (
/api/agents/{agentId}/...) or set X-Agent-Id explicitly. - In the current deployment, auth may be provided by nginx Basic Auth even if internal CoPaw auth is off.
- Treat
/api/workspace and some /api/agents/*/files/* surfaces as dangerous/admin-level APIs.
References
- -
references/overview-auth-scoping.md — API surface, auth, scoping, priorities - INLINECODE14 — chat lifecycle, session context, SSE mechanics
- INLINECODE15 — management surfaces around agents/models/skills/tools
- INLINECODE16 — workspace, MCP, cron boundaries and risks
- INLINECODE17 — short request examples and file structure examples
Output expectations
When using this skill, answer with:
- - the minimal correct endpoint sequence,
- the required payload shape,
- auth/scoping caveats,
- and only the API groups relevant to the task.
CoPaw API 聊天
使用此技能通过 HTTP API 与 CoPaw 交互,而非通过 Web 界面。
使用场景
- - 你需要以编程方式与本地 CoPaw 实例进行对话。
- 你需要遵循正确的顺序:创建聊天/会话 → 发送消息 → 读取 SSE。
- 在构建自动化之前,你需要理解代理范围、认证层或相关 API 组。
工作流程
- 1. 首先阅读 references/overview-auth-scoping.md。
- 如果任务涉及与 CoPaw 聊天,则阅读 references/chats-console-sse.md。
- 如果任务涉及代理/模型/技能/工具管理,则阅读 references/agents-models-skills-tools.md。
- 如果任务涉及工作空间、MCP 或定时任务,则阅读 references/workspace-mcp-cron.md。
- 如果需要可直接运行的示例,则阅读 references/practical-recipes.md。
最小实用路径
- 1. 确认代理 ID(除非另有证明,否则为 default)。
- 使用 POST /api/chats 创建聊天。
- 复用返回的 sessionid/userid/channel 上下文。
- 使用 POST /api/agents/{agentId}/console/chat 发送消息。
- 以 SSE 格式读取响应。
重要规则
- - 不要假定无状态的请求/响应。CoPaw 是 以聊天/会话为中心 的。
- 区分已确认的 API 行为与个人解读。
- 优先使用代理作用域路由(/api/agents/{agentId}/...)或显式设置 X-Agent-Id。
- 在当前部署中,即使内部 CoPaw 认证关闭,认证也可能由 nginx 基本认证 提供。
- 将 /api/workspace 和某些 /api/agents//files/ 接口视为危险/管理员级 API。
参考资料
- - references/overview-auth-scoping.md — API 范围、认证、作用域、优先级
- references/chats-console-sse.md — 聊天生命周期、会话上下文、SSE 机制
- references/agents-models-skills-tools.md — 代理/模型/技能/工具的管理接口
- references/workspace-mcp-cron.md — 工作空间、MCP、定时任务的边界与风险
- references/practical-recipes.md — 简短请求示例和文件结构示例
输出预期
使用此技能时,应回答:
- - 最小的正确端点顺序,
- 所需的请求体结构,
- 认证/作用域注意事项,
- 仅包含与任务相关的 API 组。