Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI API: API errors have wrong HTTP code #57

Open
lucasavila00 opened this issue Mar 13, 2024 · 3 comments
Open

OpenAI API: API errors have wrong HTTP code #57

lucasavila00 opened this issue Mar 13, 2024 · 3 comments

Comments

@lucasavila00
Copy link

Using a model that does not exist returns HTTP status 200, but the error message is in the JSON

@lucasavila00 lucasavila00 changed the title API errors have wrong HTTP code OpenAI API: API errors have wrong HTTP code Mar 13, 2024
@alpayariyak
Copy link
Contributor

Are you using the endpoint regularly or through openai compatibility?

@alpayariyak
Copy link
Contributor

@lucasavila00

@lucasavila00
Copy link
Author

Open AI Compatibility:

$ curl -i https://api.runpod.ai/v2/yyyyy/openai/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxx" -d '{
"model": "a model that does not exist",
"messages": [
  {
    "role": "user",
    "content": "Why is RunPod the best platform?"
  }
],
"temperature": 0,
"max_tokens": 100
}'


HTTP/2 200 
date: Thu, 21 Mar 2024 01:29:58 GMT
content-type: application/json; charset=utf-8
content-length: 133
cf-cache-status: DYNAMIC
set-cookie: __cflb=zzzzz; SameSite=None; Secure; path=/; expires=Fri, 22-Mar-24 00:29:58 GMT; HttpOnly
server: cloudflare
cf-ray: uuuu-GRU

{"code":404,"message":"The model `a model that does not exist` does not exist.","object":"error","param":null,"type":"NotFoundError"}

Notice the HTTP/2 200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants