Command Reference
Batch
Validate, upload, run, and download OpenAI-compatible batch jobs from the terminal.
Use inf batch to run offline jobs through the Batch API. The CLI checks your JSONL file, uploads it, creates the batch, shows live progress, and downloads the output and error files. Every command supports --json.
Alias: inf batches
Authentication and base URL
The Batch API takes a project API key, not your inf auth login session. The CLI picks the key in this order:
--api-key <key>INF_API_KEY, or a key saved withinf auth set-key- If you are signed in with
inf auth login: the CLI creates one key namedinf-cli-batchfor the active project and caches it in~/.inf/config.json. If the API rejects that key, the CLI clears it and creates a new one on the next run.
The base URL comes from the active environment: https://batch.inference.net/v1 (production) or https://batch.inference.cool/v1 (staging). Override it with --base-url <url>.
inf batch create
Validate a batch input file, upload it, and start a batch.
inf batch create <input.jsonl> [options]Each line of the input file is one request:
{"custom_id":"req-1","method":"POST","url":"/v1/chat/completions","body":{"model":"glm-5.3-flash","messages":[{"role":"user","content":"Hi"}]}}The CLI checks every line before it uploads anything:
- the line is valid JSON
custom_idis present and uniquemethodisPOSTurlmatches--endpointbody.modelis set
If a check fails, the CLI lists each problem with its line number and stops. Files up to 10 MB upload in one request. Larger files upload in chunks with retries for each part. The maximum file size is 1 GB.
| Flag | Description | Default |
|---|---|---|
--endpoint <path> | /v1/chat/completions or /v1/completions | /v1/chat/completions |
--completion-window <window> | Completion window | 24h |
--metadata <key=value> | Metadata to attach (repeatable) | — |
--webhook-url <url> | URL to notify when the batch finishes | — |
--wait | Show live progress, then download the results | Off |
-o, --output <dir> | Directory for the results when --wait is set | . |
--interval <seconds> | Poll interval when --wait is set | 10 |
--timeout <seconds> | Stop waiting after this many seconds | None |
inf batch create input.jsonl
inf batch create input.jsonl --metadata run=nightly --wait -o ./resultsinf batch list
List recent batches with status, done/failed/total counts, created time, and endpoint. --status filters only the page that was fetched.
inf batch list [--limit 20] [--after <batch-id>] [--status <status>]inf batch get
Show the status, request counts, timestamps, durations (queued, running, total), and file IDs for one batch.
inf batch get <batch-id>inf batch wait
Show live progress until the batch finishes. The command exits with code 1 if the batch failed or expired, or if --timeout passes first.
inf batch wait <batch-id> [--interval 10] [--timeout <seconds>]inf batch cancel
Cancel a running batch.
inf batch cancel <batch-id>inf batch results
Download the output and error files as <dir>/<batch-id>_output.jsonl and <dir>/<batch-id>_errors.jsonl. If a file already exists, the CLI adds a numeric suffix instead of overwriting it. --errors downloads only the error file. --format table also prints the success count and the first errors.
inf batch results <batch-id> [-o <dir>] [--errors] [--format table]inf batch template
Convert a text file with one prompt per line into batch input JSONL.
inf batch template prompts.txt --model glm-5.3-flash [--max-tokens 200] [-o input.jsonl]inf batch files
Manage Batch API files directly: upload <file>, list, get <id>, download <id> [-o path], and delete <id> [--yes].
inf batch files upload input.jsonl
inf batch files download <file-id> -o output.jsonl