{
 "schema_version": 1,
 "generated": "2026-10-29",
 "id": "openai-openai-cli--run-a-batch-of-openai-requests-from-a-jsonl-file",
 "repo": "openai/openai-cli",
 "repo_url": "https://github.com/openai/openai-cli",
 "repo_slug": "openai-openai-cli",
 "title": "Run a batch of OpenAI requests from a JSONL file",
 "page_title": "How to run a batch of OpenAI requests from a JSONL file with OpenAI CLI",
 "summary": "Upload a JSONL file of requests, create a batch, wait for it and download the results.",
 "who": "A data engineer who needs to send thousands of prompts and can wait up to a day for cheaper batch processing.",
 "problem": "Submitting and polling the Batch API by hand takes several scripts and careful ID tracking.",
 "outcome": "A finished batch with its result files downloaded to a local folder.",
 "steps": [
  "Prepare requests.jsonl (the batch guide includes a sample)",
  "Run `openai files upload requests.jsonl --purpose batch` and note the returned file ID",
  "Create the batch with `openai batches create --input-file-id` plus your file ID, `--endpoint /v1/responses --completion-window 24h`",
  "Run `openai batches wait batch_example --output-dir ./results` with your batch ID",
  "Check the result files and the failed requests section of the batch guide"
 ],
 "agent_prompt": "Use openai/openai-cli to upload <requests.jsonl> with `--purpose batch`, create a batch on /v1/responses with a 24h window, wait for it with `openai batches wait`, and save results to ./results. Report how many requests failed.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "go",
 "requirements": [
  "An OpenAI API key (OPENAI_API_KEY); admin endpoints need OPENAI_ADMIN_KEY",
  "Homebrew, Go 1.26 or later, or a prebuilt binary from GitHub Releases",
  "Optional: jq for parsing JSON output"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/openai-openai-cli/run-a-batch-of-openai-requests-from-a-jsonl-file/",
 "md": "https://dedupedai.com/use-cases/openai-openai-cli/run-a-batch-of-openai-requests-from-a-jsonl-file/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/openai-openai-cli--run-a-batch-of-openai-requests-from-a-jsonl-file.json",
 "api_version": "v1"
}
