403 from embeddings API despite paid account + configured limits - SOLVED using inappropriate model

I’m getting a 403 to the embeddings API, this despite:

  1. Having a paid account
  2. Creating a non-default project and configuring model limits
  3. Only one API key: a project key for my non-default project
  4. Being in the “User1” tier

This has been frustrating so I hope there’s a simple explanation for what I’m seeing.

Using the list-models endpoint, I see the following models, which is what I expect:

{
  "object": "list",
  "data": [
    {
      "id": "gpt-4o",
      "object": "model",
      "created": 1715367049,
      "owned_by": "system"
    },
    {
      "id": "gpt-4o-2024-05-13",
      "object": "model",
      "created": 1715368132,
      "owned_by": "system"
    },
    {
      "id": "gpt-4o-mini-2024-07-18",
      "object": "model",
      "created": 1721172717,
      "owned_by": "system"
    },
    {
      "id": "gpt-4o-mini",
      "object": "model",
      "created": 1721172741,
      "owned_by": "system"
    }
  ]
}

But when I attempt an embeddings call with one of the allowed models, using the same auth token/project key:
POST Body:

{
  "input": "Blah",
  "model": "gpt-4o",
}

Response is a 403:

{
  "error": {
    "message": "You are not allowed to generate embeddings from this model",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

Welcome to the Forum!

gpt-4o is indeed not intended for embeddings - it’s a chat completions model. For generating embeddings you have the choice among the following three models, all of which can be accessed under Tier 1:

Model Description Output Dimension
text-embedding-3-large Most capable embedding model for both english and non-english tasks 3,072
text-embedding-3-small Increased performance over 2nd generation ada embedding model 1,536
text-embedding-ada-002 Most capable 2nd generation embedding model, replacing 16 first generation models 1,536

The detailed API specs for embeddings models are available here.

1 Like

Ah-hah! Newbie error.

:man_facepalming:

THANK YOU!

1 Like

No worries. Happens to the best! :wink:

In my defense, a 403 (and that error message) is not the most helpful error in this scenario, but that’s probably something I should have figured out.

Thanks again!

1 Like

I will say this API seems squirrley (technical term). After repeated calls from various clients using the same API key and model (text-embedding-3-large) to the embeddings API

Bruno gives me 200s
Curl gives me a mix of 200 and 403:

{
    "error": {
        "message": "Project `proj_qGWHlze5FmF2Xv5IISYIVlM6` does not have access to model `text-embedding-3-large`",
        "type": "invalid_request_error",
        "param": null,
        "code": "model_not_found"
    }
}

And my Go code is giving me 401s.

So it seems there’s some kind of eventual consistency happening behind the scenes.

Things seem to have “settled down” and back on the road to success :+1:

1 Like