Neural network API
How to get an OpenAI API key: the official path and alternatives
You create an OpenAI API key in the OpenAI developer console, and only from a country on the supported list. As of 16 October 2026, Russia is not on that list, and OpenAI may block an account for access from other countries. Below is the official path for a legal entity in a supported country, the rules for storing the key and the options for a company in Russia. We give no instructions for getting around the rules.
In short: the answer as of the check date
As of 16 October 2026, the order is: account, project, key in the dashboard, then payment for working limits. Russia and Belarus are not on the OpenAI API country list, so a company from Russia cannot officially get a key.
If the company has a legal entity or a branch in a listed country, the key is registered to it. If not, the practical path is different: an open model with the same request format as OpenAI. The code barely changes with such a switch.
- Account: sign up in the OpenAI developer console from a supported country.
- Key: created in the dashboard, inside a project.
- Payment: payment details in the billing section, then a bill based on actual use.
- Storage: an environment variable or a secrets store on the server.
The official path: account, payment, key
The order is described in the OpenAI Quickstart guide as of 16 October 2026. First you create a key in the dashboard, then you save it in the OPENAI_API_KEY environment variable. The OpenAI libraries read the key from this variable themselves, so you do not write it in the code.
The guide calls the first test request free. For real work you need a balance: by the OpenAI limits page, the Free tier is available only in allowed countries, and the first paid tier, Build, opens after you buy $5 of credits.
OpenAI charges for actual use (pay-as-you-go). The price is counted in tokens, separately for input and output. You can compare the rates of different models in the API price comparison and estimate the monthly bill in the cloud API calculator.
A company should set up two projects: a test one and a production one. OpenAI recommends this split and lets you set separate request and spending limits for each project.
If you have several organizations or projects, the request names the right ones in the OpenAI-Organization and OpenAI-Project headers. The cost of such a request is booked to that organization and project, so you can see which system spends how much.
By OpenAI data as of 16 October 2026, API requests are not used for training by default, abuse monitoring logs are kept for up to 30 days, and zero retention is given only on approval. The provider’s models and terms are on the page about the OpenAI API.
How to store the key
An API key is a secret. OpenAI itself says so in the API reference: do not share it with others and do not put it in code that runs in a browser or an app. The key is loaded on the server from an environment variable or from a key management service.
A company with several developers has organization-level settings. An admin can allow only service account keys, cap the maximum key lifetime or block new keys. Organization limits always override project settings.
The OpenAI production guide adds a few rules. They are simple, and each one closes its own leak path:
- Do not keep the key in code or in public repositories.
- Set an expiry date when you create a project key: OpenAI recommends this directly.
- Rotate the key in order: create a new one, switch the apps over, revoke the old one.
- Turn on spending alerts and a hard limit: when the limit is reached, OpenAI stops the requests.
- One key per system: a CRM, a bot and a website with separate keys are easier to switch off one at a time.
Why you should not buy someone else’s key
A bought key always belongs to the seller’s organization. There are four reasons not to buy one, and each follows from the OpenAI documents as of 16 October 2026.
There is a fifth reason, from practice. On 2 May 2023, Samsung banned generative AI for its staff after engineers uploaded internal source code to ChatGPT. Through a seller’s key, your texts go where you control neither the access nor the logs.
- Terms: OpenAI calls the key a secret that must not be shared. The seller has already broken this rule.
- Blocking: access from countries outside the list, or giving such access, can end with the account blocked. The key may stop working any day, together with the paid balance.
- Control: the organization owner revokes the key. They can issue a new key and revoke the old one at any moment, and your system will stop.
- Data: requests go through the seller’s account, and logs of up to 30 days are kept at OpenAI as data of the seller’s organization. The contract with OpenAI is not with you.
If your company is in Russia
The first honest path: a legal entity or branch of the company in a country on the OpenAI list registers the key with its own details and its own payment. The OpenAI terms are met, and responsibility for the data is clear.
The second path: an open model. As of 16 October 2026, DeepSeek and Qwen in Alibaba Cloud accept requests in the OpenAI format, and you can run open weights on your own servers or in your own data center. How to choose an option for your task and volume is covered on the page about buying AI model APIs.
Before you choose, answer three questions: do the requests contain clients’ personal data, how many requests a month do you expect, and do you need an OpenAI model in particular or will any model of the right quality do. The answers narrow the choice at once.
We help with both paths: connecting an official company account where OpenAI works, or choosing an open model by testing it on your requests. We do not resell OpenAI access.
Questions and answers
Where do I find my OpenAI API key?
Can I buy a ready-made API key?
What happens if the key leaks?
Sources and dates
- OpenAI, Supported countries and territories, checked 16 October 2026developers.openai.com
- OpenAI, Developer quickstart, checked 16 October 2026developers.openai.com
- OpenAI, API reference: Authentication, checked 16 October 2026developers.openai.com
- OpenAI, Production best practices, checked 16 October 2026developers.openai.com
- OpenAI, Rate limits: usage tiers, checked 16 October 2026developers.openai.com
- OpenAI, Your data, checked 16 October 2026developers.openai.com
- DeepSeek API Docs, checked 16 October 2026api-docs.deepseek.com
- Alibaba Cloud Model Studio, OpenAI compatibility, checked 16 October 2026help.aliyun.com
- Bloomberg, 02.05.2023bloomberg.com