{"openapi":"3.1.0","info":{"title":"Bytes API","version":"1.0.0","description":"Humanize, parse and convert byte sizes. Turn a raw byte count into a human-readable string (1610612736 → 1.5 GiB or 1.61 GB), parse a human size back into bytes (\"1.5 GiB\", \"2GB\", \"500 kB\" → the exact integer), and convert an amount between any two units. Handles both the IEC binary units (KiB, MiB, GiB, TiB — powers of 1024) and the SI decimal units (kB, MB, GB, TB — powers of 1000), with configurable decimal places and case-insensitive unit names. Perfect for dashboards and admin UIs, file-upload limits, storage and bandwidth reporting, logs and CLI output. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. Distinct from file-type detection and from number/unit measurement conversion.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/bytes-api","description":"oanor gateway"}],"tags":[{"name":"Bytes"},{"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/convert":{"get":{"operationId":"get_v1_convert","tags":["Bytes"],"summary":"Convert between units","description":"","parameters":[{"name":"value","in":"query","required":true,"description":"Amount","schema":{"type":"string"},"example":"1"},{"name":"from","in":"query","required":false,"description":"Source unit (default B)","schema":{"type":"string"},"example":"GiB"},{"name":"to","in":"query","required":true,"description":"Target unit","schema":{"type":"string"},"example":"MiB"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"to":"mib","from":"gib","bytes":1073741824,"value":1,"result":1024},"meta":{"timestamp":"2026-06-02T16:51:45.645Z","request_id":"0eac6448-1643-4553-a9f5-1d5d5a8fa3f2"},"status":"ok","message":"Convert between units","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/format":{"get":{"operationId":"get_v1_format","tags":["Bytes"],"summary":"Humanize a byte count","description":"","parameters":[{"name":"bytes","in":"query","required":true,"description":"Byte count","schema":{"type":"string"},"example":"1610612736"},{"name":"system","in":"query","required":false,"description":"si|iec (default iec)","schema":{"type":"string"},"example":"iec"},{"name":"decimals","in":"query","required":false,"description":"0-10 (default 2)","schema":{"type":"string"},"example":"2"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"si":"1.61 GB","iec":"1.5 GiB","bytes":1610612736,"human":"1.5 GiB","system":"iec"},"meta":{"timestamp":"2026-06-02T16:51:45.752Z","request_id":"e07695d6-434e-4db7-83df-99494fe49d27"},"status":"ok","message":"Humanize a byte count","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/parse":{"get":{"operationId":"get_v1_parse","tags":["Bytes"],"summary":"Parse a size string to bytes","description":"","parameters":[{"name":"value","in":"query","required":true,"description":"e.g. 1.5 GiB, 2GB, 500 kB","schema":{"type":"string"},"example":"1.5 GiB"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"bytes":1610612736,"input":"1.5 GiB","system":"iec"},"meta":{"timestamp":"2026-06-02T16:51:45.871Z","request_id":"bb00821f-683c-4183-997f-15ba1994e9ed"},"status":"ok","message":"Parse a size string to bytes","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":{"name":"Bytes API","notes":"SI uses powers of 1000 (kB, MB, GB); IEC uses powers of 1024 (KiB, MiB, GiB). Unit names are case-insensitive.","version":"v1","endpoints":[{"path":"/v1/format","params":{"bytes":"a byte count (required)","system":"si|iec (default iec)","decimals":"0-10 (default 2)"},"returns":"human string + both si and iec forms"},{"path":"/v1/parse","params":{"value":"\"1.5 GiB\", \"2GB\", \"500 kB\" (required)"},"returns":"the size in bytes"},{"path":"/v1/convert","params":{"to":"target unit (required)","from":"source unit (default B)","value":"amount (required)"},"returns":"converted value + bytes"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Humanize, parse and convert byte sizes in both SI (kB, MB, GB — 1000) and IEC (KiB, MiB, GiB — 1024) units. Pure local, no key."},"meta":{"timestamp":"2026-06-02T16:51:45.983Z","request_id":"e6102f3f-bda5-4274-bf09-1c86a6e83088"},"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":880,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":170,"monthly_call_quota":7300,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2020,"monthly_call_quota":131000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5620,"monthly_call_quota":675000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/bytes-api"}