Error 500 with gpt-3.5-turbo second day in a row


I’m getting from gpt-3.5-turbo error 500 for the second day in a row. At the same time, I can see on Openai status monitor that all services should be operational. Does anyone have similar issues? I have contacted Openai Help bot, but haven’t got any help.

Error: 500: OpenAI API error: The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at if you keep seeing this error. (Please include the request ID 37b1bdf62430adf46a53058e48db1481 in your email.)

If you post your code you used to make your API call, we can help you identify what the problem is, @deepscreener


Thanks for questioning my own code! The code worked fine before I changed stop: “” to stop:“\n”. Now I changed it back to stop: “” and it works again. By documentation both are fine. Weird!


In 95 percent of the issues posted here, it’s generally a developer error.

It’s beta code, as you know, so it’s best to test and test again.


1 Like

Thanks, indeed it was the “stop” key that caused the error on the server side.
The error handling on the OpenAI side should be clearer :confused:

1 Like

I have been encountering same error 500 from this morning : this is route.ts file in chat folder for chatting with gpt-3.5-turbo :

import { auth } from "@clerk/nextjs";
import { NextResponse } from "next/server";
import { Configuration, OpenAIApi } from  "openai";

const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
const openai = new OpenAIApi(configuration);

export async function POST(req: Request) {
    try {
        const { userId } = auth();
        const body = await req.json();
        const { messages } = body;

        if (!userId) {
            return new NextResponse("Unauthorized", { status: 401 });


        if (!configuration) {
            return new NextResponse("OpenAI API key not configured", { status: 500})

         if (!messages) {
            return new NextResponse("Messages are Required", { status: 400 })
        const response = await openai.createChatCompletion({
            model: "gpt-3.5-turbo",
            return NextResponse.json([0].message);

    } catch (error) {
        console.log("[CHAT_ERROR]", error);
        return new NextResponse("Internal server error", { status: 500})

If anyone can help please reply…

In your code you are returning error 500 if the API is not correctly configured. is the API key valid if you print it to console as a test?

Yes the api key is showing in the console.[quote=“Foxabilo, post:7, topic:90658, full:true”]
In your code you are returning error 500 if the API is not correctly configured. is the API key valid if you print it to console as a test?

I think what he is saying, is that you are coding any captured error to be “500” - and also returning number that look like, but aren’t, connection errors.

You’d want to get the actual http error and message, and compare if it’s the real error 500:

500 - The server had an error while processing your request Cause: Issue on our servers.
Solution: Retry your request after a brief wait and contact us if the issue persists. Check the status page.