{"openapi":"3.1.0","info":{"title":"CBOR API","version":"1.0.0","description":"Encode and decode CBOR (RFC 8949, Concise Binary Object Representation) — the IETF-standard binary data format behind COSE, WebAuthn/FIDO2, the EU Digital COVID Certificate, and many IoT and constrained-device protocols. The encode endpoint turns a JSON value into compact, definite-length CBOR, choosing the smallest head for each integer, string, array and map; the decode endpoint parses CBOR back into a JSON value. It implements the spec across all major types — unsigned and negative integers of every width, byte and text strings (including indefinite-length chunked strings), arrays, maps, tags, the simple values false/true/null, and half-, single- and double-precision floats — and rejects trailing or truncated data rather than silently mangling it. Byte strings and any non-UTF-8 text come back losslessly as {\"_bytes_hex\":\"…\"}, tags as {\"_tag\":{\"tag\":N,\"value\":…}}, non-finite floats as {\"_float\":\"NaN|Infinity|-Infinity\"}, and other simple values as {\"_simple\":N}, so encode and decode round-trip exactly. Bytes are exchanged as both hex and base64 so they survive any transport. Everything is computed locally and deterministically, so it is instant and private. Ideal for debugging CBOR, COSE and WebAuthn payloads, bridging JSON and CBOR systems, IoT and smart-card pipelines, and teaching the format. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is CBOR specifically; for MessagePack use the MessagePack API, for BitTorrent's Bencode use the Bencode API, for JSON, YAML, TOML or XML use those format APIs, and for base64, hex, URL or HTML encoding use a general encoding API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/cbor-api","description":"oanor gateway"}],"tags":[{"name":"CBOR"},{"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/decode":{"get":{"operationId":"get_v1_decode","tags":["CBOR"],"summary":"Decode CBOR to a JSON value","description":"","parameters":[{"name":"hex","in":"query","required":false,"description":"The CBOR bytes as hex","schema":{"type":"string"},"example":"a26161016162820203"},{"name":"base64","in":"query","required":false,"description":"Or the bytes as base64","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"bytes":9,"value":{"a":1,"b":[2,3]}},"meta":{"timestamp":"2026-06-03T17:42:17.102Z","request_id":"30ef7d2a-8dfc-4c38-86b7-0d8abef59bcb"},"status":"ok","message":"Decode from CBOR","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":{"get":{"operationId":"get_v1_encode","tags":["CBOR"],"summary":"Encode a JSON value to CBOR","description":"","parameters":[{"name":"json","in":"query","required":true,"description":"A JSON value to encode","schema":{"type":"string"},"example":"{\"a\":1,\"b\":[2,3]}"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"hex":"a26161016162820203","bytes":9,"base64":"omFhAWFiggID"},"meta":{"timestamp":"2026-06-03T17:42:17.205Z","request_id":"17bbac2b-2db5-448e-9e5b-cc497d6e193e"},"status":"ok","message":"Encode to CBOR","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":"CBOR API","notes":"Encode emits definite-length items and float64 for non-integers; decode also accepts indefinite-length strings/arrays/maps and half/single floats. 64-bit integers beyond 2^53 decode to a decimal string. CBOR map keys that aren't text strings are stringified in the JSON output. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/encode","params":{"json":"a JSON value to encode (string)"},"returns":"the CBOR bytes as hex and base64, with byte length"},{"path":"/v1/decode","params":{"hex":"the CBOR bytes as hex","base64":"or as base64"},"returns":"the decoded JSON value"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Encode and decode CBOR (RFC 8949, Concise Binary Object Representation) — the IETF-standard binary data format behind COSE, WebAuthn/FIDO2, the EU Digital COVID Certificate, and many IoT and constrained-device protocols. The encode endpoint turns a JSON value into compact, definite-length CBOR, choosing the smallest head for each integer, string, array and map; the decode endpoint parses CBOR back into a JSON value. It implements the spec across all major types — unsigned and negative integers of every width, byte and text strings (including indefinite-length chunks), arrays, maps, tags, the simple values false/true/null, and half/single/double floats — and rejects trailing or truncated data. Byte strings and non-UTF-8 text come back losslessly as {\"_bytes_hex\":\"…\"}, tags as {\"_tag\":{\"tag\":N,\"value\":…}}, and other simple values as {\"_simple\":N}, so encode and decode round-trip exactly. Bytes are exchanged as hex and base64. Everything is computed locally and deterministically. Ideal for debugging CBOR/COSE/WebAuthn payloads, bridging JSON and CBOR systems, IoT pipelines, and teaching the format. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is CBOR specifically; for MessagePack use the MessagePack API, for BitTorrent's Bencode use the Bencode API, for JSON/YAML/TOML/XML use those format APIs, and for base64/hex/URL encoding use a general encoding API."},"meta":{"timestamp":"2026-06-03T17:42:17.368Z","request_id":"60155e8e-ba2c-4053-8502-a2600ef84bbf"},"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":5535,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":705,"monthly_call_quota":15050,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2695,"monthly_call_quota":201500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6495,"monthly_call_quota":1050000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/cbor-api"}