prompt-optimizer icon indicating copy to clipboard operation
prompt-optimizer copied to clipboard

401 Authorization Required

Open zhjgit opened this issue 5 months ago • 1 comments

docker 拉取镜像启动,访问是 401 Authorization Required , api都配置了

zhjgit avatar Jun 19 '25 08:06 zhjgit

可能是apikey的问题,可以参考如下的命令或找个llm客户端工具测试apikey的有效性。 如果apikey是有效的,那可以使用浏览器的开发者模式看实际发出的请求中携带的apikey是否正确。

curl --location --request POST 'https://api.siliconflow.cn/v1/chat/completions' \
--header 'Authorization: Bearer 你的apikey' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "Qwen/Qwen2.5-7B-Instruct",
    "messages": [
              { "role": "system", "content": "你是chatgpt" },
        {
            "role": "user",
            "content": "你好"
        }
    ]
}'

linshenkx avatar Jun 20 '25 01:06 linshenkx