OpenAI API: what it is, which endpoints exist and why the format became a standard
An API lets your code call a model instead of a person typing in a chat. A look at requests, responses and why the OpenAI format is used far beyond the company itself.
4 min · · API keys · development
If you are asking what the OpenAI API is, the short answer is this: it is an HTTP interface through which your program sends text to a model and receives a reply. ChatGPT is a ready-made application for people, while the API is a set of addresses and rules for developers. The OpenAI request format turned out to be so convenient that many gateways, editors and libraries replicate it. Below we look inside and show working examples. Prices are as of October 18, 2026.
API versus ChatGPT
| ChatGPT | OpenAI API | |
|---|---|---|
| Who it is for | people, a chat window | programs and developers |
| How you pay | a subscription on the service | per token, as you use it |
| What you get | a dialogue in an interface | JSON with the reply and a token counter |
| Control | interface settings | request parameters, system prompt, tools |
Subscription terms and prices change, so check the current plan on the service's own site. For a developer something else matters: the API is paid only for the tokens used, so you pay for real requests, not for a month of access.
The main endpoints
The OpenAI format has several addresses, and three of them you will meet constantly. All are available under the base address https://api.zukko.pro/v1:
POST /v1/chat/completionsis the classic chat. You send a list of messages with the rolessystem,user,assistantand receive a reply. Reference: Chat Completions.POST /v1/responsesis a newer interface where the input is set in aninputfield. The differences are described in the article responses or chat completions.GET /v1/modelsis the list of models available to your key.
OpenAI itself has other groups of methods too. Which of them a given gateway supports is stated in its documentation; for text tasks the three above are usually enough.
The first request
With curl:
curl https://api.zukko.pro/v1/chat/completions \
-H "Authorization: Bearer $ZUKKO_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.1-sol",
"messages": [
{"role": "system", "content": "Answer briefly."},
{"role": "user", "content": "What is HTTP status 404?"}
]
}'The reply is JSON. What you need from it is choices[0].message.content (the text) and usage (how many tokens went to input and output, which determine the price).
With the Python openai library:
from openai import OpenAI
client = OpenAI(base_url="https://api.zukko.pro/v1", api_key="fetch_your_key")
r = client.chat.completions.create(
model="gpt-6.1-sol",
messages=[
{"role": "system", "content": "Answer briefly."},
{"role": "user", "content": "What is HTTP status 404?"},
],
)
print(r.choices[0].message.content)
print(r.usage.prompt_tokens, r.usage.completion_tokens)The same request through /v1/responses:
r = client.responses.create(
model="gpt-6.1-sol",
input="What is HTTP status 404? Answer briefly.",
)
print(r.output_text)Listing models:
for m in client.models.list():
print(m.id)Streaming the reply
To make text appear as it is generated, add stream=True. In a stream the server always sends a last chunk with usage data and an empty choices list, so a check is needed before reading choices[0]:
stream = client.chat.completions.create(
model="gpt-6.1-sol",
messages=[{"role": "user", "content": "Tell me about HTTP status codes"}],
stream=True,
)
for chunk in stream:
if chunk.choices:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)Why this format became a standard
The reason is practical, not technical. First, libraries, editors and frameworks learned to speak exactly this language. Then a network effect kicked in: it is easier for each new tool to support an already common format, and it is more profitable for each model provider to replicate it so that existing programs work without rewriting.
For you this means freedom of choice. In the client it is enough to change two values: base_url and the key. The code stays the same, and the model is chosen with a string in the model field. So one program can work with models from different companies. Cursor, Cline, Kilo Code, Codex, LangChain, LibreChat, Open WebUI and many others rely on this compatibility. More on the concept itself: OpenAI compatible API: what it is.
Any Zukko model can be called in both the OpenAI format and the Anthropic format (/v1/messages). One limitation: for Claude the cache discount comes from the Anthropic format specifically, while in the OpenAI format all Claude input is billed at the input price.
Getting access from Russia
For the terms of direct access to OpenAI services in your country and the payment methods, check the company's own site. An alternative is access from Russia through the Zukko gateway, paying by SBP (the payment page adds an 8.5% fee on top), a MasterCard, or cryptocurrency. You create a fetch_... key in the dashboard, put it in together with the base_url, and use the models listed in GET /v1/models. A step-by-step start is in the quick start.
What a request costs
Example: a request with 1000 input tokens and 500 output tokens to gpt-6.1-sol, prices as of October 18, 2026: 0.27 for input and 1.32 for output per 1M tokens:
1000 × 0.27 / 1,000,000 + 500 × 1.32 / 1,000,000 = 0.00027 + 0.00066 = $0.00093.
A thousand such requests cost about $0.93. Current prices and models are at GET /v1/models or on the "Models" page in the dashboard.
FAQ
What is the OpenAI API in simple terms?
It is a set of internet addresses where a program sends a request with text and receives a model's reply. Instead of a chat window you have code and parameters.
Do I need a ChatGPT subscription to use the API?
They are different ways of paying. The API is paid per token and does not require a subscription to the app. Check the terms of the subscription itself on the service's site.
What does "OpenAI-compatible" mean?
The service accepts requests in the same format: the same addresses, fields and the Authorization: Bearer header. So programs written for OpenAI work with it after you change base_url and the key.
Can Claude models be called through this format?
Yes. Any model in the catalog can be called in the OpenAI format, but the discounted Claude cache works in the Anthropic format. For ordinary requests without large repeated contexts you will not notice a difference.
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.