curl --request POST \
--url https://zeus-api.agentspro.cn/api/tools/oauth/exchange \
--header 'Content-Type: application/json' \
--data '{
"provider": "github",
"code": "abc123def456",
"redirect_uri": "https://zeus.agentspro.cn/oauth/callback"
}'
{
"access_token": "gho_xxxxxxxxxxxx",
"refresh_token": null,
"expires_at": null,
"token_type": "Bearer"
}
Tools API
OAuth 令牌交换
用授权码交换 OAuth 访问令牌
POST
/
api
/
tools
/
oauth
/
exchange
curl --request POST \
--url https://zeus-api.agentspro.cn/api/tools/oauth/exchange \
--header 'Content-Type: application/json' \
--data '{
"provider": "github",
"code": "abc123def456",
"redirect_uri": "https://zeus.agentspro.cn/oauth/callback"
}'
{
"access_token": "gho_xxxxxxxxxxxx",
"refresh_token": null,
"expires_at": null,
"token_type": "Bearer"
}
用 OAuth 授权码交换访问令牌。此接口不需要 JWT 认证,因为是在 OAuth 回调流程中使用。
支持的 Provider
| Provider | 说明 | 环境变量 |
|---|---|---|
github | GitHub OAuth | GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET |
google_drive | Google Drive | GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET |
gmail | Gmail | GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET |
slack | Slack | SLACK_CLIENT_ID / SLACK_CLIENT_SECRET |
notion | Notion | NOTION_CLIENT_ID / NOTION_CLIENT_SECRET |
curl --request POST \
--url https://zeus-api.agentspro.cn/api/tools/oauth/exchange \
--header 'Content-Type: application/json' \
--data '{
"provider": "github",
"code": "abc123def456",
"redirect_uri": "https://zeus.agentspro.cn/oauth/callback"
}'
{
"access_token": "gho_xxxxxxxxxxxx",
"refresh_token": null,
"expires_at": null,
"token_type": "Bearer"
}