deeprelay batches create
Submit an uploaded JSONL file as a batch
Submit an uploaded JSONL file as a batch
Synopsis
Submits an uploaded JSONL file as a batch. --input-file is the file id that deeprelay files upload printed. --endpoint is the endpoint every line calls: /v1/chat/completions (the default), /v1/messages or /v1/responses. --metadata key=value attaches up to 16 labels of your own, returned on the batch object.
Every line is validated before the batch is accepted. If any line is invalid the submit is refused, the message names the line numbers and what is wrong, and nothing runs or is billed. If the estimated cost does not fit your balance or one of your spending limits, the submit is refused with the estimate in the message.
On success the command prints the batch before any line runs:
Scheduled for— when the batch starts: now if the model is off-peak, otherwise the start of its next off-peak windowRate—off-peak rate,batch rateornormal rate, the rate its lines bill atBatch $/1M (in/cached/out)— the per-million-token pricesEstimated cost— input tokens plus each line'smax_tokensat that price. An estimate, not a hold.Expires— when lines that have not run are abandoned (72 hours after submit by default)
A one-line summary also goes to stderr. With -o json the CLI prints the batch object's view.
Workflow
# 1. Upload the requests (purpose "batch")
deeprelay files upload --file requests.jsonl
# -> file-abc123
# 2. Submit them as a batch
deeprelay batches create --input-file file-abc123 --endpoint /v1/chat/completions
# -> batch_8f2c41d07a9be3615c0d2e7f, scheduled for the next off-peak window
# 3. Check on it (status, counts, pause reason, next window, estimated completion)
deeprelay batches get batch_8f2c41d07a9be3615c0d2e7f
# 4. Download the results once it has finished
deeprelay batches results batch_8f2c41d07a9be3615c0d2e7f --out output.jsonl
deeprelay batches errors batch_8f2c41d07a9be3615c0d2e7f --out errors.jsonl
Examples
# Anthropic Messages lines
deeprelay batches create --input-file file-abc123 --endpoint /v1/messages
# Tag the batch for your own bookkeeping
deeprelay batches create --input-file file-abc123 --metadata job=nightly-eval --metadata run=42
deeprelay batches create [flags]
Options
--endpoint string Endpoint every line calls: /v1/chat/completions | /v1/messages | /v1/responses (default "/v1/chat/completions")
-h, --help help for create
--input-file string Id of an uploaded batch input file (file-...) — required
--metadata stringArray Metadata key=value pair (repeatable, up to 16)
Options inherited from parent commands
--api-base string API base URL (override with DEEPRELAY_API_BASE env) (default "https://api.deeprelay.ai/v1")
--debug Enable debug logging to stderr
--no-preflight Skip the plan/credit check before inference requests (override with DEEPRELAY_NO_PREFLIGHT env)
-o, --output string Output format: table|json (default table on TTY, json otherwise) (default "table")
SEE ALSO
- deeprelay batches - Submit and track off-peak batches