ai-pdf-chatbot-langchain: 404 Error from OpenAI using `gpt-4` modelName

When I set the modelName to gpt-4 in makechain.ts, I’m getting a 404 response from OpenAI. Snippets of the error message include:

response: { status: 404, statusText: ‘Not Found’ request: <ref *1> ClientRequest { _header: ‘POST /v1/chat/completions HTTP/1.1\r\n’ ‘Host: api.openai.com\r\n’ +
… isAxiosError: true

When I set the modelName to gpt-3.5-turbo everything works as expected. Doing a little digging, it appears the URL for gpt-4 may have recently changed.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17

Most upvoted comments

import os import openai openai.api_key = ‘’ openai.Model.list()

you can run this py script to see what models you have access to