In short
An API key isn't issued in the chat: it lives in a separate console with a separate balance. That's why people can't find it in ChatGPT settings: the subscription and the API are different products.
Getting a key directly from OpenAI runs into a foreign card requirement at the billing step. Through altrouter you get a key in a minute, top up your balance with a Russian bank card, SBP (Russia's Faster Payments System) or crypto, and your code stays the same: the openai library with a different base_url and api_key.
On cost: a typical request on gpt-5.2 costs less than a cent, and about twice as much on gpt-5.6-pro. The table and the math are below.
Where to find the API key and why it isn't in the chat
The most common dead end looks like this: someone pays for ChatGPT Plus, goes to settings for a key — and doesn't find one. It will never show up there. Keys are issued in a separate console, platform.openai.com, with a separate balance and separate billing: you've paid for Plus, but you still haven't paid a cent for the API.
Hence searches like "where to get a chatgpt api key" and "where to find my chatgpt api key": people look for the key where it isn't and can't be.
What exactly you pay for in each case, and at what volume a key comes out cheaper than $20 a month, is a separate calculation. This article is only about the key: where to get it, what it costs and how to plug it into your code.
The second common question is "chatgpt api key free" and "chatgpt free api". OpenAI has no free API. Tokens always cost money. Search results promising "free openai api keys" lead either to someone else's leaked keys (someone else's money and someone else's liability) or nowhere.
And third: if all you need is a chat, get the subscription — you don't need the API. You need the API when the model has to work inside your product: a support bot, processing incoming requests, generating descriptions, parsing documents.
How much the ChatGPT API costs
Pricing is per 1M tokens, separately for input (your request) and output (the model's response). Output costs roughly 6–8 times more than input.
| Model | Input, $/1M | Output, $/1M | Context | Discount |
|---|---|---|---|---|
| gpt-5.6-mini | 0.85 | 5.10 | 400K | −15% |
| gpt-5.2 | 1.40 | 11.20 | 400K | −20% |
| gpt-5.4 | 1.49 | 12.75 | 400K | −15% |
| gpt-5.6 | 2.13 | 12.75 | 400K | −15% |
| gpt-5.5 | 4.16 | 25.50 | 400K | −15% |
| gpt-5.6-pro | 4.25 | 25.50 | 400K | −15% |
These are altrouter prices: they're lower than the official ones, and the discount differs from model to model. Prices change, so the source of truth is the model catalog, not this article. The gpt-5.6 page shows the current numbers and parameters.
Now the answer to "gpt api price" in units you can picture. A typical request is 2,000 input tokens and 500 output tokens:
gpt-5.6-mini: 0.002 × 0.85 + 0.0005 × 5.10 = $0.0043gpt-5.2: 0.002 × 1.40 + 0.0005 × 11.20 = $0.0084gpt-5.6: 0.002 × 2.13 + 0.0005 × 12.75 = $0.0107gpt-5.6-pro: 0.002 × 4.25 + 0.0005 × 25.50 = $0.0213
In other words, on gpt-5.2 a $20 budget buys about 2,400 of these requests.
Which model to pick
gpt-5.6-mini— the cheapest row in the lineup. Bulk processing, classification, short answers that follow instructions.gpt-5.2— a sensible default and the biggest discount in the table (−20%).gpt-5.6— the current generation. Use it when 5.2 starts missing.gpt-5.5andgpt-5.6-pro— twice as expensive on input. Reach for them deliberately, for tasks where a mistake costs more than the tokens.
The context is the same for all of them: 400K tokens.
How to get a ChatGPT API key from Russia
The direct route through platform.openai.com hits a wall at payment: you need a foreign card. No amount of care during signup helps — the wall is specifically the card at the billing step. Hence searches like "buy chatgpt api" and "chatgpt api accounts": buying someone else's account means using someone else's key, which gets revoked together with your balance.
Through altrouter you get your own key and your own balance, paid with a Russian bank card, SBP or crypto:
- Sign up: /login?mode=signup — Google, Telegram or email. Through @altrouter_bot it's a single step.
- Create a key in your dashboard. It looks like
ar-.... - Confirm your Telegram — that adds $1 to your balance. That's about a hundred requests to
gpt-5.2, enough to check everything before you pay. - Put the key and base URL into your code.
How to pass the key is covered in the authentication docs. The same key opens not only GPT but also Anthropic and Google models — switching between them takes one line of code.
Working Python example
Our API is OpenAI-compatible, so you use the same openai library you'd use with OpenAI directly. Two fields change — base_url and api_key:
from openai import OpenAI client = OpenAI( base_url="https://api.altrouter.ai/v1", api_key="ar-...", ) r = client.chat.completions.create( model="gpt-5.2", messages=[{"role": "user", "content": "Hello"}], ) print(r.choices[0].message.content)
If you already have code written for OpenAI, the migration is these two lines. Everything else (temperature, max_tokens, message roles, streaming) works as it did before.
Keep the key in an environment variable, not in the repository: api_key=os.environ["ALTROUTER_KEY"]. A key leaked to a public git repo gets picked up by automated scanners within hours.
The same goes for JS — the openai library, the same two fields.
What the API actually has
So you don't waste time on things that don't exist, here's an honest list of endpoints:
POST /v1/chat/completions— text, the main workhorse endpointPOST /v1/images/generations— images (images docs); OpenAI'sgpt-image-2model costs $0.037 per imagePOST /v1/videos— video, asynchronous: create a job and poll its status (OpenAI has no video models, but the endpoint is shared)GET /v1/models— the model list
What we don't have: embeddings, TTS/STT, a files API, assistants and batch. If your use case depends on them, go to OpenAI directly.
Token-by-token streaming is in the streaming docs, parameters in the API reference, error codes and what to do about them in the errors docs, and limits in the limits docs.
How not to burn through your budget
Three things worth doing before your code goes to production:
- Set
max_tokensexplicitly. Output is the most expensive part of the bill. If you don't pass the parameter, we substitute 4096: that protects you from a request that accidentally eats your budget, but don't rely on it as a setting — set your own value. - Don't send extra context. The full conversation history in every request is input you pay for again on every call.
- Start with a cheap model. Take 20 real requests, run them on
gpt-5.2and see where it breaks. If nothing breaks, you've saved money. You can compare models in the playground in your dashboard without writing a single line of code.
Spend per key is visible in the dashboard logs, broken down by model, so "where did the money go" won't be a mystery.
Summary
The ChatGPT API is tokens and HTTP: your own key, your own balance, payment for actual usage. It starts at $0.85 per million input tokens on gpt-5.6-mini, you get a key in a minute, the starting $1 for a confirmed Telegram lets you test your idea before paying, and you don't need a foreign card.
All OpenAI models in the catalog are on the OpenAI provider page; current prices are in the model catalog.
FAQ
How is an altrouter key different from an OpenAI API key?
How much does the ChatGPT API cost?
From $0.85 per 1M input tokens for GPT-5.6 Luna to $4.25 for GPT-5.6 Sol; output tokens cost about six times more than input tokens. Models in the family have a 400,000-token context. Generating an image with GPT Image 2 costs $0.037. The full price list is on the OpenAI provider page.
How do I get a ChatGPT API key from Russia?
Directly with OpenAI, signup and payment run into the list of supported countries. Through a Russian gateway the key is issued right away, you pay in rubles, and two fields change in your code — base_url and api_key; the rest of your request logic stays the same.
Will my code written for the OpenAI API work?
Yes, if it uses the openai library or plain HTTP requests to /v1/chat/completions. Two fields change — base_url and api_key; temperature, max_tokens, message roles and streaming work as they did before. Not available: embeddings, TTS/STT, a files API, assistants and batch.
How do I avoid overspending on the ChatGPT API?
Three things give almost all the savings: pick a model for the task rather than the strongest one; cap max_tokens explicitly, because output tokens cost more than input tokens; and trim the conversation history that gets sent to the server again with every request.