composio
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseComposio — External App Integration via Gateway
Composio — 通过网关实现外部应用集成
Composio lets users connect 1000+ external apps (Gmail, Slack, GitHub, Google Calendar, Notion, etc.) to their Starchild agent. All operations go through the Composio Gateway (), which handles auth and API key management.
composio-gateway.fly.devComposio支持用户将1000+外部应用(Gmail、Slack、GitHub、Google日历、Notion等)连接到他们的Starchild Agent。所有操作都通过Composio网关()进行,由网关负责处理身份验证和API密钥管理。
composio-gateway.fly.devArchitecture
架构
Agent (Fly 6PN network)
↓ HTTP (auto-authenticated by IPv6)
Composio Gateway (composio-gateway.fly.dev)
↓ Composio SDK
Composio Cloud → Target API (Gmail, Slack, etc.)- You never touch the COMPOSIO_API_KEY — the gateway holds it
- You never call Composio SDK directly — use the gateway HTTP API
- Authentication is automatic — your Fly 6PN IPv6 resolves to a user_id via the billing DB
- No env vars needed — the gateway is always accessible from any agent container
Agent (Fly 6PN network)
↓ HTTP (auto-authenticated by IPv6)
Composio Gateway (composio-gateway.fly.dev)
↓ Composio SDK
Composio Cloud → Target API (Gmail, Slack, etc.)- 你完全不需要接触COMPOSIO_API_KEY——由网关保管
- 你不需要直接调用Composio SDK——使用网关的HTTP API即可
- 身份认证自动完成——你的Fly 6PN IPv6地址会通过计费数据库关联到对应的user_id
- 无需配置环境变量——所有Agent容器都可以直接访问网关
When to Use Composio
何时使用Composio
Use this skill when the user wants to:
- Send/read emails (Gmail, Outlook)
- Manage calendar (Google Calendar, Outlook Calendar)
- Interact with code repos (GitHub, GitLab)
- Send messages (Slack, Discord, Telegram)
- Manage documents (Notion, Google Docs)
- Any external SaaS integration
How to know if a user has connections: Check the system prompt — it includes a section listing active app connections. If the section is absent or empty, the user has no connections yet.
## Composio Connections当用户需要执行以下操作时使用该技能:
- 发送/读取邮件(Gmail、Outlook)
- 管理日历(Google日历、Outlook日历)
- 与代码仓库交互(GitHub、GitLab)
- 发送消息(Slack、Discord、Telegram)
- 管理文档(Notion、Google Docs)
- 任何外部SaaS集成需求
如何判断用户是否已有连接? 查看系统提示——其中包含部分,列出了已激活的应用连接。如果该部分不存在或为空,说明用户还没有任何连接。
## Composio ConnectionsGateway Base URL
网关基础URL
GATEWAY = "http://composio-gateway.flycast"All requests use plain HTTP over Fly internal network (flycast). No JWT needed — the gateway identifies the agent by its 6PN IPv6 address.
GATEWAY = "http://composio-gateway.flycast"所有请求都通过**Fly内部网络的纯HTTP协议(flycast)**发起。不需要JWT——网关通过Agent的6PN IPv6地址识别身份。
API Reference
API参考
1. List User's Connections
1. 列出用户的连接
Check what apps the user has already connected.
bash
curl -s http://composio-gateway.flycast/internal/connections | python3 -m json.toolResponse:
json
{
"user_id": "554",
"connections": [
{"id": "ca_xxx", "toolkit": "gmail", "status": "ACTIVE", "created_at": "2025-03-19..."}
]
}查看用户已经连接的应用。
bash
curl -s http://composio-gateway.flycast/internal/connections | python3 -m json.tool响应:
json
{
"user_id": "554",
"connections": [
{"id": "ca_xxx", "toolkit": "gmail", "status": "ACTIVE", "created_at": "2025-03-19..."}
]
}2. Search Tools
2. 搜索工具
Find the right tool slug for a task using natural language.
bash
curl -s -X POST http://composio-gateway.flycast/internal/search \
-H "Content-Type: application/json" \
-d '{"query": "send email via gmail"}' | python3 -m json.tool通过自然语言找到对应任务的工具slug。
bash
curl -s -X POST http://composio-gateway.flycast/internal/search \
-H "Content-Type: application/json" \
-d '{"query": "send email via gmail"}' | python3 -m json.tool3. Execute a Tool
3. 执行工具
Execute a Composio tool on behalf of the user.
bash
curl -s -X POST http://composio-gateway.flycast/internal/execute \
-H "Content-Type: application/json" \
-d '{"tool": "GMAIL_SEND_EMAIL", "arguments": {"to": "x@example.com", "subject": "Hi", "body": "Hello!"}}' \
| python3 -m json.toolResponse:
json
{"data": {"messages": [...]}, "error": null}代表用户执行指定的Composio工具。
bash
curl -s -X POST http://composio-gateway.flycast/internal/execute \
-H "Content-Type: application/json" \
-d '{"tool": "GMAIL_SEND_EMAIL", "arguments": {"to": "x@example.com", "subject": "Hi", "body": "Hello!"}}' \
| python3 -m json.tool响应:
json
{"data": {"messages": [...]}, "error": null}4. Initiate New Connection
4. 初始化新连接
When the user wants to connect a new app.
bash
curl -s -X POST http://composio-gateway.flycast/api/connect \
-H "Content-Type: application/json" \
-d '{"toolkit": "gmail"}' | python3 -m json.toolResponse:
json
{"connect_url": "https://connect.composio.dev/link/lk_xxx", "connection_id": "ca_xxx"}Give to the user — they click it to complete OAuth.
connect_url当用户需要连接新应用时使用。
bash
curl -s -X POST http://composio-gateway.flycast/api/connect \
-H "Content-Type: application/json" \
-d '{"toolkit": "gmail"}' | python3 -m json.tool响应:
json
{"connect_url": "https://connect.composio.dev/link/lk_xxx", "connection_id": "ca_xxx"}将提供给用户——用户点击链接即可完成OAuth授权。
connect_url5. Disconnect (Delete) a Connection
5. 断开(删除)连接
bash
curl -s -X DELETE http://composio-gateway.flycast/api/connections/{connection_id} \
| python3 -m json.toolResponse:
json
{"status": "disconnected", "connection_id": "ca_xxx"}bash
curl -s -X DELETE http://composio-gateway.flycast/api/connections/{connection_id} \
| python3 -m json.tool响应:
json
{"status": "disconnected", "connection_id": "ca_xxx"}6. List Available Toolkits
6. 列出可用工具集
bash
curl -s http://composio-gateway.flycast/api/toolkits?limit=200 | python3 -m json.toolbash
curl -s http://composio-gateway.flycast/api/toolkits?limit=200 | python3 -m json.toolWorkflows
工作流程
User wants to use an app (e.g. "send an email")
用户想要使用某个应用(例如“发送邮件”)
- Check system prompt for section
## Composio Connections - If Gmail is listed → skip to step 5
- If not connected → call with
/api/connect{"toolkit": "gmail"} - Give the user the link. Wait for them to confirm they've authorized.
connect_url - Call with
/internal/searchto find the right tool slug{"query": "send email gmail"} - Call with the tool slug and arguments
/internal/execute
- 检查系统提示中的部分
## Composio Connections - 如果Gmail已在列表中 → 直接跳到第5步
- 如果未连接 → 调用接口,传入参数
/api/connect{"toolkit": "gmail"} - 将链接提供给用户,等待用户确认已完成授权
connect_url - 调用接口,传入参数
/internal/search找到对应的工具slug{"query": "send email gmail"} - 调用接口,传入工具slug和对应的参数
/internal/execute
User asks "what apps can I connect?"
用户询问“我可以连接哪些应用?”
- Call to get the full list
/api/toolkits - Present a curated summary (there are 1000+, so filter to popular ones)
- 调用接口获取完整列表
/api/toolkits - 向用户展示筛选后的精选列表(总共有1000+个,所以优先展示热门应用)
User asks "what apps do I have connected?"
用户询问“我已经连接了哪些应用?”
- Call
/internal/connections - Show the list with status
- 调用接口
/internal/connections - 向用户展示带状态的连接列表
Common Tool Slugs
常用工具slug
| App | Tool | Description |
|---|---|---|
| Gmail | | Send an email |
| Gmail | | Fetch recent emails |
| Gmail | | Get a specific email |
| Google Calendar | | List events |
| Google Calendar | | Create an event |
| GitHub | | Create an issue |
| GitHub | | List repositories |
| Slack | | Send a message |
| Notion | | Create a page |
When unsure of tool slug, always use first — it supports semantic search.
/internal/search| 应用 | 工具 | 描述 |
|---|---|---|
| Gmail | | 发送邮件 |
| Gmail | | 获取最近的邮件 |
| Gmail | | 获取指定邮件 |
| Google Calendar | | 列出日程 |
| Google Calendar | | 创建日程 |
| GitHub | | 创建Issue |
| GitHub | | 列出仓库 |
| Slack | | 发送消息 |
| Notion | | 创建页面 |
如果不确定工具slug,优先使用接口——它支持语义搜索。
/internal/searchImportant Notes
重要注意事项
- Tool slugs are UPPERCASE: ,
GMAIL_SEND_EMAILGITHUB_CREATE_ISSUE - Toolkit slugs are lowercase: ,
gmail,githubslack - Errors from Composio are returned as — show the error to the user
{"data": null, "error": "..."} - OAuth tokens are managed by Composio — they auto-refresh expired tokens
- Data flows through Composio cloud — be mindful of sensitive data
- 工具slug为全大写格式:、
GMAIL_SEND_EMAILGITHUB_CREATE_ISSUE - 工具集slug为全小写格式:、
gmail、githubslack - Composio返回的错误格式为——请将错误信息展示给用户
{"data": null, "error": "..."} - OAuth令牌由Composio管理——过期令牌会自动刷新
- 数据会经过Composio云——处理敏感数据时请注意