Retrieval
Silhouette clustering score API
Computes the silhouette score (cohesion vs separation, range [-1,1]) for a labeled clustering, with per-point values and a quality label. Answers 'How good is my clustering?', 'What is the silhouette score of these labels?'.
Price$0.03per request
MethodPOST
Route/v1/retrieval/silhouette-score
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
silhouetteclusteringqualitycohesionseparationkmeansmetricrag
API URL
Integration docshttps://x402.hexl.dev/v1/retrieval/silhouette-scoreExample request
{
"vectors": [
[
0,
0
],
[
0,
1
],
[
10,
10
],
[
10,
11
]
],
"labels": [
0,
0,
1,
1
]
}Example response
{
"metric": "euclidean",
"silhouetteScore": 0.92928955,
"perPoint": [
0.93105399,
0.9275251,
0.9275251,
0.93105399
],
"clusterCount": 2,
"interpretation": "strong structure"
}Input schema
{
"type": "object",
"required": [
"vectors",
"labels"
],
"properties": {
"vectors": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"labels": {
"type": "array",
"items": {
"type": "integer"
}
},
"metric": {
"type": "string",
"enum": [
"euclidean",
"cosine"
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}