[翻译] 买了XAI用来做翻译API的,但是老是提示密钥错误怎么回事? 看全部

就是按照隔壁的贴子做的呀,总是提示401密钥错误!
401: { "error": { "message": "Incorrect API key provided: xai-iPzV************************************************************************nsOE. You can find your API key at https://platform.openai.com/account/api-keys.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" } }
  • 推荐 xayle
  • 前天 13:11
引用: 醉冷秋 发表于 2025-2-19 13:10
我看那个没改呀,后来我改了还是错误,也不知道咋回事!!!https://api.groq.com/openai/v1/chat/comple ...

你确定是 XAI?

https://api.x.ai/v1/chat/completions
You can find your API key at https://platform.openai.com/account/api-keys.
你的网址为什么是openai的,你不改吗
引用: zynzcl 发表于 2025-2-19 13:05
You can find your API key at https://platform.openai.com/account/api-keys.

我是用的XAI的呀,我看那个攻略也没有改接口地址呀,我后来改接口地址也是一样呀:https://api.groq.com/openai/v1/chat/completions  不知道为什么 晕
引用: 丿啦灬啦啦 发表于 2025-2-19 13:07
你的网址为什么是openai的,你不改吗

我看那个没改呀,后来我改了还是错误,也不知道咋回事!!!https://api.groq.com/openai/v1/chat/completions 改成这样提示:401: {"error":{"message":"Invalid API Key","type":"invalid_request_error","code":"invalid_api_key"}}
引用: 醉冷秋 发表于 2025-2-19 13:07
我是用的XAI的呀,我看那个攻略也没有改接口地址呀,我后来改接口地址也是一样呀:https://api.groq.com/ ...

你这改的什么?groq和grok完全不是一个东西,官方文档看一眼,api接口是https://api.x.ai/v1,大部分不需要填v1
引用: xayle 发表于 2025-2-19 13:11
你确定是 XAI?

https://api.x.ai/v1/chat/completions

搞定了 谢谢 ,靠 我是在那个帮助文档找的 晕 没注意看呀