I received an invitation to use GPT-4 API but it does not work

Hi,

I received the email from Open AI:

I am trying to access GPT-4 in the playground and via Colab, but it does not work.
Input:

openai.Completion.create(
  model="gpt-4",
  prompt="Say this is a test",
  max_tokens=7,
  temperature=0
)

Output:

---------------------------------------------------------------------------
RateLimitError                            Traceback (most recent call last)
<ipython-input-27-9f942d56575d> in <cell line: 1>()
----> 1 openai.Completion.create(
      2   model="gpt-4",
      3   prompt="Say this is a test",
      4   max_tokens=7,
      5   temperature=0

4 frames
/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py in _interpret_response_line(self, rbody, rcode, rheaders, stream)
    685         stream_error = stream and "error" in resp.data
    686         if stream_error or not 200 <= rcode < 300:
--> 687             raise self.handle_error_response(
    688                 rbody, rcode, resp.data, rheaders, stream_error=stream_error
    689             )

RateLimitError: You exceeded your current quota, please check your plan and billing details.

I checked all the documentation, but it was not helpful. So, how to start to use GPT-4 API in my case?

I hope you can help.
Thank you.

Hello! For 3.5-turbo and 4 models you have to use chatCompletion instead of completion, if I’m not wrong.

For example:

openai.ChatCompletion.create(
  model="gpt-4",
  messages=[
        { "role": "system", "content": "You are a helpful helper"},
        {"role": "user", "content": "Who won the world series in 2020?"},
        { "role": "helper", "content": "The Los Angeles Dodgers won the World Series in 2020."},
        { "role": "user", "content": "Where was it played?"}
    ]
)

You need the Org ID (with GPT-4 access granted).
The Org ID is delivered to your OpenAI account within 14 to 21 days after the invitation is received by email. But it seems it is taking longer for some these days.

Please check this thread for more details:
Unable to Access GPT-4 API Despite Receiving Invitation

That is the correct one :point_up_2: :point_up_2: :point_up_2:

Probably, you will not be satisfied with the information but - there is a procedure to check when the GPT-4 access is granted, and to use the access.

Hi

Thanks but it did not help.

Hi

Thanks.

What do you mean by “Please check this thread for more details:
I received an invitation to use GPT-4 API but it does not work

The link refers to my case.

Do you know whom to ask about when I will receive the Org ID (with GPT-4 access granted)?

Sorry, my bad, I copied the wrong link - let me find the correct thread and I’ll edit the message.

I don’t want to discourage anyone but the OpenAI support staff are really busy since February with the changes: GPT-4, plugins, etc. - so we are helping each other for some time now.
Probably someone will advise you to check help.openai.com but it is a Tier 1 support level with a Help bot - the bot doesn’t provide answers beyond the obvious one.

Sometimes… as you are the thread owner, you may request some Logan’s information in this way:

@logankilpatrick
please, advise about... (or whatever)

He is the staff member with more presence in the forum. But as he said once…

@logankilpatrick  doesn't live here

:sweat_smile:

1 Like

Thank you for your kind answer.

Via Organization settings - OpenAI API I can see my Organization ID for my Organization name which is called Personal.

I have only this account and it should not be associated with any other organization, just my personal account, but probably I indicated my university as an organization when registered – I do not think they have an OpenAI account. In Colab, I use this my Organization ID. Or?

What do you mean by these steps – can not get it:

  1. GPT-4 endpoint: ...v1/chat/completions - GPT-4 has a different endpoint from other models;
  2. Recommended: specify your organization in your API requests with the header: OpenAI-Organization;

As I understand regarding “there is a procedure to check when the GPT-4 access is granted, and to use the access”, I have gpt-4 option in Chat Mode in Playground. Is it what you mean by procedure?

Yes, then you have access to GPT-4. Suggestion: click on your avatar on that playground screen. It will show a drop-down menu with all organizations connected to your account - maybe you have multiple Org IDs and your university is there. Like this:


image
In this example rapidclaims is an OrgID connected to (J) personal account.
The GPT-4 access is granted to the OrgID, not to the account itself. You must select an OrgID (with GPT-4 access) in order to use the model.

When you post a chat completion, or develop a code:
GPT-4 models are only supported through the v1/chat/completions endpoint
Other models work with v1/completions. Like this:

In your code header, where you inserted the API key, before or after the key:
Some say: “You can specify your organization in your API requests with the header”: OpenAI-Organization
For others, the correct words are, and I recommend:
“you must specify your organization…” in that header.
OpenAI-Organization: your-org-id

Please, let me know the results.

Thank you.

No, I have only one account, namely Personal.

What is this tool? :arrow_down:

I use Python via Google Colab in my current setup. Specifying the organization like this:

Screenshot 2023-05-10 at 01.29.38

Postman, in dark mode - beautiful, isn’t it? - but it is not mine, it is from the example (J’s account). I am not an user, but if you want to test it postman has free sign up.
Postman

I may try your way - but I saw some codes with the example I gave you:
OpenAI-Organization: "your-org-id" or
OpenAI-Organization = "your-org-id"
I believe it is Metadata and it can be written in more than one way - it is optional, I recommend it in order for the API to verify that the organization has granted access to GPT-4 - so no doubts about it.

You can use the “listModels” interface and see if the result exists with “id === gpt-4”

Normally, after receiving the email, your api can be used. But you can use ‘listModels’ to prove it.

Yeah, it is very nice. Thanks.

How to have the same Postman environment?
Something like: OpenAI | Postman API Network?
J’s account?

Do you mean to do this or what?
Screenshot 2023-05-10 at 14.06.00

Hi

Thanks.

Could you please provide the exact code for how to “listModels”?

Like this:

I saw some codes with the example I gave you, in this way:
OpenAI-Organization: "your-org-id" or
OpenAI-Organization = "your-org-id"

example using curl:

curl https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "OpenAI-Organization: YOUR_ORG_ID_GOES_HERE"

or

--header 'Authorization: Bearer <My-API-key>' \
--header 'Content-Type: application/json' \
--header 'OpenAI-Organization: <My-org-ID>' \

I suggest you try - if you find an error in all of your tests - drop it - it is just a recommendation, it is not mandatory.

1 Like

Here is what I would suggest if I were you:

  1. Check the playground to see if GPT-4 is visible in Chat mode and make sure you are invited to it.
  2. If you can access it, use POSTMAN to run the sample on GPT-3.5-turbo to ensure that the API is working correctly and that you are using the correct API.
  3. If the sample runs smoothly on GPT-3.5-turbo, switch the model to GPT-4 and use POSTMAN to run the sample again.

For more information on using the OpenAI API, refer to the API Reference at OpenAI API.

If you suspect that something is not working as it should, be sure to check the OpenAI Status page at https://status.openai.com.

Once you have confirmed that everything is working correctly, you can focus on writing your code. If you need help with coding, ChatGPT is available to assist you.

Actually… the error message you provided looks like you need to open this help and support document. I hope you can solve the issue :slight_smile:

Error Code 429 - You exceeded your current quota, please check your plan and billing details. | OpenAI Help Center

This is correct. If you don’t have an org, you just need to change this.

Also if you were using free credits, check that you have a card added.

1 Like

If you don’t have an org, you just need to change this.

What do you mean?

Also if you were using free credits, check that you have a card added.

I have not used any credits. How? If I can not even connect to this API.

Never used any credits as was indicated in my initial message. I can not access GPT-4 API although it is visible in Chat mode.

I am a bit lost. Where exactly should I use curl?
I never used Postman so I do not know where to write what. Having this for now:

I use Python in Google Colab. Can you help me how to solve this issue with the incapability to access the GPT-4 API? I see GPT-4 in the Chat Playground. What next?