Retrieval
Centroid of vectors API
Returns the element-wise mean (centroid) of a set of vectors. Answers 'What is the centroid of these embeddings?', 'What is the average vector for this cluster?'.
Price$0.01per request
MethodPOST
Route/v1/retrieval/centroid
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
centroidmeanaverageclustervectorembeddingretrievalrag
API URL
Integration docshttps://x402.hexl.dev/v1/retrieval/centroidExample request
{
"vectors": [
[
1,
2
],
[
3,
4
],
[
5,
6
]
]
}Example response
{
"centroid": [
3,
4
],
"count": 3,
"dimensions": 2
}Input schema
{
"type": "object",
"required": [
"vectors"
],
"properties": {
"vectors": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}