Retrieval
Vector norms & sparsity API
Returns L1, L2, and L-infinity norms plus sparsity, non-zero count, and mean of a vector. Answers 'What is the magnitude of this embedding?', 'How sparse is this vector?'.
Price$0.01per request
MethodPOST
Route/v1/retrieval/vector-magnitude
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
magnitudenorml2l1sparsityvectorembeddingrag
API URL
Integration docshttps://x402.hexl.dev/v1/retrieval/vector-magnitudeExample request
{
"vector": [
3,
4,
0
]
}Example response
{
"l2Norm": 5,
"l1Norm": 7,
"lInfNorm": 4,
"dimensions": 3,
"nonZeroCount": 2,
"sparsity": 0.33333333,
"mean": 2.33333333
}Input schema
{
"type": "object",
"required": [
"vector"
],
"properties": {
"vector": {
"type": "array",
"items": {
"type": "number"
}
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}