Process large volumes of requests asynchronously at 50% of the standard per-token rate. Batch jobs are designed for eval harnesses, data pipelines, and bulk processing where you don’t need real-time responses.
POST /v1/batch.GET /v1/batch/{id} for status.GET /v1/batch/{id}/output when complete.SLA: 24-hour completion.
# Create input file
cat > batch.jsonl << 'EOF'
{"custom_id": "eval-1", "body": {"model": "llama-3.1-70b-instruct", "messages": [{"role": "user", "content": "What is 2+2?"}], "max_tokens": 10}}
{"custom_id": "eval-2", "body": {"model": "llama-3.1-70b-instruct", "messages": [{"role": "user", "content": "Capital of France?"}], "max_tokens": 10}}
{"custom_id": "eval-3", "body": {"model": "llama-3.1-70b-instruct", "messages": [{"role": "user", "content": "Translate 'hello' to Spanish."}], "max_tokens": 10}}
EOF
# Submit
curl -X POST https://inference.provocative.earth/v1/batch \
-H "Authorization: Bearer pk-prov-YOUR-KEY" \
-F "file=@batch.jsonl"
Response:
{
"id": "batch_abc123",
"status": "validating",
"endpoint": "/v1/chat/completions",
"total_requests": 3,
"completed_count": 0,
"failed_count": 0
}
curl https://inference.provocative.earth/v1/batch/batch_abc123 \
-H "Authorization: Bearer pk-prov-YOUR-KEY"
Status progression: validating → in_progress → completed (or failed).
curl https://inference.provocative.earth/v1/batch/batch_abc123/output \
-H "Authorization: Bearer pk-prov-YOUR-KEY" \
-o results.jsonl
Each line of the output is:
{
"id": "resp_xyz",
"custom_id": "eval-1",
"response": {
"status_code": 200,
"body": { "id": "chatcmpl-...", "choices": [...], "usage": {...} }
}
}
The custom_id lets you correlate results with your input rows.
curl -X POST https://inference.provocative.earth/v1/batch/batch_abc123/cancel \
-H "Authorization: Bearer pk-prov-YOUR-KEY"
Batch inference is billed at 50% of the standard per-token rate for the model used. See Pricing.