API Reference
POST /embed/batch
Same as /embed but accepts up to 5000 items in a single request. Use this when embedding an entire restaurant catalog or syncing a large menu database.
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
items | string[] | Yes | Menu item texts to embed. 1-5000 items, max 500 chars each. |
dimension | int | No | Output vector dimension. Valid: 128, 256, 384. Default: 128. |
{
"items": ["Chicken Biryani", "Paneer Tikka", "...up to 5000 items..."],
"dimension": 128
}
Response
| Field | Type | Description |
|---|---|---|
embeddings | float[][] | One vector per input item, in submission order |
dimension | int | Dimension of each vector |
count | int | Number of items embedded |
Example
import requests
# Embed a full catalog in one request
menu_items = ["Chicken Biryani", "Paneer Tikka", ...] # up to 5000 items
response = requests.post("https://embed.statode.com/embed/batch",
headers={"X-API-Key": "YOUR_KEY", "Content-Type": "application/json"},
json={"items": menu_items, "dimension": 128}
)
data = response.json()
print(f"Embedded {data['count']} items")
Cost
0.05 credits per item.
Notes
- The server handles chunking internally. You don't need to split large lists yourself.
- For repeated searches against the same menu, embed once with this endpoint and pass the vectors to /search via
corpus_embeddingsto avoid re-encoding. - Response time scales linearly: ~400ms for 1000 items, ~2s for 5000 items.