Skip to content
All posts
By the PromptUnit team···9 min read

Cheapest AI Model for JSON Extraction (Oct 2026)

Which model costs least for extracting structured JSON from text, and when paying more improves field accuracy. October 2026 prices and trade-offs.

json-extractionstructured-outputmodel-pricingllm-routingcost-optimization

For simple, flat JSON schemas (under roughly 10 fields, no deep nesting), GPT-6 Luna and Claude Haiku 5.5 are the cheapest capable options at $0.10 per million input tokens and $0.50 per million output tokens, with native schema-constrained generation supported on both. When schemas grow more complex, with conditional fields, deep nesting, or large arrays, a mid-tier model like Claude Sonnet 5.5 ($2.00/$10.00) or GPT-6.1 Sol ($2.00/$10.00) typically pays back its cost in avoided retry logic and field-level accuracy. Frontier models are rarely necessary for extraction unless the source text is itself complex and ambiguous.

The Three Reliability Levels You Need to Know

Before comparing model prices, it is worth being precise about what you are buying. There are three distinct modes for getting JSON from an LLM, and they are not interchangeable:

Prompt-only JSON asks the model to return JSON via instructions. It works in demos, but field-omission and type errors compound quickly when you scale. At 10,000 calls per day, even a 2% failure rate means 200 broken extractions that need re-processing.

JSON mode (response_format: {type: "json_object"} on OpenAI) guarantees syntactically valid JSON but does not guarantee your schema is respected. Required fields can be missing, types can be wrong. OpenAI recommends using Structured Outputs instead of JSON mode whenever possible.

Schema-constrained generation (Structured Outputs on OpenAI, response_schema on Gemini, output_config on Anthropic) constrains token generation so the model physically cannot produce a response that violates your schema. This is the 2026 production standard for extraction workloads. All models in the comparison below support it.

Prices, October 2026

All prices are per million tokens, standard tier, from provider pricing pages.

Model Input Output Cached input Schema support
GPT-6 Luna $0.10 $0.50 $0.01 Yes
Claude Haiku 5.5 (up to 100K tokens) $0.10 $0.50 $0.01 Yes
GPT-4o-mini $0.15 $0.60 $0.075 Yes
Gemini 3.5 Flash-Lite $0.30 $2.50 $0.03 Yes
Gemini 3.8 Flash $0.75 $3.75 $0.075 Yes
GPT-6.1 Sol $2.00 $10.00 $0.10 Yes
Claude Sonnet 5.5 $2.00 $10.00 $0.10 Yes
GPT-5.6 Terra $2.00 $12.00 $0.20 Yes
Claude Opus 5.5 $4.00 $20.00 $0.20 Yes
GPT-5.6 Sol $4.00 $20.00 $0.40 Yes

Note: GPT-4.1 nano was shut down on October 23, 2026 and cannot be used. Its replacement is GPT-6 Luna. GPT-4o-mini remains active but is scheduled for retirement on January 14, 2027; new projects should default to GPT-6 Luna.

When the Budget Tier Is Enough

For a typical extraction call, say 800 input tokens (a system prompt with the schema plus a short document) and 150 output tokens (the extracted JSON), the math at GPT-6 Luna works out to about $0.000155 per call. At 100,000 calls per day, that is roughly $15.50 per day, or under $500 per month.

Budget models handle extraction well when:

  • The schema is shallow and stable. Ten or fewer fields, no more than two levels of nesting, no conditional required fields. The Structured Output Benchmark (SOB) found that the models it tested pass JSON parsing about 96% of the time or more when schema-constrained generation is active. The differentiation shows up in value-level accuracy, not parse validity.
  • The source text is clean. A CRM note, a support ticket, a product description: these are short, well-formed, and unambiguous. The model does not need to reason across long context or reconcile contradictions.
  • Errors are catchable. If downstream validation can flag a wrong value and re-route the request, a small field error rate from a budget model costs less than the price premium of moving up a tier.

For this category, GPT-6 Luna and Claude Haiku 5.5 are both strong choices. Haiku 5.5 uses Anthropic's newer tokenizer (introduced from Claude 4.7 onward) which counts roughly 30% more tokens for the same text, so at equal advertised prices, test your actual token counts before assuming the two are cost-equivalent in practice.

Groq is worth mentioning here for latency-sensitive pipelines. On the Developer plan, the OpenAI GPT OSS 20B model runs at up to about 1,000 tokens per second at $0.075 input / $0.30 output per million tokens. For high-throughput, low-latency extraction where the simpler model is sufficient, Groq can cut both cost and time-to-response.

Let each request use the cheapest model that's just as good

PromptUnit checks each request your app sends. When a cheaper model is just as good for that request, it uses it; otherwise your model answers. Free until it has saved you money.

Try it free →

When a Mid-Tier Model Pays Off

Schema complexity is where budget models start losing ground in real ways. The SOB benchmark placed GPT-5.4 at the top with an overall score of 0.870 and value accuracy of 0.798, while frontier models like Claude Opus 4.7 and GPT-5.5 scored similarly. The benchmark did not include GPT-6 Luna or Claude Haiku 5.5, but related research on complex enterprise schemas (the ExtractBench dataset with 369-field financial schemas) found that even frontier models dropped to 0% valid output on the most demanding tasks.

The practical signal: if your schema has more than about five levels of nesting, uses many conditional or interdependent fields, or requires the model to reconcile conflicting information within the source text, a budget model's field accuracy degrades noticeably. The retry cost, both in tokens and in engineering time spent writing fallback logic, frequently exceeds the price difference between a budget and mid-tier model.

Claude Sonnet 5.5 ($2.00/$10.00) and GPT-6.1 Sol ($2.00/$10.00) both hit that mid-tier price point. They are 20x more expensive than GPT-6 Luna on input, but for a 1,000-call batch, the extra cost is small in absolute terms: about $2.95 more per 1,000 calls at 800 tokens in / 150 out ($3.10 against $0.155). Retries on a budget model cost very little in tokens, so the real question is what a wrong extraction costs you downstream: if it means manual fixes or bad data in your systems, the mid-tier price is usually worth it.

When to Pay Frontier Prices

Real extraction complexity that justifies Claude Opus 5.5 ($4.00/$20.00) or GPT-5.6 Sol ($4.00/$20.00) is narrower than people expect. The cases that actually benefit include:

  • Long or ambiguous source documents. Annual reports, legal contracts, multi-page medical notes: extracting structured fields requires reading across many pages, resolving ambiguities, and making judgment calls about what counts as the target value.
  • Very high value per record. If one missed field in an extracted invoice can cause a $10,000 payment error, the cost of a frontier model call is irrelevant. The math is about accuracy per dollar, not cost per call.
  • No validation backstop. If extracted JSON goes directly into a database or triggers downstream actions without a human or rule-based check, the accuracy floor matters more than the per-token price.

For everything else, the benchmark data suggests you are paying a quality premium that will not show up in your actual metrics. A mid-tier model with schema-constrained generation and well-designed output schema will match a frontier model on most real extraction tasks.

The One Change That Matters More Than Model Choice

Regardless of which model tier you pick, one technical choice has more impact on extraction reliability than any other: switching from prompt-only JSON or legacy JSON mode to native schema-constrained generation. When schema enforcement runs at the token level, the model cannot omit a required field or use the wrong type. That alone eliminates the most common class of extraction failure.

The second-biggest lever is schema design. Flatter schemas with explicit field descriptions, specific type constraints, and limited use of additionalProperties outperform deeply nested schemas even on the same model. If you can restructure a 15-field nested object into a flat 15-field object, you will see accuracy improvements without paying more.

If you are running extraction across multiple app steps or want to know which specific calls are driving your token spend, the LLM Cost Tracking guide covers how to tag and measure per-step costs. The Claude Haiku vs GPT-6 Luna comparison goes deeper on the budget tier specifically, including where the two models diverge in practice.

Worked Example: 100,000 Extractions Per Month

Scenario: extracting order data from e-commerce confirmation emails. Schema has 8 fields (order ID, date, line items array with 3 subfields, total, currency). Input averages 600 tokens, output averages 180 tokens.

Model Input cost Output cost Total/month
GPT-6 Luna $6.00 $9.00 $15.00
Claude Haiku 5.5 $6.00 $9.00 $15.00
GPT-4o-mini $9.00 $10.80 $19.80
Gemini 3.5 Flash-Lite $18.00 $45.00 $63.00
Claude Sonnet 5.5 $120.00 $180.00 $300.00
GPT-6.1 Sol $120.00 $180.00 $300.00

For this schema, GPT-6 Luna and Claude Haiku 5.5 are the right starting point. The 20x price jump to mid-tier is only worth evaluating if you measure field accuracy below your acceptable threshold on those models.

Routing by Complexity in Practice

The reason most teams overspend on extraction is not that they chose the wrong model: it is that they chose one model for every call and set it to the ceiling of their complexity requirements. A support ticket extraction and a 50-page contract extraction should not go to the same model.

PromptUnit checks each request before sending it and routes to a cheaper model when one is demonstrably sufficient for that specific call. For apps that mix simple and complex extractions in the same pipeline, that per-request check can reduce model costs substantially without you having to manage the routing logic yourself. You point your API base URL at it and add your PromptUnit key alongside your provider key.

The right default for new extraction workloads: start at GPT-6 Luna or Claude Haiku 5.5 with schema-constrained generation, measure field accuracy on your own data, and step up only when the numbers tell you to. The AI Cost Optimization Checklist has a structured process for that evaluation.

Current prices of the models in this post

Per 1 million tokens, input and output, read every day from each provider's own pricing page.

Compare: Claude Haiku 5.5 vs GPT-6 Luna, Claude Haiku 5.5 vs Gemini 3.8 Flash, GPT-6 Luna vs Gemini 3.8 Flash, GPT-4o mini vs GPT-6 Luna

All AI API prices →

FAQ

What is the cheapest model for extracting JSON from text in 2026?

GPT-6 Luna and Claude Haiku 5.5 are both $0.10 per million input tokens and $0.50 per million output tokens, and both support schema-constrained generation (Structured Outputs). At 600 input / 180 output tokens per call, 100,000 extractions per month costs about $15 on either model.

Do cheap models like GPT-6 Luna support JSON schema enforcement?

Yes. GPT-6 Luna supports OpenAI's Structured Outputs API, which uses constrained decoding to guarantee every response matches the JSON schema you supply. Claude Haiku 5.5 and Gemini 3.5 Flash-Lite also support schema-constrained generation on their respective APIs.

When does a more expensive model actually improve JSON extraction quality?

When the schema has more than about five levels of nesting, includes many conditional fields, or when the source text is long and ambiguous (such as legal contracts or medical reports). For simple flat schemas on clean short text, benchmark data shows budget models match mid-tier models closely on field accuracy once schema-constrained generation is used.

Is GPT-4.1 nano still available for JSON extraction?

No. GPT-4.1 nano was shut down on October 23, 2026. The recommended replacement is GPT-6 Luna, which is priced at $0.10 input and $0.50 output per million tokens.

What is the difference between JSON mode and Structured Outputs for extraction?

JSON mode only guarantees that the response is syntactically valid JSON; the model can still omit required fields, return wrong types, or invent extra properties. Structured Outputs (OpenAI's strict schema mode, Anthropic's output_config, or Gemini's response_schema) enforce the schema at the token generation level, making violations impossible rather than just unlikely. For production extraction, use schema-constrained generation.

Start saving from your first request

Change two settings and see what your first request saved within seconds. Free until we've saved you money. If we save you $0, you pay $0.

Get started free →