Project API Keys being rejected

Hi

My sk-proj key is being rejected by Dall-e

Any ideas?
Also how do I generate a normal sk- key as I only get sk-proj

1 Like

I am having the exact same issue right now

The type of keys that have been used by OpenAI for three years are now called “user keys”. To access them, you would, in your platform account owner user icon at upper-right, select “profile”.

It has been reported that on newly-created accounts, this third tab is just gone. Thus you are prevented from creating anything but a “default project” user key if you want a key with non-limited usage rights.

All new keys are extra-long, also.


“Rejected” doesn’t report much of what is happening. Nor does “me too”.

  • Were you able to use DALL-E 3 previously?
  • With the same API key?
  • Instead, are you making new call methods that have never been proven?
  • Have you prepaid to fund a new account, and can also use chat models?
  • Does “dall-e-3” show up in your “limits” so you can see the rate limit?

Use the error message returned by API to explore the possibilities.

2 Likes

hi @_j thanks so much for this, because i am going through this issue as well.

i am using bolt to test out an ai feature of chatting with openai (chatgpt) within the app am creating.

but it keeps say this :

please what do i do? i have already loaded the account with credits

Same problem here. I trie to use the embeddings endpoint.

from openai import OpenAI
client = OpenAI()

response = client.embeddings.create(
input=“Query text”,
model=“text-embedding-3-large”
)

print(response.data[0].embedding)

This throws an error: AuthenticationError: Error code: 401 - {‘error’: {‘message’: ‘Incorrect API key provided: [api-key] You can find your API key at https://platform.openai.com/account/api-keys.’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘invalid_api_key’}}

:

Any suggestions how to solve this?

1 Like

I’m having the same issue that my new sk-proj key is not working.

I was able to make requests after I’ve added my organisational ID before calling the API.

1 Like

Im getting the same thing - did you get it work?

Had the same issue!

on your console find your project id by clicking your user icon top right then ‘your profile’ then on left tab under project, click on general.

and api key also on left tab under project, click API keys, then create key.

Then in your application set them like this:
OPENAI_PROJECT_ID=proj_a**S
OPENAI_API_KEY=sk-proj-

Hope this helps, took me a while to figure it out, it’s not really outlined anywhere clearly except when you first create an API account I think. of how to connect but then disappears.

May the force be with you

Setting the environment variable for project should not be necessary if using a project API key. It is more likely to be something you forget about that later breaks your application.

The project header (and organization header also then required) which are inferred by the client from the correct environment variables, are more for specifying a project and where billing goes when using legacy user keys.

The SDK client will get its inernal variables:

    - `api_key` from `OPENAI_API_KEY`
    - `organization` from `OPENAI_ORG_ID`
    - `project` from `OPENAI_PROJECT_ID`

The headers to be sent in your own http calls:

  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "OpenAI-Organization: $ORG_ID_SOURCE" \
  -H "OpenAI-Project: $PROJECT_ID"
1 Like

Thank you _j, appreciate it!