➕ 添加 Kiro (Amazon Q) 账号
SSO Token
AWS IAM Identity Center
OIDC
Builder ID / GitHub / Google
Bearer Token
直接使用 Access Token
📖 如何获取 Kiro Token?
Kiro Token 位于配置文件中,路径取决于操作系统:
Windows:
%APPDATA%\Code\User\globalStorage\amazon.q-for-vscode\sso\token_cache.json
macOS:
~/Library/Application Support/Code/User/globalStorage/amazon.q-for-vscode/sso/token_cache.json
Linux:
~/.config/Code/User/globalStorage/amazon.q-for-vscode/sso/token_cache.json
打开文件后,查找 accessToken 或 ssoToken 字段
📖 Kiro API 使用说明
1. 流式对话
curl https://your-worker.workers.dev/kiro/api/v1/streaming-conversations \
-H "Content-Type: application/json" \
-d '{
"conversationState": {
"currentMessage": {
"userInputMessage": {
"content": "Hello, how are you?"
}
},
"chatTriggerType": "MANUAL"
}
}'
2. 在代码中使用
// 使用 Kiro API
const response = await fetch(
'https://your-worker.workers.dev/kiro/api/v1/streaming-conversations',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
conversationState: {
currentMessage: {
userInputMessage: { content: 'Your question here' }
},
chatTriggerType: 'MANUAL'
}
})
}
);
3. 可用端点
/kiro/api/v1/streaming-conversations - 流式对话
/kiro/api/v1/conversations - 对话列表
/kiro/api/v1/generate-plan - 生成计划
/kiro/api/v1/generate-code-snippet - 生成代码片段
/kiro/api/v1/models - 可用模型列表