[GH-ISSUE #21] 使用kiro api报错400 #19

Closed
opened 2026-02-27 07:17:25 +03:00 by kerem · 8 comments
Owner

Originally created by @kingjh on GitHub (Aug 6, 2025).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/21

输入:
curl http://localhost:3000/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer 123456"
-d '{
"model": "claude-sonnet-4-20250514",
"messages": [
{"role": "system", "content": "你是一只名叫 Neko 的猫。"},
{"role": "user", "content": "你好,你叫什么名字?"}
]
}'

返回:
{"error":{"message":"Client error (400): Request failed with status code 400","code":400,"suggestions":["Check your request format and parameters"],"details":"<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>The plain HTTP request was sent to curl http://localhost:3000/healthn</html>\r\n"}}

请问应该如何解决?

Originally created by @kingjh on GitHub (Aug 6, 2025). Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/21 输入: curl http://localhost:3000/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer 123456" \ -d '{ "model": "claude-sonnet-4-20250514", "messages": [ {"role": "system", "content": "你是一只名叫 Neko 的猫。"}, {"role": "user", "content": "你好,你叫什么名字?"} ] }' 返回: `{"error":{"message":"Client error (400): Request failed with status code 400","code":400,"suggestions":["Check your request format and parameters"],"details":"<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>The plain HTTP request was sent to curl http://localhost:3000/healthn</html>\r\n"}}` 请问应该如何解决?
kerem closed this issue 2026-02-27 07:17:26 +03:00
Author
Owner

@justlovemaki commented on GitHub (Aug 7, 2025):

同样的问题 #11
需要不设置https_proxy, 或者代码里增加proxy=false

<!-- gh-comment-id:3162294922 --> @justlovemaki commented on GitHub (Aug 7, 2025): 同样的问题 #11 需要不设置https_proxy, 或者代码里增加proxy=false
Author
Owner

@kingjh commented on GitHub (Aug 7, 2025):

谢谢,在src/claude/claude-kiro.js的axios.create加上proxy: false就行了

       this.axiosInstance = axios.create({
            timeout: KIRO_CONSTANTS.AXIOS_TIMEOUT,
            headers: {
                'Content-Type': KIRO_CONSTANTS.CONTENT_TYPE_JSON,
                'x-amz-user-agent': `aws-sdk-js/1.0.7 KiroIDE-0.1.25-${macSha256}`,
                'user-agent': `aws-sdk-js/1.0.7 ua/2.1 os/win32#10.0.26100 lang/js md/nodejs#20.16.0 api/codewhispererstreaming#1.0.7 m/E KiroIDE-0.1.25-${macSha256}`,
                'amz-sdk-request': 'attempt=1; max=1',
                'x-amzn-kiro-agent-mode': 'vibe',
                'Accept': KIRO_CONSTANTS.ACCEPT_JSON,
            },
            proxy: false // <-- 新增这行
        });
<!-- gh-comment-id:3164575322 --> @kingjh commented on GitHub (Aug 7, 2025): 谢谢,在src/claude/claude-kiro.js的axios.create加上proxy: false就行了 ``` this.axiosInstance = axios.create({ timeout: KIRO_CONSTANTS.AXIOS_TIMEOUT, headers: { 'Content-Type': KIRO_CONSTANTS.CONTENT_TYPE_JSON, 'x-amz-user-agent': `aws-sdk-js/1.0.7 KiroIDE-0.1.25-${macSha256}`, 'user-agent': `aws-sdk-js/1.0.7 ua/2.1 os/win32#10.0.26100 lang/js md/nodejs#20.16.0 api/codewhispererstreaming#1.0.7 m/E KiroIDE-0.1.25-${macSha256}`, 'amz-sdk-request': 'attempt=1; max=1', 'x-amzn-kiro-agent-mode': 'vibe', 'Accept': KIRO_CONSTANTS.ACCEPT_JSON, }, proxy: false // <-- 新增这行 }); ```
Author
Owner

@justlovemaki commented on GitHub (Aug 7, 2025):

只设置http_proxy,不设置https_proxy试过吗?

<!-- gh-comment-id:3164689252 --> @justlovemaki commented on GitHub (Aug 7, 2025): 只设置http_proxy,不设置https_proxy试过吗?
Author
Owner

@kingjh commented on GitHub (Aug 7, 2025):

只设置http_proxy,不设置https_proxy试过吗?
试过不行

然后现在是refresh token时候报错400了,应该还要在哪里禁用代理?
Image

<!-- gh-comment-id:3164743100 --> @kingjh commented on GitHub (Aug 7, 2025): > 只设置http_proxy,不设置https_proxy试过吗? 试过不行 然后现在是refresh token时候报错400了,应该还要在哪里禁用代理? <img width="1704" height="1143" alt="Image" src="https://github.com/user-attachments/assets/a42900c1-95c4-45ad-a633-c71e2e82267a" />
Author
Owner

@justlovemaki commented on GitHub (Aug 7, 2025):

你咋有三个client_id配置文件,保留你token对应的那个,把其它的移出去。

<!-- gh-comment-id:3164821510 --> @justlovemaki commented on GitHub (Aug 7, 2025): 你咋有三个client_id配置文件,保留你token对应的那个,把其它的移出去。
Author
Owner

@kingjh commented on GitHub (Aug 7, 2025):

删去其他配置文件+把http_proxy去掉后,报错429,是否因为aws账号没开通kiro?

Image
<!-- gh-comment-id:3164958760 --> @kingjh commented on GitHub (Aug 7, 2025): 删去其他配置文件+把http_proxy去掉后,报错429,是否因为aws账号没开通kiro? <img width="1095" height="405" alt="Image" src="https://github.com/user-attachments/assets/2bf1bad3-d183-4e19-adff-32ef9cf283a7" />
Author
Owner

@kingjh commented on GitHub (Aug 7, 2025):

看到返回了Kiro temporarily paused new builderId users at this time -_-
Image

<!-- gh-comment-id:3165054231 --> @kingjh commented on GitHub (Aug 7, 2025): 看到返回了Kiro temporarily paused new builderId users at this time -_- <img width="1719" height="444" alt="Image" src="https://github.com/user-attachments/assets/f203923e-bf5f-4764-b7ac-36cea15a0085" />
Author
Owner

@justlovemaki commented on GitHub (Aug 8, 2025):

@kingjh kiro新注册的不能用,刚出的那段时间注册的号可以用,而且要开始收费了

<!-- gh-comment-id:3166415504 --> @justlovemaki commented on GitHub (Aug 8, 2025): @kingjh kiro新注册的不能用,刚出的那段时间注册的号可以用,而且要开始收费了
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AIClient-2-API-justlovemaki#19
No description provided.