Chatgpt API url问题:Chatgpt3.5错误

szqfcxe2  于 2023-06-06  发布在  其他
关注(0)|答案(1)|浏览(342)

我试着使用openai的API,但它不工作。
是卷发

curl https://api.openai.com/v1/chat/completions \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $OPENAI_API_KEY" \
 -d '{
        "model": "gpt-3.5-turbo",
        "messages": [
           {"role": "system", "content": "You are a helpful assistant"},
           {"role": "user", "content": "Who won the world series in 2020?"},
           {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
           {"role": "user", "content": "Where was it played?"}
        ]
     }'

这就是结果。

{
    "error": {
        "message": "This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?",
        "type": "invalid_request_error",
        "param": "model",
        "code": null
    }
}

我看了OpenAI文档,URL是正确的。但没有通过。
谢谢你的帮助!

ctrmrzij

ctrmrzij1#

可能是账户问题
我还遇到了一个问题,gpt-3.5-turbo不能使用。而且文本avinci-003返回的结果很奇怪。我和我的朋友在官网的“Playground”页面上使用相同的“提示”、型号和参数进行了测试,我返回的结果很奇怪,而他的却很正常。所以我推测是账户问题。我开了一个新的帐户,并尝试后,它可以正常使用。

相关问题