# Monthly Real AI API Cost & Hidden-Token Benchmark (OpenAI vs Gemini)

> **Status: Awaiting First Lab Run — Reproducible Harness Ready.** No live OpenAI or Gemini API benchmark run has been committed yet. Zero synthetic token, latency, or pass-rate figures are published on this page.

- **Canonical URL:** https://costpicks.com/benchmarks/ai-api-real-cost-benchmark
- **Reproducible Runner:** `scripts/run-ai-cost-benchmark.ts`
- **Dry-Run Verification (0 API calls):** `npm run benchmark:ai-cost -- --dry-run`
- **Interactive AI Credit Burn Calculator:** https://costpicks.com/calculators/ai-credit-burn

## Target Model Matrix (Published List Rates Only)
| Provider | Model | Type | Run Scope | List Input ($/1M) | List Output ($/1M) | Web Search ($/call) | Official Pricing |
| :--- | :--- | :--- | :--- | ---: | ---: | ---: | :--- |
| OpenAI | `gpt-5-mini` (OpenAI GPT-5 mini) | Reasoning / Thinking | Default run | $0.25 | $2.00 | $0.010 | https://openai.com/api/pricing/ |
| OpenAI | `gpt-4.1-mini` (OpenAI GPT-4.1 mini) | Standard | Default run | $0.40 | $1.60 | $0.010 | https://openai.com/api/pricing/ |
| OpenAI | `gpt-5` (OpenAI GPT-5) | Reasoning / Thinking | Default run | $1.25 | $10.00 | $0.010 | https://openai.com/api/pricing/ |
| Google Gemini | `gemini-3.8-flash` (Google Gemini 3.8 Flash) | Reasoning / Thinking | Default run | $0.75 | $3.75 | $0.014 | https://ai.google.dev/gemini-api/docs/pricing |
| Google Gemini | `gemini-4-hydrogen` (Google Gemini 4 Hydrogen) | Reasoning / Thinking | Default run | $1.50 | $7.50 | $0.014 | https://ai.google.dev/gemini-api/docs/pricing |
| Google Gemini | `gemini-2.5-flash` (Google Gemini 2.5 Flash) | Reasoning / Thinking | Legacy baseline (`--models`) | $0.30 | $2.50 | $0.035 | https://ai.google.dev/gemini-api/docs/pricing |
| Google Gemini | `gemini-2.5-pro` (Google Gemini 2.5 Pro) | Reasoning / Thinking | Legacy baseline (`--models`) | $1.25 | $10.00 | $0.035 | https://ai.google.dev/gemini-api/docs/pricing |

## Deterministic Developer Task Categories
- **Structured JSON Extraction** (`structured_json_extraction`): Extracting strictly typed incident, billing, Docker Compose, and webhook records validated against deterministic Zod schemas.
- **Multi-Step Tool Calling** (`multi_step_tool_calling`): Selecting ordered tool invocations and typed argument payloads for cloud cost audits, DB tuning, and alert routing.
- **Code Refactoring** (`code_refactoring`): Refactoring TypeScript, SQL, and Python snippets into safe, bounded implementations with structured complexity and edge-case notes.
- **Search-Grounded Technical Q&A** (`search_grounded_qa`): Answering architectural and API pricing specification questions using live provider web search grounding (OpenAI Responses API web_search at $0.01/call vs Gemini google_search at $0.014/call on Gemini 3.8/4 and $0.035/call on Gemini 2.5) in structured JSON with explicit confidence and official reference domains.

## FAQ
### What is the hidden token multiplier in AI API billing?
Modern reasoning and thinking models generate internal reasoning/thought tokens—and tool-calling overhead tokens—that are billed at full output or input token rates even though they never appear in the visible answer. The hidden token multiplier measures total billed output + tool-overhead tokens divided by visible output tokens.

### Why measure cost per 1,000 valid Zod outputs instead of headline $/1M tokens?
A low headline per-million-token price can still cost more in production if hidden reasoning tokens inflate output volume by 3x or if malformed JSON outputs require retries. Measuring actual billed USD per 1,000 schema-valid completions captures both hidden token inflation and reliability.

### How does CostPicks keep the monthly AI API benchmark reproducible and budget-safe?
The runner (scripts/run-ai-cost-benchmark.ts) uses a fixed deterministic prompt suite and seed, defaults safely to --dry-run (0 API calls), enforces a hard --max-budget-usd ceiling with upfront worst-case reservations, stops immediately on HTTP 429, and never sends private user data.

---
_Editorial Independence & Affiliate Disclosure: CostPicks may earn a commission when you sign up or purchase through links on this page, at no extra cost to you. Every offer displays its verification status and last-checked date._
