Retrieval
Hamming distance API
Returns the number of differing positions, match count, and similarity between two equal-length binary or symbol vectors. Answers 'What is the Hamming distance between these binary codes?', 'How many bits differ?'.
Price$0.01per request
MethodPOST
Route/v1/retrieval/hamming-distance
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
hammingbinarydistancebitwisesimilarityquantizedretrievalrag
API URL
Integration docshttps://x402.hexl.dev/v1/retrieval/hamming-distanceExample request
{
"a": [
1,
0,
1,
1
],
"b": [
1,
1,
0,
1
]
}Example response
{
"hammingDistance": 2,
"length": 4,
"similarity": 0.5,
"matches": 2
}Input schema
{
"type": "object",
"required": [
"a",
"b"
],
"properties": {
"a": {
"type": "array"
},
"b": {
"type": "array"
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}