ChatGPT API: where to get an OpenAI API key, and an OpenAI-compatible alternativeAn API for AI coding agents: one key, any OpenAI-compatible tool

ChatGPT API: where to get an OpenAI API key, and an OpenAI-compatible alternative

The ChatGPT API is the OpenAI API: a key, a base_url and a GPT model name. The key comes from OpenAI’s developer platform, not from ChatGPT itself, and a ChatGPT Plus subscription does not include it. Below: the official route, GPT-6 prices, an OpenAI-compatible route through Twelver and what chatgpt.com/api/auth/session is.

Short answer

Officially: platform.openai.com → API keys → Create new secret key, with credits topped up separately from any ChatGPT subscription. Base URL https://api.openai.com/v1, models gpt-6-luna and gpt-6-astra. Through Twelver: the gpt (GPT-6 Luna) and gpt-max (GPT-6 Astra) series, with a key issued on this page with no signup and no card.

GPT-6 models and OpenAI prices

ModelInputCached inputOutput
gpt-6-luna$0.10$0.01$0.50
gpt-6-astra$10$1$50
OpenAI prices per 1M tokens from the model cards. A prompt over 272K tokens bills the whole request at 2× input and 1.5× output.

GPT through Twelver

SeriesModel$ per 1M
gptGPT-6 Luna0.163 / 0.813
gpt-maxGPT-6 Astra16.25 / 81.25

Right here

Base URL and key for GPT

Your own values appear in the block and drop straight into the code below.

Press it and get your base_url and API key.

No sign-up, no card.

Free. Your key appears right here.

Template — this will not work as isgpt.pyThe highlighted parts are stand-ins. The button above issues them in seconds, no sign-up.
from openai import OpenAI

client = OpenAI(base_url="https://twelver.ru/api/ai/<your-config-id>/v1", api_key="sk-<your-key>")
reply = client.chat.completions.create(
    model="gpt",  # GPT-6 Luna; "gpt-max" for the hardest tasks
    messages=[{"role": "user", "content": "Where is my order 1024?"}],
)
print(reply.choices[0].message.content)

Work out what the requests cost

Pick a workload or type your own numbers — the calculator multiplies them by each series’ rates. A token is roughly 4 characters of English text or code.

gptGPT-6 Luna$6.51 per month
request: $0.00071,000 requests: $0.651
gpt-maxGPT-6 Astra$650 per month
request: $0.0651,000 requests: $65
autoQwen3.7-Plus$23.4 per month
request: $0.00231,000 requests: $2.34
zaiGLM-5.3$74.2 per month
request: $0.00741,000 requests: $7.42

Twelver rates as of 4 November 2026; tokens are billed as actually used, caching and discounts not included. The arithmetic runs in your browser.

The model itself: GPT-6 in Twelver. Agent setup: Cline, Kilo Code. Other models: DeepSeek API, Grok API. The whole book: API for AI agents.

Frequently asked questions

Where do I get a ChatGPT API key?
Not in ChatGPT itself but on OpenAI’s developer platform: platform.openai.com → API keys → Create new secret key, after topping up credits under Billing.
What is chatgpt.com/api/auth/session?
A service address of the ChatGPT web app that returns a short-lived session token for the signed-in user. It is not an API key, and OpenAI’s terms do not allow using it in third-party tools. A real key starts with sk- and is created on platform.openai.com.
Does ChatGPT Plus include the API?
No. The ChatGPT subscription and the API are billed separately: Plus covers the chat, the API is paid per token from prepaid credits.
Is there an OpenAI-compatible alternative?
Yes. Twelver serves GPT-6 Luna and Astra as the gpt and gpt-max series over an OpenAI-compatible API, with a key issued without signup or a card.

Try it yourself

Everything in this guide runs inside Twelver

One chat for text, images, video, music and voice — no separate services or subscriptions.

Open Twelver chat
Rate your experience