Intermittent error: An unexpected error occurred: Error code: 400 - {'error': {'message': 'This model does not support specifying dimensions.', 'type': 'invalid_request_error', 'param': None, 'code': None}}

Hi everyone,

I am using the OpenAI API to generate query embeddings for my project. Everything was working fine until yesterday. Today, I’m encountering the following error:

An unexpected error occurred: Error code: 400 - {‘error’: {‘message’: ‘This model does not support specifying dimensions.’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}} API

The code is as simple as this:

def generate_embeddings(input: List[str]) -> List[List[float]]:

    response = client.embeddings.create(input=input, model="text-embedding-3-large", dimensions=256)

    embeddings = [i.embedding for i in response.data]
    return embeddings

What’s puzzling is that this error happens intermittently—around 1 in 10 times. The dimensions parameter is critical for us since our entire vector database is based on 256 dimensions.

I’ve already updated the OpenAI Python library to the latest version, but the issue persists. Does anyone have any ideas or insights on what might be causing this?

I have updated openai python library to latest version and the problem persists. Any ideas on this? I am hoping that it is a false alarm.

3 Likes

I am getting the same error, intermittently. This happens in production environment with no change to our backend. It seems that embeddings API just started throwing these errors.

1 Like

I’m getting the same error.

I’m getting the same error.

I am also getting this same error, also intermittently. This is causing significant issues to our production deployment.

Hi,

This is most likely a transient error that will resolve itself.

As best practice for all API communication, your code should gracefully handle all types of return error codes, and where appropriate perform exponential back off and retries.

If this issue persists for more than a day or two, please comment back here and I will let OpenAI know there is an issue.

Thanks for taking the time to flag this.

1 Like

Thanks for the reply. Hoping that it would resolve itself. We are handing the errors with retries as suggested in the documentation. So, it is not breaking things that much for us.

1 Like

Hi, while the errors may be transient and we have the normal retries and backoff in place, the sudden increase for multiple customers surely warrants an incident on https://status.openai.com/ ?

Also in what world is a 400 bad request a transient error?

2 Likes

I am also getting the same error - It is more prevalent and even after retries , there are multiple failures

1 Like

I am also getting the same error.

@Foxalabs How many retries and delays between them would you recommend?

Is there anyone from openai here who can respond? This seems like an incident to me

1 Like

Think you might have misunderstood the issue here @foxalabs.

General restful practice recommends not to retry 400s.


Now, with that said, openai often doesn’t follow restful practices, but even so this sudden increase in errors suggests a real problem with openai and not a transient error. It does not seem to be subsiding either.

EDIT:
I’ve reached the reply limit as I opened a forum account for this incident, however I have contacted OpenAI support directly who are now investigating.

2 Likes

All depends on the application, I usually have a retry max count of 10ish with an exponential backoff, i.e. it waits longer each time there is an error and after 10 attempts I log that as an actual error and put the request into a retry queue to try again as some point if relevant.

1 Like

@Foxalabs → How/why would a 400 error be a transient error? and/or why would you recommend retrying 400 errors in general? If it’s a 400, the server considers the error a client error, i.e. retrying after a 400 should never work unless you were to change the payload.

3 Likes

Also getting the same error - This is happening ~80% of the time for us.
We are using in a production service. We don’t really have the ability to wait multiple days to see if it ‘resolves itself’.

3 Likes

I’ve passed this to OpenAI to investigate.

Thanks for all of your time to report this.

6 Likes

I was having this issue as well in my environments. I can confirm it has been resolved as of 20-30 minutes ago.

Hi folks,

Just got an update from OpenAI, this should now be fixed!

2 Likes

I can confirm this error is still persistent. It is returning a 400 error around 9/10 tries.