Model Meter — AI cost tracking
All posts
Data

What 1M OpenAI API Calls Actually Cost — A Breakdown by Model

By Jay Prajapat7 min read

Input tokens, output tokens, caching, and batch mode all move the number. Here's exactly what 1M calls costs across GPT-4o, GPT-4o-mini, GPT-4 Turbo, and GPT-3.5 — with worked examples.

Why the number varies so much

OpenAI charges separately for input tokens (what you send) and output tokens (what the model returns). Output tokens cost roughly 3–4× more per token than input. That ratio alone means that "1M calls" can span an order of magnitude in cost depending on your prompt and response lengths.

Three other factors compound this:

  • Prompt caching — OpenAI caches prompt prefixes after 1,024 tokens. Repeated prefixes (system prompts, few-shot examples, document context) are charged at 50% of the input rate for cached tokens.
  • Batch API — Asynchronous batch requests (results delivered within 24 hours) are priced at 50% of the synchronous rate for both input and output.
  • Context length — Longer conversations accumulate tokens. A 10-message chat with a 200-token system prompt and 150-token average turns is sending ~2,000 tokens of input on call 10, not 150.

Cost per model (October 2026)

Prices below are OpenAI's published per-token rates as of October 2026.

ModelInput ($/1M tokens)Output ($/1M tokens)Cached input ($/1M tokens)
GPT-4o$2.50$10.00$1.25
GPT-4o-mini$0.15$0.60$0.075
GPT-4 Turbo$10.00$30.00—
GPT-3.5 Turbo$0.50$1.50—

The GPT-4o to GPT-4o-mini ratio is roughly 16:1 on input and 17:1 on output. Most teams running high-frequency features (classification, summarization, extraction) on GPT-4o are significantly overpaying for those workloads.

1M calls: five worked scenarios

The only honest answer to "how much does 1M calls cost?" is: it depends on what each call looks like. Here are five realistic workload profiles:

ScenarioModelAvg input tokensAvg output tokensCost per call1M calls total
Support ticket classificationGPT-4o-mini40020$0.000072$72
Short summarizationGPT-4o-mini1,200150$0.00027$270
Structured JSON extractionGPT-4o800200$0.004$4,000
Long-context analysisGPT-4o8,000600$0.026$26,000
Code generationGPT-4o2,0001,500$0.020$20,000

Note: structured extraction at $4K and code generation at $20K both use GPT-4o. Most structured extraction workloads can migrate to GPT-4o-mini with equivalent accuracy — that's a ~16× cost reduction per call.

The hidden multipliers

Retries. A 2% error rate with exponential backoff means roughly 1.02 tokens consumed per successful token delivered. On high-volume endpoints this adds up, and retried calls still incur input token charges even on failure.

Context accumulation. Multi-turn chats grow their input token count with each turn. A conversation with a 500-token system prompt and 20-turn history sends 500 + (sum of all prior messages) as input. Call 20 in that conversation may cost 10–15× more than call 1.

Streaming overhead. Streaming responses arrive token-by-token, not as a batch. The cost is identical per token, but streaming often produces longer outputs because applications don't cut off at a word boundary — they render until the stream ends.

What this means for your project budget

A useful planning heuristic for ongoing AI features:

  1. Measure your average tokens-in and tokens-out on a sample of real calls (not prompt length — actual tokenizer output).
  2. Multiply by your model's per-token rate.
  3. Multiply by your expected daily call volume.
  4. Add 5–10% for retries and overhead.

The dangerous step teams skip is step 1. Using "about 500 tokens" because that's what the prompt looks like in a code editor consistently underestimates — especially once a system prompt is concatenated with retrieved context.

How to see your actual numbers

Estimates stop being estimates once you're measuring real traffic. Model Meter's SDK captures every OpenAI call's actual token counts, model name, and cost estimate — attributed to the project and operation that generated it.

import { init } from '@model-meter/sdk';

init({
  apiKey: process.env.MODEL_METER_API_KEY,
  endpoint: process.env.MODEL_METER_ENDPOINT,
  projectId: 'my-app',
  environment: 'production',
});

Every generateText() and streamText() call after that is captured automatically. The dashboard shows your real cost-per-call averages broken down by model, project, and operation — no more spreadsheet estimates.

Join the waitlist for launch pricing →

openaipricingcost-analysisgpt-4otokens

Launch offer

Lock in the best launch pricing.

Join the Waitlist