input field can be a single string or an array of inputs.
Batching is useful when you are indexing many chunks and want to reduce request overhead.
Batch Example
index field, so you can map results back to the original batch order.
How to read the result
data[0]is the embedding for the first inputdata[1]is the embedding for the second input- the
indexfield lets you map embeddings back to the original batch even if you do additional processing later
When To Batch
- indexing many documents or chunks
- reducing per-request overhead
- building offline retrieval corpora
Common mistakes
- batching inputs from different workflows when you need separate metadata
- assuming the response order can be inferred without using
index - sending a giant batch without thinking about request size, retries, and indexing checkpoints