Can't verify OpenAI API key, wrong model in curl request

In setting OpenAI key fails to verify. Curl request is asking for sonnet from OpenAI, clearly a bug. See curl request below. API key redacted (XXXX).

C:\Users\nebso>curl https://api.openai.com/v1/chat/completions -H “Content-Type: application/json” -H “Authorization: Bearer sk-None-XXXXXXXX” -d “{ "messages": [ { "role": "system", "content": "You are a test assistant." }, { "role": "user", "content": "Testing. Just say hi and nothing else." } ], "model": "claude-3.5-sonnet" }”
{
“error”: {
“message”: “The model claude-3.5-sonnet does not exist or you do not have access to it.”,
“type”: “invalid_request_error”,
“param”: null,
“code”: “model_not_found”
}
}

It looks like your request is asking for “model”: “claude-3.5-sonnet”. I suspect this is because the only model toggled on is claude-3.5-sonnet.

I would try toggling that off and ONLY toggling an openai model like gpt-4o on. This should change the model to gpt-4o in the request and fix the problem.

2 Likes

That did it for me!!! Thanks!!!