Retrieval
Manhattan (L1) distance API
Returns the L1 / taxicab distance (sum of absolute coordinate differences) between two vectors. Answers 'What is the Manhattan distance between these vectors?', 'What is the L1 norm of the difference?'.
Price$0.01per request
MethodPOST
Route/v1/retrieval/manhattan-distance
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
manhattanl1taxicabdistancevectormetricretrievalrag
API URL
Integration docshttps://x402.hexl.dev/v1/retrieval/manhattan-distanceExample request
{
"a": [
1,
2
],
"b": [
4,
6
]
}Example response
{
"manhattanDistance": 7,
"dimensions": 2,
"formula": "sum(|a_i - b_i|)"
}Input schema
{
"type": "object",
"required": [
"a",
"b"
],
"properties": {
"a": {
"type": "array",
"items": {
"type": "number"
}
},
"b": {
"type": "array",
"items": {
"type": "number"
}
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}