Batch API — ML Junction docs

Batch runs your requests on the provider’s own native batch lane - typically ~50% cheaper, returned within the completion window. It is async file-in / file-out, not a streaming request, and it is only available for providers that support it natively (you get a clear error otherwise). Service tiers do not apply inside batch.

# 1. Upload a JSONL file of requests
curl $BASE_URL/v1/files -H "Authorization: Bearer $KEY" \
  -F purpose=batch -F model=gpt-5.5 -F [email protected]
# 2. Create the batch from the returned file id
curl $BASE_URL/v1/batches -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"input_file_id":"<id>","model":"gpt-5.5","endpoint":"/v1/chat/completions"}'
# 3. Poll, then download output (and errors) JSONL
curl $BASE_URL/v1/batches/<batch_id> -H "Authorization: Bearer $KEY"
curl $BASE_URL/v1/batches/<batch_id>/content -H "Authorization: Bearer $KEY"

Jobs respect the same BYOK / platform credential resolution as synchronous calls, and are billed at the provider’s batch rate on completion. Track them live on the Batch page in your dashboard.

Canonical URL: https://mljunction.com/docs/batch