405 error constantly (gpt-4)

Upon attempting to utilize GPT-4 for the generation of specific outcomes, I consistently encounter a 405 response. This was exemplified when I tried to fetch chili recipes. Conversely, shorter phrases or inquiries such as how are you? execute without a hitch. I’m at a loss to comprehend this disparity in results and would appreciate guidance in rectifying this matter. Incidentally, my scripts are developed in Python, and I can provide the code for perusal if it aids resolution.

1 Like


Could you post a code snippet of your API call and any supporting setup code that it relies upon please?


_contents["main_2"] += f"Feel free to utilize the subsequent search results to enrich your response when necessary. In scenarios where the yielded results indicate multiple subjects sharing identical names, endeavor to articulate distinct answers for each subject. The cue for these search results derives from the user's prompt: {ddg.get_results(prompt)}"
response = openai.ChatCompletion.create(
                    "role": "system",
                    "name": "Mesa",
                    "content": _contents["main_2"].replace("<cur_time>", self.cur_time),
                {"role": "user", "content": prompt},
            ]  ,
response = response.choices[0].message["content"]
 return response

What version of the OpenAI API do you currently have installed?

1 Like

I believe its the latest version, I could be wrong.

Worth doing a check and upgrading any libs and dependencies, was speaking to another developer today who had a versioning issue. Error 405 is a liitle odd though, as it suggests you are trying to pass something incorrectly… is there any openai lib specific setup done prior to this code?

Ah yes, I’m not using the standard OpenAI base. I’m using a custom one, this could be an issue on their side.

1 Like

Ok, sounds like you have a place to start digging, hopefully the rabbit hole is not too deep! Feel free to get back with any updates/issues you find along the way.

1 Like

Yes, I contacted the developer of the base im using. He is planning on checking this issue out, the thing is that this only occurs with GPT-4. The other models work fine like GPT-3.5-TURBO, etc.

I should also mention something, I get another error:

if "internal_message" in error_data:
TypeError: argument of type 'bool' is not iterable

where are you getting your openai package from? like in your package.json or whatever

1 Like

I should close this, the error was fixed. The error was with the custom base I was using, and it just got fixed not too long ago so I’m no longer experiencing this error.