Batch processing is used for non-interactive AI tasks
Why it matters
The OpenAI Batch API offers a 50% cost discount and higher throughput limits for requests that can tolerate a 24-hour completion window. Non-interactive tasks — nightly content tagging, bulk summarization, product description generation, weekly report creation — have no reason to use real-time standard API calls and pay the full rate. Sending these jobs one-by-one through the synchronous endpoint forgoes half the available cost savings and burns synchronous rate limit capacity that user-facing features need. ISO 25010 performance-efficiency requires that resource consumption be calibrated to actual operational constraints.
Severity rationale
Info because missing batch API usage wastes available cost discounts on background tasks, but does not cause failures or affect real-time user experience.
Remediation
Migrate background AI jobs to the OpenAI Batch API using a JSONL request file. The 50% discount applies automatically; standard rate limits do not apply to batch jobs.
// src/jobs/bulk-summarize.ts
const batchRequests = articlesToSummarize.map(article => ({
custom_id: `article-${article.id}`,
method: "POST",
url: "/v1/chat/completions",
body: {
model: "gpt-4o-mini",
messages: [{ role: "user", content: `Summarize: ${article.content}` }],
max_tokens: 200,
},
}));
const filePath = "/tmp/batch-requests.jsonl";
fs.writeFileSync(filePath, batchRequests.map(r => JSON.stringify(r)).join("\n"));
const file = await openai.files.create({ file: fs.createReadStream(filePath), purpose: "batch" });
await openai.batches.create({ input_file_id: file.id, endpoint: "/v1/chat/completions", completion_window: "24h" });
Verify by confirming that cron jobs and queue workers route through openai.batches.create rather than chat.completions.create.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI Token Optimization Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · performance-efficiency.resource-utilization — Resource Utilization — batch API used for non-interactive AI workloads
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-token-optimization·automated