提供商如何连接
每个提供商都是一个受 OAuth 保护的服务,网关可以代理访问: 对于每个提供商,你需要在该提供商处注册一个 OAuth 应用(获取client_id 和 client_secret),然后添加到网关的 providers.json 中。
providers.json 格式
每个提供商需要 6 个字段:provider-id 是 Agent 在请求中使用的标识(如 athx proxy github GET /user)。
GitHub
- 前往 GitHub → Settings → Developer settings → OAuth Apps → New
- 将 Authorization callback URL 设为
https://your-gateway.com/ath/callback
athx proxy github GET /user
Google(日历、Gmail 等)
- 前往 Google Cloud Console → APIs & Services → Credentials
- 创建 OAuth 2.0 Client ID → Web application
- 添加重定向 URI:
https://your-gateway.com/ath/callback - 启用所需的 API(Calendar API、Gmail API 等)
athx proxy google-calendar GET /calendars/primary/events
Slack
- 前往 api.slack.com/apps → 创建新应用
- 在 OAuth & Permissions 下,添加重定向 URL:
https://your-gateway.com/ath/callback
任何 OAuth 2.0 提供商
如果服务支持标准 OAuth 2.0 Authorization Code 流程:多个提供商
直接全部添加到同一个providers.json 中: