Batches
PreviewAsynchronous bulk chat completions and their JSONL input files. Reference for API version next.
On this page
List batches
/api/v1/llm/v1/batches Authentication
- API key in X-API-Key
- API key or session token in Authorization: Bearer
Query parameters
limitinteger- Default
20- Minimum
1- Maximum
100
Responses
200The caller's batches, newest first.Body (application/json)
objectstring- Always
list
dataarray of objects11 fields in
dataidstringobjectstring- Always
batch
endpointstringstatusstring- One of
pendingrunningdoneexpiredfailedcanceled
completion_windowstringrequest_countsobject3 fields in
request_countstotalintegercompletedintegerfailedinteger
output_file_idstring or nullerror_file_idstring or nullinput_file_idstring or nullcreated_atinteger or string or nullmetadataobject or null
Example
curl "https://api.breachline.io/api/v1/llm/v1/batches" \
-H "Authorization: Bearer $BREACHLINE_API_KEY"
{
"object": "list",
"data": [
{
"id": "string",
"object": "batch",
"endpoint": "string",
"status": "pending",
"completion_window": "string",
"request_counts": {
"total": 0,
"completed": 0,
"failed": 0
},
"output_file_id": "string",
"error_file_id": "string",
"input_file_id": "string",
"created_at": 0,
"metadata": {}
}
]
}
Create a batch
/api/v1/llm/v1/batches Submit up to 50,000 chat completion requests, inline (requests) or as an uploaded JSONL file (input_file_id). Batches need an organization-bound user and the llm:batch, llm:chat or llm:access scope. They are charged once, at the full Nebula price, when final results are fetched.
Authentication
- API key in X-API-Key
- API key or session token in Authorization: Bearer
Request body
requestsarray of objects- Maximum items
50000
4 fields in
requestscustom_idstringmethodstring- Always
POST
urlstring- Always
/v1/chat/completions
bodyobject14 fields in
bodymodelstringnebula-4.5(text, smart-routed) ornebula-v(vision). Unknown and retired ids resolve tonebula-4.5.- Default
nebula-4.5
messagesarray of objects Required5 fields in
messagesrolestring Required- One of
systemuserassistanttool
contentstring or array of objects or nullText, or an array of content parts (
text, andimage_urlfornebula-v).namestring or nulltool_callsarray of objects or null3 fields in
tool_callsidstringtypestring- Always
function
functionobject
tool_call_idstring or nullFor
role: tool, the id of the call being answered.
max_tokensinteger or nullOutput-token ceiling. An explicit value is clamped to the platform maximum.
- Minimum
1
max_completion_tokensinteger or nullAlias of
max_tokens; when both are sent, the smaller wins.- Minimum
1
temperaturenumber or null- Default
0.7- Minimum
0- Maximum
2
top_pnumber or null- Default
1- Minimum
0- Maximum
1
streamboolean or null- Default
false
stopstring or array of strings or nulltoolsarray of objects or nullOpenAI-format function tool definitions.
tool_choicestring or object or nullauto,none,required, or{ "type": "function", "function": { "name": … } }.parallel_tool_callsboolean or nullresponse_formatobject or null{ "type": "json_object" }or{ "type": "json_schema", "json_schema": { … } }.reasoning_effortstring or nullRequested reasoning depth. Omit it for adaptive routing.
- One of
nonelowmediumhighmaxxhighultranull
userstring or nullA stable session or end-user id. Send the same value on every turn of a conversation so prompt caching can reuse earlier context.
input_file_idstringA JSONL file uploaded with
POST /api/v1/llm/v1/files.endpointstring- Always
/v1/chat/completions
completion_windowstring- Default
24h
Responses
200The created batch.Body (application/json)
idstringobjectstring- Always
batch
endpointstringstatusstring- One of
pendingrunningdoneexpiredfailedcanceled
completion_windowstringrequest_countsobject3 fields in
request_countstotalintegercompletedintegerfailedinteger
output_file_idstring or nullerror_file_idstring or nullinput_file_idstring or nullcreated_atinteger or string or nullmetadataobject or null
Example
curl -X POST "https://api.breachline.io/api/v1/llm/v1/batches" \
-H "Authorization: Bearer $BREACHLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
{
"id": "string",
"object": "batch",
"endpoint": "string",
"status": "pending",
"completion_window": "string",
"request_counts": {
"total": 0,
"completed": 0,
"failed": 0
},
"output_file_id": "string",
"error_file_id": "string",
"input_file_id": "string",
"created_at": 0,
"metadata": {}
}
Retrieve a batch
/api/v1/llm/v1/batches/{batch_id} Authentication
- API key in X-API-Key
- API key or session token in Authorization: Bearer
Path parameters
batch_idstring Required
Responses
200The batch and its request counts.Body (application/json)
idstringobjectstring- Always
batch
endpointstringstatusstring- One of
pendingrunningdoneexpiredfailedcanceled
completion_windowstringrequest_countsobject3 fields in
request_countstotalintegercompletedintegerfailedinteger
output_file_idstring or nullerror_file_idstring or nullinput_file_idstring or nullcreated_atinteger or string or nullmetadataobject or null
Example
curl "https://api.breachline.io/api/v1/llm/v1/batches/{batch_id}" \
-H "Authorization: Bearer $BREACHLINE_API_KEY"
{
"id": "string",
"object": "batch",
"endpoint": "string",
"status": "pending",
"completion_window": "string",
"request_counts": {
"total": 0,
"completed": 0,
"failed": 0
},
"output_file_id": "string",
"error_file_id": "string",
"input_file_id": "string",
"created_at": 0,
"metadata": {}
}
Cancel a batch
/api/v1/llm/v1/batches/{batch_id}/cancel Authentication
- API key in X-API-Key
- API key or session token in Authorization: Bearer
Path parameters
batch_idstring Required
Responses
200The batch after the cancel request.Body (application/json)
idstringobjectstring- Always
batch
endpointstringstatusstring- One of
pendingrunningdoneexpiredfailedcanceled
completion_windowstringrequest_countsobject3 fields in
request_countstotalintegercompletedintegerfailedinteger
output_file_idstring or nullerror_file_idstring or nullinput_file_idstring or nullcreated_atinteger or string or nullmetadataobject or null
Example
curl -X POST "https://api.breachline.io/api/v1/llm/v1/batches/{batch_id}/cancel" \
-H "Authorization: Bearer $BREACHLINE_API_KEY"
{
"id": "string",
"object": "batch",
"endpoint": "string",
"status": "pending",
"completion_window": "string",
"request_counts": {
"total": 0,
"completed": 0,
"failed": 0
},
"output_file_id": "string",
"error_file_id": "string",
"input_file_id": "string",
"created_at": 0,
"metadata": {}
}
Get batch results
/api/v1/llm/v1/batches/{batch_id}/results One result per request. The batch is charged once, when its results are first fetched in a final state. While that charge is not yet settled the endpoint answers 503 with Retry-After: 30.
Authentication
- API key in X-API-Key
- API key or session token in Authorization: Bearer
Path parameters
batch_idstring Required
Responses
200The results.Body (application/json)
custom_idstringresponseobjecterrorobject or null
502A dependency is temporarily unavailable. Retry with backoff; honourRetry-Afterwhen present.Error envelope503A dependency is temporarily unavailable. Retry with backoff; honourRetry-Afterwhen present.Error envelope
Example
curl "https://api.breachline.io/api/v1/llm/v1/batches/{batch_id}/results" \
-H "Authorization: Bearer $BREACHLINE_API_KEY"
[
{
"custom_id": "string",
"response": {},
"error": {}
}
]
Upload a batch input file
/api/v1/llm/v1/files Upload a JSONL file of batch requests (multipart form, field file). Maximum 50 MiB by default.
Authentication
- API key in X-API-Key
- API key or session token in Authorization: Bearer
Request body
filefile RequiredJSONL, one request per line.
purposestring- Default
batch
Responses
200The stored file.Body (application/json)
idstringobjectstring- Always
file
purposestringbytesintegercreated_atintegerUnix seconds.
503A dependency is temporarily unavailable. Retry with backoff; honourRetry-Afterwhen present.Error envelope
Example
curl -X POST "https://api.breachline.io/api/v1/llm/v1/files" \
-H "Authorization: Bearer $BREACHLINE_API_KEY" \
-F "file=@requests.jsonl" \
-F "purpose=batch"
{
"id": "string",
"object": "file",
"purpose": "string",
"bytes": 0,
"created_at": 0
}
Download file content
/api/v1/llm/v1/files/{file_id}/content Authentication
- API key in X-API-Key
- API key or session token in Authorization: Bearer
Path parameters
file_idstring Required
Responses
200The raw file bytes.application/octet-stream
Example
curl "https://api.breachline.io/api/v1/llm/v1/files/{file_id}/content" \
-H "Authorization: Bearer $BREACHLINE_API_KEY"