{"openapi":"3.1.0","info":{"title":"Hashids API","version":"1.0.0","description":"Turn sequential integer IDs into short, unique, non-sequential strings — and back again. Encode one or more non-negative integers (or a hex string such as a Mongo ObjectId) into a compact YouTube-style id like \"vbYCZIYD\", then decode it to recover the exact original values. Add a salt so your ids are unique to your application, set a minimum length, or supply a custom alphabet. It is reversible obfuscation (not encryption): perfect for hiding row ids in public URLs, building short links, and avoiding leaking how many records you have. Pure local computation — no key, no third-party service, nothing stored. Stateless: decode with the same salt/min-length/alphabet you encoded with. Live. 5 endpoints. Distinct from UUID generation, base conversion and snowflake decoding.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/hashids-api","description":"oanor gateway"}],"tags":[{"name":"Encode"},{"name":"Decode"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/encode":{"get":{"operationId":"get_v1_encode","tags":["Encode"],"summary":"Encode integers to a hashid","description":"","parameters":[{"name":"numbers","in":"query","required":true,"description":"Non-negative integers, comma-separated","schema":{"type":"string"},"example":"1,2,3"},{"name":"salt","in":"query","required":false,"description":"Obfuscation salt (keep it constant per app)","schema":{"type":"string"},"example":"my-salt"},{"name":"min_length","in":"query","required":false,"description":"Minimum hash length","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"hash":"7LC9u4","salt":"my-salt","numbers":[1,2,3],"min_length":0},"meta":{"timestamp":"2026-06-02T16:52:00.047Z","request_id":"26e11334-d9ea-4078-8186-91d7c5cdddc0"},"status":"ok","message":"Encode integers to a hashid","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/encode-hex":{"get":{"operationId":"get_v1_encode_hex","tags":["Encode"],"summary":"Encode hex to a hashid","description":"","parameters":[{"name":"hex","in":"query","required":true,"description":"Hex string (e.g. ObjectId)","schema":{"type":"string"},"example":"507f1f77bcf86cd799439011"},{"name":"salt","in":"query","required":false,"description":"Obfuscation salt (keep it constant per app)","schema":{"type":"string"},"example":"my-salt"},{"name":"min_length","in":"query","required":false,"description":"Minimum hash length","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"hex":"507f1f77bcf86cd799439011","hash":"gX9LYXekA7hygdy5dp36","salt":"my-salt","min_length":0},"meta":{"timestamp":"2026-06-02T16:52:00.156Z","request_id":"20fbe3ef-4a9a-4400-9dbf-48d9fc778ea3"},"status":"ok","message":"Encode hex to a hashid","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/decode":{"get":{"operationId":"get_v1_decode","tags":["Decode"],"summary":"Decode a hashid","description":"","parameters":[{"name":"hash","in":"query","required":true,"description":"Hashid to decode","schema":{"type":"string"},"example":"vbYCZIYD"},{"name":"salt","in":"query","required":false,"description":"Obfuscation salt (keep it constant per app)","schema":{"type":"string"},"example":"my-salt"},{"name":"min_length","in":"query","required":false,"description":"Minimum hash length","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"hash":"vbYCZIYD","salt":"my-salt","valid":false,"numbers":[],"min_length":0},"meta":{"timestamp":"2026-06-02T16:52:00.259Z","request_id":"07f9bd5f-478d-408e-91e8-b89dc3ef79ac"},"status":"ok","message":"Decode a hashid","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/decode-hex":{"get":{"operationId":"get_v1_decode_hex","tags":["Decode"],"summary":"Decode a hashid to hex","description":"","parameters":[{"name":"hash","in":"query","required":true,"description":"Hashid to decode to hex","schema":{"type":"string"},"example":"q7XKW7gyJRIdm1dK1r6g"},{"name":"salt","in":"query","required":false,"description":"Obfuscation salt (keep it constant per app)","schema":{"type":"string"},"example":"my-salt"},{"name":"min_length","in":"query","required":false,"description":"Minimum hash length","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"hash":"q7XKW7gyJRIdm1dK1r6g","salt":"my-salt","valid":false,"min_length":0},"meta":{"timestamp":"2026-06-02T16:52:00.370Z","request_id":"9063c6f8-f254-4935-9774-c1beeb0cb3f8"},"status":"ok","message":"Decode a hashid to hex","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"auth":"none upstream; this gateway requires x-api-key","name":"Hashids API","note":"Encode non-negative integers into short reversible YouTube-style ids and decode them back. /v1/encode?numbers=1,2,3 ; /v1/decode?hash=... ; /v1/encode-hex?hex=507f... and /v1/decode-hex for hex/ObjectId values. Optional ?salt= (obfuscation key), ?min_length= and a custom ?alphabet= (>=16 unique chars). Stateless: decode with the SAME options used to encode. Not encryption — for obfuscating sequential ids in URLs.","source":"Local hashids encoding — no key, no upstream","endpoints":5},"meta":{"timestamp":"2026-06-02T16:52:00.474Z","request_id":"6d782130-b898-47f8-9f84-828e4798b2aa"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":1540,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":720,"monthly_call_quota":30000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2680,"monthly_call_quota":186000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6280,"monthly_call_quota":950000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/hashids-api"}