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

Error 404 while using createChatCompletion #132

Closed
sandeepscet opened this issue Apr 5, 2023 · 3 comments
Closed

Error 404 while using createChatCompletion #132

sandeepscet opened this issue Apr 5, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@sandeepscet
Copy link

Describe the bug

Error

{
    "error": {
        "message": "Invalid URL (POST /v1/chat/completions)",
        "type": "invalid_request_error",
        "param": null,
        "code": null
    }
}

To Reproduce

Use the Below Snippet, I Facing an issue while calling API from the browser.

Code snippets

const configuration = new Configuration({
    apiKey,
  })
  const openai = new OpenAIApi(configuration)

const completion = await openai.createChatCompletion({
      model: engine,
      messages: [{ role: 'user', content: prompt }],
    })

OS

Window 10

Node version

v18.14.2

Library version

^3.2.1

@sandeepscet sandeepscet added the bug Something isn't working label Apr 5, 2023
@kevinohara80
Copy link

Same issue here.

@based64-eth
Copy link

Is this library not maintained anymore?

@melvinmt
Copy link

I was also experiencing the 404 error until I realized I was using the wrong model. You need to use a chat compatible model, like gpt-3.5-turbo.

This worked for me:

const response = await openai.createChatCompletion({
        model: "gpt-3.5-turbo",
        messages: [{ role: 'user', content: prompt }],
        temperature: 0,
        max_tokens: 500,
      });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants