1M row classification
200M input + 20M output tokens / month
mini or Flash labels
- Official (GPT-5.4 mini)
- $240.00/mo
- LumeAPI
- $72.00/mo
- Monthly savings
- $168.0070% off
Batch extraction & content
Run classification, entity extraction, summarization, and structured JSON pipelines on GPT mini, Gemini Flash, and Terra — pick the cheapest catalog model that passes your quality bar per task.
Batch workloads are throughput-sensitive. Lower per-token rates and deliberate model tiering beat running everything on flagship tiers.
Official reference vs LumeAPI catalog rates. Pricing unit: per 1M input / output tokens. Last updated: 2026-07-22. Source: provider list price.
| Model | Official (in / out) | LumeAPI (in / out) | Savings | |
|---|---|---|---|---|
| GPT-5.6 Solgpt-5.6-sol | $5.00 / $30.00 | $1.50 / $9.00 | 70% off | Details → |
| GPT-5.6 Terragpt-5.6-terra | $2.50 / $15.00 | $0.75 / $4.50 | 70% off | Details → |
| GPT-5.5gpt-5.5 | $5.00 / $30.00 | $1.50 / $9.00 | 70% off | Details → |
| GPT-5.4gpt-5.4 | $2.50 / $15.00 | $0.75 / $4.50 | 70% off | Details → |
| Claude Fable 5claude-fable-5 | $10.00 / $50.00 | $5.00 / $25.00 | 50% off | Details → |
| Claude Opus 4.8claude-opus-4-8 | $5.00 / $25.00 | $2.50 / $12.50 | 50% off | Details → |
| Claude Opus 4.7claude-opus-4-7 | $5.00 / $25.00 | $2.50 / $12.50 | 50% off | Details → |
| Claude Sonnet 4.6claude-sonnet-4-6 | $3.00 / $15.00 | $1.50 / $7.50 | 50% off | Details → |
| Gemini 3.1 Progemini-3.1-pro-preview | $2.00 / $12.00 | $1.00 / $6.00 | 50% off | Details → |
| GPT-5.4 minigpt-5.4-mini | $0.75 / $4.50 | $0.225 / $1.35 | 70% off | Details → |
| Gemini 3.5 Flashgemini-3.5-flash | $1.50 / $9.00 | $0.75 / $4.50 | 50% off | Details → |
| Gemini 3 Flashgemini-3-flash | $0.50 / $3.00 | $0.25 / $1.50 | 50% off | Details → |
Illustrative totals for gpt-5.4-mini using catalog list prices — your actual bill depends on retries, tool loops, and output length.
200M input + 20M output tokens / month
mini or Flash labels
60M input + 15M output tokens / month
Terra synthesis tier
Last verified: 2026-07-25
Batch extraction is not one prompt applied to a CSV. It is a pipeline with input normalization, bounded concurrency, schema validation, retries, review queues, and a deliberate escalation path. The model call is only one stage. If a row cannot be parsed, exceeds a token budget, or returns a low-confidence answer, the pipeline needs a deterministic place to send it.
Use LumeAPI for real-time classification, JSON extraction, and summarization workers that need immediate responses at catalog rates. Configure an OpenAI-compatible client with base_url set to https://api.lumeapi.site/v1 and a Bearer API key from the LumeAPI Console. Do not append /chat/completions to base_url: compatible SDKs add that endpoint path themselves.
Start with a cheap, fast model on routine rows, then spend more only where the data proves it is necessary. A practical first pass is gpt-5.4-mini or gemini-3-flash. Rows that fail JSON parsing, schema validation, business-rule checks, or confidence thresholds can be retried with gpt-5.6-terra or claude-sonnet-4-6. This makes premium-model usage an exception budget instead of the default.
For workloads that can wait up to 24 hours, evaluate a provider's official Batch API separately. That is an asynchronous job model. LumeAPI is better suited to real-time worker pipelines, where your application owns queueing, retry timing, observability, and row-level escalation.
Implementation setting path: use client base_url = "https://api.lumeapi.site/v1". The SDK constructs the Chat Completions endpoint path.
Last verified: 2026-07-25
A small pilot exposes schema ambiguity, noisy source fields, long-tail documents, and rate-limit behavior before they become expensive.
Verified response-format setting path: response_format.type = "json_object" where supported by the selected model.
Last verified: 2026-07-25
import json
import os
import random
import time
from typing import Any
from openai import OpenAI
client = OpenAI(
api_key=os.environ["LUMEAPI_API_KEY"],
base_url="https://api.lumeapi.site/v1",
)
PRIMARY_MODEL = "gpt-5.4-mini"
ESCALATION_MODEL = "gpt-5.6-terra"
MAX_ATTEMPTS = 4
SYSTEM_PROMPT = """Extract structured data from the supplied record.
Return one JSON object and no markdown.
Required keys:
- category: one of billing, support, sales, other
- summary: concise factual summary
- entities: array of strings
- needs_review: boolean
Use null when a scalar value cannot be determined from the record.
Do not infer facts that are not present in the record."""
def validate_result(value: Any) -> dict:
if not isinstance(value, dict):
raise ValueError("result must be a JSON object")
allowed = {"category", "summary", "entities", "needs_review"}
if set(value) != allowed:
raise ValueError(f"unexpected schema keys: {set(value)}")
if value["category"] not in {"billing", "support", "sales", "other"}:
raise ValueError("invalid category")
if not isinstance(value["summary"], str):
raise ValueError("summary must be a string")
if not isinstance(value["entities"], list) or not all(isinstance(x, str) for x in value["entities"]):
raise ValueError("entities must be an array of strings")
if not isinstance(value["needs_review"], bool):
raise ValueError("needs_review must be a boolean")
return value
def call_model(record_text: str, model: str) -> dict:
response = client.chat.completions.create(
model=model,
temperature=0,
response_format={"type": "json_object"},
messages=[
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": f"<record>\n{record_text}\n</record>"},
],
)
content = response.choices[0].message.content
return validate_result(json.loads(content))
def extract_row(row_id: str, record_text: str) -> dict:
last_error = None
for attempt in range(MAX_ATTEMPTS):
try:
result = call_model(record_text, PRIMARY_MODEL)
return {"row_id": row_id, "status": "accepted", "model": PRIMARY_MODEL, "result": result}
except Exception as error:
last_error = error
# Restrict this retry loop to transient transport/rate-limit errors in production.
# Log HTTP status and provider error details before deciding whether to retry.
delay = min(30, (2 ** attempt) + random.uniform(0, 1))
time.sleep(delay)
try:
result = call_model(record_text, ESCALATION_MODEL)
return {"row_id": row_id, "status": "escalated", "model": ESCALATION_MODEL, "result": result}
except Exception as escalation_error:
return {
"row_id": row_id,
"status": "failed",
"primary_error": str(last_error),
"escalation_error": str(escalation_error),
"model": ESCALATION_MODEL,
}
# Do not append /chat/completions to the base_url above; the SDK adds the endpoint path.
# Export LUMEAPI_API_KEY from the Bearer API key created in the LumeAPI Console.
For production, classify errors by HTTP status: retry 429 and temporary 5xx responses; route parse and validation failures to escalation or review instead of repeating the identical request.
Last verified: 2026-07-25
Use a primary model for the common path and reserve higher-cost models for rows that demonstrate a need for them.
| Workload tier | Recommended model | Use when | Escalate when | LumeAPI input / output price per 1M tokens |
|---|---|---|---|---|
| High-volume first pass | gemini-3-flash | Short classification, simple extraction, routine summaries, and broad triage | JSON fails, required fields are missing, or business rules reject the result | $0.25 / $1.50 |
| Structured routine extraction | gpt-5.4-mini | You need a low-cost first pass with a precise extraction contract | Ambiguous source language, conflicting fields, or repeated validation failure | $0.225 / $1.35 |
| Complex recovery | gpt-5.6-terra | Failed rows need stronger reasoning or more careful reconciliation | A row remains unsuitable after validation or must be manually reviewed | $0.75 / $4.50 |
| Complex recovery alternative | claude-sonnet-4-6 | Longer nuanced summaries, difficult classification boundaries, or second-opinion review | The output still fails your deterministic checks | $1.50 / $7.50 |
| Premium specialist queue | gpt-5.6-sol | Only for a narrow queue where the measured quality gain justifies the cost | Route to a human review workflow rather than unlimited retries | $1.50 / $9.00 |
Catalog pricing updated 2026-07-22. Prices shown are LumeAPI catalog input / output prices and should be paired with measured token usage from your own pilot.
Last verified: 2026-07-25
The largest avoidable cost in extraction pipelines is unnecessary input text. Strip navigation, boilerplate, duplicate email chains, repeated headers, and fields unrelated to the requested schema before sending a row. Preserve source identifiers so results can be traced back to the original record without carrying irrelevant context into every prompt.
Set hard limits for both input and output. An extraction response should be small because its schema is small. Ask for concise summaries, bounded arrays, normalized labels, and null for unavailable values. If the job requires evidence, request short source spans rather than a restatement of the entire record.
Track the escalation rate as a first-class cost and quality metric. A 2% escalation rate may be an efficient design. A 35% escalation rate usually means the first-pass prompt, schema, source normalization, or routing rules need work. Do not hide this by silently sending every difficult row to a premium model.
Pricing alone does not determine total cost. Repeated retries, oversized prompts, invalid JSON, and unbounded summaries can erase the benefit of a cheaper model. The useful unit is cost per accepted validated record: total model spend divided by rows that passed parsing, schema validation, and downstream rules.
Keep model ids exact in requests, including gpt-5.4-mini, gemini-3-flash, gpt-5.6-terra, and claude-sonnet-4-6.
Last verified: 2026-07-25
A worker pool should recover from bursts without duplicating work or turning a temporary 429 into an outage.
Use LumeAPI for real-time worker processing. For jobs explicitly designed to complete asynchronously within 24 hours, compare the relevant provider's official Batch API operating model separately.
Last verified: 2026-07-25
Where supported, response_format.type set to json_object is the right default for machine-consumed extraction. It reduces the chance that a model wraps the payload in prose or markdown. It does not guarantee that all required keys exist, that values match your taxonomy, or that the model has correctly interpreted the source.
Your application remains responsible for a parser, a strict schema validator, and business rules. For example, a ticket can be valid JSON while still containing a category outside your allowed routing list, a date before the source document date, or entities that do not appear in the source. These are product-level failures, not transport-level failures.
Be explicit about uncertainty. Require null for unsupported scalar claims, empty arrays when no entities are found, and needs_review for records with conflicting or insufficient evidence. This is more useful than forcing the model to manufacture complete-looking objects for every row.
Finally, preserve an audit trail. Store the source version, extraction schema version, prompt version, model id, timestamp, validation outcome, and escalation history. That record lets teams explain a downstream classification, compare model routes fairly, and reprocess only the rows affected when requirements change.
LumeAPI is independent and is not OpenAI, Anthropic, or Google. Use LumeAPI catalog model ids exactly as listed in your request.
Batch extraction is a quality-threshold problem: run 1,000-row pilots on gpt-5.4-mini and gemini-3-flash, measure accuracy, then scale the winner. Queue failed rows to gpt-5.6-terra or claude-sonnet-4-6.
Structured JSON via response_format works on many catalog models — validate on your schema in staging before million-row jobs.
Official provider Batch APIs may win overnight async jobs; LumeAPI fits near-real-time pipelines that need lower catalog list rates without a separate Batch integration.
LumeAPI is designed for developers who want to integrate without scheduling demos. Create an account, confirm your email, and open Console to generate an API key. Fund your USD wallet with USDT on supported chains when you are ready for billable traffic—there is no mandatory minimum beyond what your tests require.
Point your OpenAI-compatible client at https://api.lumeapi.site/v1, set Authorization to Bearer your key, and pass a catalog model id in the model field. Run a short curl or SDK script from /docs to verify latency, streaming, and error handling before you attach the key to production services.
Use Usage logs to reconcile per-call cost with finance forecasts. When a model tier is too expensive or quality is insufficient, change model id—not your entire integration. For cross-provider price tables and Research deep dives, follow internal links on this page rather than duplicating migration math here.
Every catalog model has a detail page under /models with official reference pricing, LumeAPI pricing, and links to /docs/models/{id} for parameters and curl examples. Start there when this commercial page points you to a model id you have not called before.
The /docs index lists gateway authentication, Chat Completions, image endpoints, and async video patterns. llms.txt bundles the same information for agent tooling—useful when you want a single URL to paste into Cursor or an internal bot.
Research articles explain why bills grow and how to compare providers; commercial pages like this one explain what LumeAPI offers and how to start. Follow internal links instead of searching for duplicate migration content across pages.
If billing, chain deposits, or integration behavior is unclear, use /contact for support channels. Include your model id, approximate request time, and whether the issue is authentication, balance, or model parameters—that speeds up resolution.
A single API key calls GPT, Claude, Gemini, and more on one USD wallet — no separate vendor accounts per provider.
Published catalog rates undercut official list pricing. GPT tiers up to ~70% off; Claude and Gemini 50% off official reference.
Model capacity is sourced through major providers’ authorized application channels — recognizable catalog ids, not opaque repackaged endpoints.
Every call records model id, token counts, latency, and exact USD cost. Audit any line item in Console — usage and price are traceable.
Point Cursor, SDKs, and agents at one base URL. Change API key, base URL, and model id — keep your existing integration shape.
Chat, image generation, and async video on the same key and wallet when you outgrow text-only workloads.
Three values change: API key, base URL, model id. Everything else stays the same.
from openai import OpenAI
client = OpenAI(api_key="YOUR_OPENAI_API_KEY")
response = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hello"}],
)from openai import OpenAI
client = OpenAI(
api_key="YOUR_LUMEAPI_KEY",
base_url="https://api.lumeapi.site/v1",
)
response = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hello"}],
)Full step-by-step rollout, streaming checks, and FAQ: Batch API cost guide →
API key, base URL (https://api.lumeapi.site/v1), and model id to a LumeAPI catalog entry. Message shape stays OpenAI-compatible for most apps.
Streaming, tool calling, JSON mode, and error handling on your heaviest models. Shadow 5–10% of traffic before full cutover.
Provider-native features (Anthropic Batch, Google Grounding, OpenAI Assistants) may require the official API. Test your exact payload.
Keep environment variables for base URL and model id. Switch back instantly if staging tests fail.
Test response_format on your model id in staging — provider-dependent.
Provider Batch may win async jobs. LumeAPI targets real-time catalog rates.
Implement concurrency + retry in your worker pool.
Divide Usage total by rows processed after a pilot batch.
response_format json_object where supported — test per model.
Short prompts + mini for high-volume fields.
Binary labels on Flash before human review.
Sample 1% to Sonnet; keep bulk on mini.
Part of the Cheap LLM API hub — models, pricing, and integration guides for this provider.
gemini-3-flash or gpt-5.4-mini for short labels — validate accuracy.
Add JSON schema in prompt; escalate failed rows to Terra or Sonnet.
Chunk long docs; use Flash for map step, Terra for reduce.
Use provider Batch for offline 24h jobs; LumeAPI for interactive or near-real-time pipelines.
Backoff on 429; stagger workers in staging load test.
See /high-volume-llm-api for 100M+ planning.
Process rows through https://api.lumeapi.site/v1. Need help choosing a model? Browse the developer docs or contact support.