Endpoints
Create a Batch
Submit a new asynchronous batch job by referencing a previously uploaded input file and specifying which inference endpoint should process each request in that file.POST /v1/batches
string
required
The file ID returned by
POST /v1/files when you uploaded your JSONL request file. Example: file-abc123.string
required
The inference endpoint to invoke for every request in the batch. Use
"/v1/chat/completions" for chat models.string
The maximum time window Meliai is allowed to take to complete the batch. Accepts durations such as
"24h". Defaults to "24h" when omitted.Batch Status Values
PollGET /v1/batches/{id} to track progress. The status field in the response will be one of the following values.
Input File Format
Your input file must be a JSONL file (one JSON object per line). Each line represents a single inference request and must include acustom_id you define, the HTTP method, the target url, and a body matching the schema of the chosen endpoint.
custom_id is echoed back in every output line, so you can match results to the original requests after the batch completes.
Retrieve and Download Results
Once you have a batch ID, poll its status and then fetch the output file when processing finishes. Check batch status —GET /v1/batches/{id}
GET /v1/files/{output_file_id}/content
Once status is "completed", retrieve the output JSONL file using the output_file_id from the batch object.
custom_id, the HTTP status_code, and a response body in the same shape as a synchronous inference response.