Batch Processing
Our Batch API is compatible with OpenAI. And It will save you 50% of the cost compared to synchronous interfaces.
Supported Models
/v1/chat/completions
meta-llama/Meta-Llama-3.1-8B-Instruct
meta-llama/Llama-3.3-70B-Instruct
google/gemma-2-27b-it
google/gemma-2-9b-it * Qwen/Qwen2.5-7B-Instruct
/v1/embeddings
coming soon
Preparing Your Batch File
Batches start with a .jsonl file where each line contains the details of an individual request to the API. For now, the available endpoints are /v1/chat/completions (Chat Completions API), /v1/embeddings (Embeddings API) is not supported now. For a given input file, the parameters in each line's body field are the same as the parameters for the underlying endpoint. Each request must include a unique custom_id value, which you can use to reference results after completion. Here's an example of an input file with 2 requests. Note that each input file can only include requests to a single model.
Uploading Your Batch File
You need to use the Netmind platform's File API to create files.You can refer to File API for more information.
Creating the Batch
Once you've successfully uploaded your input file, you can use the input File object's ID to create a batch. In this case, let's assume the file ID is file-123456. For now, the completion window can only be set to 24h. You can also provide custom metadata via an optional metadata parameter.
Curl Example
Python Example
Example response
Checking the Status of a Batch
You can check the status of a batch at any time, which will also return a Batch object.
Curl Example
Python Example
Retrieving the Results
You need to use the Netmind platform's File API to get file content.You can refer to File API for more information. Reulst file id in batch.output_file_id.
Canceling the Batch
If necessary, you can cancel an ongoing batch. The batch's status will change to cancelling until in-flight requests are complete (up to 10 minutes), after which the status will change to cancelled.
Curl Example
Python Example
Getting a List of All Batches
At any time, you can see all your batches. For users with many batches, you can use the limit and after parameters to paginate your results.
Curl Example
Python Example
Last updated