Why model choice is an engineering decision
Picking a model is like picking an instance size in the cloud. The biggest one always works, but you pay for it on every request and your users wait for it. The smallest one is cheap and quick, but it may get your task wrong. The job is to find the smallest model that reliably does your task. You find it by measuring on your own prompts, not by reading leaderboards.
You weigh four things:
- Quality: does it get your task right, every time?
- Latency: how long the user waits for the answer.
- Context window: how much text fits into one request.
- Price: dollars per million tokens, charged separately for input and output.
Step 1: See what your project can actually call
The public model list and your project's access are not always the same thing. Ask the API directly, using the key setup from Level 1 (OPENAI_API_KEY in your environment, never in code):
# list_models.py: pip install openai
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY from the environment
for m in client.models.list(): # GET /v1/models
if m.id.startswith("gpt-"): # skip embeddings, audio, etc.
print(m.id, m.owned_by, getattr(m, "shutdown_date", None))
// list_models.mjs: npm install openai
import OpenAI from "openai";
const client = new OpenAI();
for await (const m of client.models.list()) {
if (m.id.startsWith("gpt-")) console.log(m.id, m.owned_by);
}
Gotcha: each model object gives you only an
id, acreatedtimestamp,owned_by, and ashutdown_date(null if no shutdown has been announced). It does not give you the context window, modalities or price. You get those from each model's page and from the pricing page in OpenAI's developer docs.
Step 2: Read the spec sheet
Here are three current flagship models as listed in October 2026, plus one older model that has a dated snapshot. Standard tier, US dollars per 1M tokens:
| Model | Input | Cached input | Output | Context |
|---|---|---|---|---|
gpt-6-astra |
$10.00 | $1.00 | $50.00 | 1.05M |
gpt-6.1-sol |
$2.00 | $0.10 | $10.00 | 1.05M |
gpt-6-luna |
$0.10 | $0.01 | $0.50 | 1.05M |
gpt-5.4-2026-03-05 |
$2.50 | $0.25 | $15.00 | 1.05M |
All four take text and image input and return text. Astra costs 100× as much as Luna per token. That gap is the reason to measure before you choose.
Pitfalls on the pricing page: Output tokens cost about 5× as much as input tokens, so a model that writes long answers costs more than its input price suggests. Requests over 272K input tokens are billed at higher long-context rates. The Batch API costs 50% less (covered in a later level). These numbers will change. Treat this table as a dated snapshot and check the live page before you budget.
Step 3: Benchmark on your own prompt
Leaderboards measure someone else's task. Take a real prompt from your app, run it against two or three models, and record what happens. We call client.responses.create here and leave its details to Level 3.
# compare.py
import time
from openai import OpenAI
client = OpenAI()
# Prices per 1M tokens, copied from the pricing page. Write the date down!
PRICES = { # model: (input, output)
"gpt-6-luna": (0.10, 0.50),
"gpt-6.1-sol": (2.00, 10.00),
"gpt-5.4-2026-03-05": (2.50, 15.00),
}
PROMPT = ("A customer writes: 'I was charged twice for order 4471 and "
"your bot keeps closing my ticket.' Classify urgency "
"(low/medium/high) and draft a two-sentence reply.")
print(f"{'model':<22}{'secs':>6}{'in':>7}{'out':>7}{'reason':>8}{'cost