OpenAI API on one key
OpenAI’s GPT models, the family behind ChatGPT, through the MegaBrain API. It is OpenAI-compatible: the official SDK, LangChain and Codex work once you change the base URL and the key. Pay per token from a prepaid US-dollar balance; the same key opens Claude, Gemini and image and video models.
OpenAI models and prices
Prices in US dollars per 1M tokens, from the MegaBrain catalogue; they update automatically.
| Model | Input | Output | Context |
|---|---|---|---|
| GPT-6.1 Sol openai/gpt-6.1-sol | $0.72 | $3.6 | 1.1M |
| GPT-6 Astra openai/gpt-6-astra | $3.36 | $17 | 1.1M |
| GPT-6.1 Terra openai/gpt-6.1-terra | $0.36 | $1.8 | 1.1M |
| GPT-6.2 Astra openai/gpt-6.2-astra | $2.88 | $14 | 1.1M |
| GPT-6 Luna openai/gpt-6-luna | $0.12 | $0.6 | 1.1M |
| GPT-6 Sol openai/gpt-6-sol | $0.72 | $3.6 | 1.1M |
| GPT-5.6 Luna openai/gpt-5.6-luna | $0.07 | $0.4 | 1.1M |
| GPT-5.6 Terra openai/gpt-5.6-terra | $0.67 | $4.03 | 1.1M |
| GPT-5.6 Sol openai/gpt-5.6-sol | $1.68 | $10 | 1.1M |
| GPT-5.5 Pro openai/gpt-5.5-pro | $36 | $216 | 1.1M |
Codex at about a third of the price
GPT-6.1 Sol and GPT-6.2 Astra cost about a third per token on MegaBrain of what the official OpenAI API charges. The setup script adds MegaBrain to ~/.codex/config.toml as a model provider, so Codex runs on your key without a ChatGPT plan.
One-command setup for Codex and other agentsChatGPT API and OpenAI API
ChatGPT is OpenAI’s chat app. Developers reach the GPT models through the OpenAI API, which is what people search for as the “ChatGPT API”. Through MegaBrain you use the OpenAI models in the table with a MegaBrain key; no OpenAI platform account is needed.
Switching from api.openai.com
Replace the base URL https://api.openai.com/v1 with https://getmegabrain.com/api/gateway/v1, the key with your MegaBrain key, and set model to an id from the table: they start with openai/.
First request
The API is OpenAI-compatible: the official SDK, LangChain and any client with a base URL field work. Create the key on the API key page after you sign up.
from openai import OpenAI
client = OpenAI(
base_url="https://getmegabrain.com/api/gateway/v1",
api_key="YOUR_MEGABRAIN_KEY",
)
response = client.chat.completions.create(
model="openai/gpt-6.1-sol",
messages=[{"role": "user", "content": "Hello! What can you do?"}],
)
print(response.choices[0].message.content)Questions and answers
Do I need an OpenAI account to use GPT models?
No. Sign up on MegaBrain, top up the balance by card and create a key. It works with the OpenAI models and with every other model in the catalogue.
How are requests paid for?
From a prepaid balance in US dollars, for the tokens actually used: input and output separately, at the price per 1M tokens in the table. No subscription is needed: top up by card and pay as you go.
Which OpenAI endpoints are supported?
Chat Completions (with streaming), the Responses API and Embeddings, at https://getmegabrain.com/api/gateway/v1. GET /models lists the catalogue with prices and context windows.
Does Codex work?
Yes. Codex CLI connects to MegaBrain as a custom provider: the config.toml settings and model choice are in the Codex guide in MegaBrain University.
Can I try it for free?
Yes. The model mb-auto/free (Auto Free) is free and works without an API key or sign-up: each request goes to a free model available at that moment, with a limit per IP address. The paid models in the table need an account and a balance.
Get your API key
Sign-up is open. Create an account, top up the balance by card and create a key: it works for every text, image, video and audio model in the catalogue. Credits never expire.
Questions? Write to team@getmegabrain.com