OpenAI API key: what it is and how it differs from ChatGPT
An API key is a secret string that tells the service who is calling and whose balance to charge for tokens. Here is how it differs from a ChatGPT account.
5 min · · API keys · development
When a tutorial says "paste your OpenAI API key", a beginner often thinks of the ChatGPT password. These are different things. An OpenAI API key is a string of characters that proves a request to the API came from you and that the service uses to charge for the tokens consumed. Let us see what it is, what it is for and how a gateway compatible with the OpenAI format works with it.
What an API key is
An API key is a secret identifier. You place it in a request header, the server finds your account by it, checks that the key is valid and the balance is positive, runs the request and records the spend. No login or password is sent at all.
OpenAI keys have a recognizable prefix (they start with sk-); a Zukko key has the prefix fetch_. The prefix lets you and leak scanners tell a key from a random string. A real key is long and unguessable: it cannot be brute-forced, but it can easily be copied from a public repository or a screenshot.
A key is a password to your money. Anyone who has it makes requests at your expense. Storage rules are in safe API key storage.
How a key differs from a ChatGPT account
| ChatGPT account | API key | |
|---|---|---|
| What it is | a site and app with a chat | access for programs |
| Who uses it | a person in a browser | your code, editor or bot |
| How you pay | a subscription under the service's plan | per token, as used |
| What is inside | a ready interface | only request and response |
The main consequence: a ChatGPT subscription does not include an API key. It is a separate product with a separate balance. If you pay for a subscription but a program asks for a key, the subscription will not help. We do not quote subscription prices, since they change; see the service's site. A money comparison of the two approaches: API or ChatGPT Plus subscription.
What you pay for with a key
You pay for tokens, the pieces of text into which the model splits a request and an answer. Input tokens (what you sent) and output tokens (what the model wrote) are counted separately. The price is in dollars per 1M tokens.
Example (Zukko prices as of 18 October 2026, model gpt-6.1-sol: input $0.27, output $1.32 per 1M). A request of 1,500 input tokens and 500 output tokens:
1,500 × 0.27 / 1,000,000 + 500 × 1.32 / 1,000,000 = $0.000405 + $0.00066 = $0.001065, about a tenth of a cent.
This is an illustrative calculation; the real numbers are in the usage field of the API response and on the "Usage" page in the dashboard.
What a request with a key looks like
The key goes in the Authorization header:
curl https://api.zukko.pro/v1/chat/completions \
-H "Authorization: Bearer fetch_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.1-sol",
"messages": [{"role": "user", "content": "What is an API key? Answer in two sentences."}]
}'The same in Python with the official openai library:
from openai import OpenAI
client = OpenAI(
base_url="https://api.zukko.pro/v1",
api_key="fetch_your_key",
)
response = client.chat.completions.create(
model="gpt-6.1-sol",
messages=[{"role": "user", "content": "What is an API key?"}],
)
print(response.choices[0].message.content)
print(response.usage)The library adds Bearer itself. The authorization methods are described in the documentation. Instead of arguments you can set the OPENAI_API_KEY and OPENAI_BASE_URL variables: then a bare OpenAI() picks them up and the key stays out of the code.
How a gateway key works
A key for an OpenAI-compatible gateway works on the same principle but has several convenient differences:
- One key, many models. A single
fetch_...key gives access to Claude, GPT, Gemini, DeepSeek, Qwen and GLM models. Any of them can be called in either the OpenAI or the Anthropic format. - A shared dollar balance. Top-ups start at $1, payment by SBP, MasterCard or crypto.
- Several keys. Each has a name, daily and monthly dollar limits and a list of allowed models (
allowed_models). A bot's key can be capped at five dollars a month and one cheap model. - The full key is shown once. Create it on the API keys page and save it at once in a password manager or an environment variable.
A gateway key cannot be "substituted" for a key on a provider's site: it works only at api.zukko.pro. An OpenAI key in turn will not open the gateway.
Common key errors
| Code | Meaning | What to do |
|---|---|---|
| 401 | the key is wrong or missing | check for a stray space or newline and that you use the gateway key |
| 402 | not enough money on the balance | top up the balance |
| 403 | the model is not allowed for this key (model_not_allowed_for_key) | add the model to allowed_models or use another key |
| 404 | unknown model name | check against GET /v1/models |
| 429 | the key's daily or monthly limit is exhausted, or the model provider is throttling | check the error code: raise the key's limit, wait for the next period or retry later |
The most frequent one is 401: usually a stray space got into the key or the program sends it to the wrong address.
What to do if a key leaks
Delete it in the dashboard at once and create a new one, then look at the spending history for the last hours. A step-by-step guide: an API key leaked. Set a daily limit in advance: then the damage from a leak is capped.
FAQ
Where do I get an OpenAI API key?
The official key is issued by OpenAI in its own console, and it sets the terms for getting and paying for it. A gateway key is created in the Zukko dashboard: access from Russia works through the gateway, with payment by SBP, MasterCard or crypto.
Is a key free?
The key itself costs nothing; you pay for tokens. Which free limits the official API has, check on the provider's site, we do not know them. In Zukko you top up the balance from $1.
Can one key be used in several programs?
Technically yes, but it is better to create a separate key for each: then you can see who spends how much, and a leak is easier to contain.
Will a gateway key work in libraries that ask for an OpenAI API key?
Yes, if the library lets you set base_url (https://api.zukko.pro/v1) and a key. If there is no such field, look for the OPENAI_BASE_URL environment variable or an "OpenAI-compatible API" setting.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- Your Own Neural Network Proxy on Node.js: Keep the API Key Off the FrontendA small Express server between your frontend and the model API: the key stays on the server, and models, request size and rate are capped.
- DeepSeek API in Python: Requests, Streaming, JSON and Error HandlingReady code for DeepSeek V4.1 Flash and V4 Pro on the OpenAI SDK: a request, streaming, JSON parsing and careful error handling.
- Gemini API in Python: requests via the OpenAI SDK and OpenAI formatA working Gemini API example in Python with no extra library: change base_url in the OpenAI SDK, add streaming and JSON, and compare with google-genai.
- Anthropic SDK for Python: base_url, key and a first request via a gatewayThe official anthropic package for Python just needs a different address. We cover base_url, the key, streaming, token counting, caching and errors.