The OpenAI embeddings endpoint does not randomly “break” dimensions , the behavior changed because new embedding models introduced configurable output sizes and different default vector lengths.
Before in the old model
Text-embedded-ada-020 always would return 1536 dimensions
In the new model which was introduced in 2024
Text-embedded-3-small =default 1536 dimensions
Text-embedded-3-large = default 3072 dimensions
OpenAI added the dimension parameter
Now you can explicitly shorten the embeddings
Json
{
"model": "text-embedding-3-large",
"input": "hello world",
"dimensions": 1024
}
This means now the same output can return 1536,3072,1024,512 dimensions etc
I hope this helps .