How to create OpenAI keys?
Getting API keys
Open AI Account creation
To use OpenAI through API, you must create a free account and generate keys. Fortunately, it is pretty straightforward.
1. Sign up here https://platform.openai.com/signup. You can use your Google or Microsoft account to sign up if you don't want to create using an email/password combination. You may need a valid mobile number to verify your account.
2. After signing up for ChatGPT, visit this page https://openai.com/api/ and click on "Start Building."
3. Now you will reach your account's default project, OpenAI Playground. On this page, you need to click on the API keys located in the left bar section.
Permissions and Ownership
- Project vs. Organization Owners: Only owners of an organization can create projects. Project owners can then create API keys specific to that project.
- Default Project: Every organization has a default project that cannot be configured for limits or renamed. API keys are automatically created for new users and service accounts within the default project.
4. Later on, you reach the API page and select the "Create New Secret Key" option. Then, you can choose the type of OpenAI API key you want. You can select permissions, whether you want it to be restricted (read-only), and also the project for which you want the API key. You can also switch to a service account if you want to create your API key in a service account. However, you need to have a service account ID to create an API key in a service account.
4. Based on your preferences, select the option. Then click on "Create Secret Key," and you will be done. Make sure to copy the ID to a folder on your computer if you frequently use your OpenAI API key. Otherwise, it will be a hassle to go through the OpenAI account every time you need to copy your OpenAI API key.
Create a new project
If you want to create a new project, you can go to your organisation settings. You can locate the project you want to create an API key for and navigate to its settings. Alternatively, you can click on the default project option on your Open API key page, and you will get the option to create a new project. Give a name to your project, and your new project is done.
Additional Considerations
- Service Accounts: Organizations and project owners can create service accounts for programmatic access. These accounts have unique API keys managed separately from user accounts.
- Project Limits: Organizations can set billing and usage limits at the organization level, which will cascade down to projects. Project owners can further restrict these limits within their projects.
Open AI Usage Limits
Rate limits control how often you can access OpenAI's services within a specific time frame. They help maintain the service's stability and ensure fair access for all users.
How Open AI Rate Limits Work
Rate limits are measured in various ways:
- Requests Per Minute (RPM)
- Requests Per Day (RPD)
- Tokens Per Minute (TPM)
- Tokens Per Day (TPD)
- Images Per Minute (IPM)
These limits apply at both the organization and project levels. They vary depending on the model being used and the usage tier of your account.
Usage Tiers and Limits
As you use the OpenAI API more, your usage tier can increase, giving you higher limits. Here’s a breakdown of the different tiers:
Tier | Qualification | Usage Limit |
Free | Allowed geography | $100 / month |
Tier 1 | $5 paid | $100 / month |
Tier 2 | $50 paid, 7+ days | $500 / month |
Tier 3 | $100 paid, 7+ days | $1,000 / month |
Tier 4 | $250 paid, 14+ days | $5,000 / month |
Tier 5 | $1,000 paid, 30+ days | $50,000 / month |
Open AI Free Tier Rate Limits
Model | RPM | RPD | TPM | Batch Queue Limit |
GPT-3.5-turbo | 3 | 200 | 40,000 | 200,000 |
text-embedding-3-large | 3,000 | 200 | 1,000,000 | 3,000,000 |
text-embedding-3-small | 3,000 | 200 | 1,000,000 | 3,000,000 |
text-embedding-ada-002 | 3,000 | 200 | 1,000,000 | 3,000,000 |
whisper-1 | 3 | 200 | - | - |
tts-1 | 3 | 200 | - | - |
dall-e-2 | 5 mg/min | - | - | - |
dall-e-3 | 1 mg/min | - | - | - |
Open AI Tier 1 Rate Limits
Model | RPM | RPD | TPM | Batch Queue Limit |
GPT-4o | 500 | - | 30,000 | 90,000 |
gpt-4-turbo | 500 | - | 30,000 | 90,000 |
GPT-4 | 500 | 10,000 | 10,000 | 100,000 |
GPT-3.5-turbo | 3,500 | 10,000 | 60,000 | 200,000 |
text-embedding-3-large | 3,000 | - | 1,000,000 | 3,000,000 |
text-embedding-3-small | 3,000 | - | 1,000,000 | 3,000,000 |
text-embedding-ada-002 | 3,000 | - | 1,000,000 | 3,000,000 |
whisper-1 | 50 | - | - | - |
tts-1 | 50 | - | - | - |
dall-e-2 | 5 mg/min | - | - | - |
dall-e-3 | 5 mg/min | - | - | - |
Open AI Higher Tiers Usage Limits
For higher tiers (2-5), the limits increase progressively. Here are some example limits for Tier 5
Model | RPM | TPM | Batch Queue Limit | Batch Queue Limit |
GPT-4o | 10,000 | 22,000,000 | 4,000,000,000 | 90,000 |
GPT-4-turbo | 10,000 | 2,000,000 | 300,000,000 | 90,000 |
GPT-4 | 10,000 | 1,000,000 | 150,000,000 | 100,000 |
GPT-3.5-turbo | 10,000 | 15,000,000 | 2,250,000,000 | 200,000 |
text-embedding-3-large | 10,000 | 10,000,000 | 4,000,000,000 | 3,000,000 |
text-embedding-3-small | 10,000 | 10,000,000 | 4,000,000,000 | 3,000,000 |
text-embedding-ada-002 | 10,000 | 10,000,000 | 4,000,000,000 | 3,000,000 |
whisper-1 | 500 | - | - | - |
tts-1 | 500 | - | - | - |
dall-e-2 | 500 mg/min | - | - | - |
dall-e-3 | 200 mg/min | - | - | - |
Viewing and Managing Rate Limits
You can check your rate limits in the headers of the HTTP response or the limits section of your account settings. Key header fields include:
- x-ratelimit-limit-requests: Max requests allowed.
- x-ratelimit-limit-tokens: Max tokens allowed.
- x-ratelimit-remaining-requests: Remaining requests.
- x-ratelimit-remaining-tokens: Remaining tokens.
- x-ratelimit-reset-requests: Time until requests limit resets.
- x-ratelimit-reset-tokens: Time until tokens limit resets.
By understanding and managing these limits, you can make the most of the OpenAI API while ensuring a stable and fair environment for all users.
For more details check out our blog post