{"openapi":"3.1.0","info":{"title":"Indent API","version":"1.0.0","description":"Indent, dedent and convert tabs to spaces on plain text, line by line. The indent endpoint prefixes every line with a fixed indentation — a number of spaces or tabs, or any custom prefix like \"> \" for quoting — and can optionally indent blank lines too. The dedent endpoint removes the longest common leading whitespace from a block (the same idea as Python textwrap.dedent), so you can flatten an over-indented snippet and get back exactly which prefix was stripped. The tabs endpoint converts between tabs and spaces honouring tab stops — expand tabs to spaces or collapse runs of spaces back to tabs, at a chosen tab size, leading whitespace only or throughout. It works on any text without parsing it as code, and CRLF line endings are preserved. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. It only touches whitespace structure: to trim or sort lines use a lines API, to reflow long lines use a word-wrap API, and to reformat real source code use a code-formatter API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/indent-api","description":"oanor gateway"}],"tags":[{"name":"Indent"},{"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/dedent":{"get":{"operationId":"get_v1_dedent","tags":["Indent"],"summary":"Dedent text","description":"","parameters":[{"name":"text","in":"query","required":true,"description":"The text to dedent","schema":{"type":"string"},"example":"    a\n      b"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"text":"a\n  b","lines":2,"removed_length":4,"removed_prefix":"    "},"meta":{"timestamp":"2026-06-03T09:25:07.275Z","request_id":"0b781906-d20a-4b8d-87f0-e41624043d3f"},"status":"ok","message":"Dedent text","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/indent":{"get":{"operationId":"get_v1_indent","tags":["Indent"],"summary":"Indent text","description":"","parameters":[{"name":"text","in":"query","required":true,"description":"The text to indent","schema":{"type":"string"},"example":"a\nb"},{"name":"amount","in":"query","required":false,"description":"Number of units (default 4)","schema":{"type":"string"},"example":"4"},{"name":"char","in":"query","required":false,"description":"'space' or 'tab' (default space)","schema":{"type":"string"}},{"name":"prefix","in":"query","required":false,"description":"Custom prefix (overrides amount/char)","schema":{"type":"string"}},{"name":"blank_lines","in":"query","required":false,"description":"true to also indent empty lines","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"text":"    a\n    b","lines":2,"prefix_length":4},"meta":{"timestamp":"2026-06-03T09:25:07.378Z","request_id":"ada36515-16aa-453f-9639-7de80d073b8c"},"status":"ok","message":"Indent text","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/tabs":{"get":{"operationId":"get_v1_tabs","tags":["Indent"],"summary":"Convert tabs/spaces","description":"","parameters":[{"name":"text","in":"query","required":true,"description":"The text to convert","schema":{"type":"string"},"example":"\tx"},{"name":"mode","in":"query","required":false,"description":"'expand' (tabs→spaces) or 'collapse' (spaces→tabs)","schema":{"type":"string"},"example":"expand"},{"name":"tab_size","in":"query","required":false,"description":"Spaces per tab stop (default 4)","schema":{"type":"string"},"example":"4"},{"name":"leading_only","in":"query","required":false,"description":"Only leading whitespace (default true)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"mode":"expand","text":"    x","lines":1,"tab_size":4,"leading_only":true},"meta":{"timestamp":"2026-06-03T09:25:07.481Z","request_id":"b3169daf-99d4-490b-8a75-d1bcfc779486"},"status":"ok","message":"Convert tabs and spaces","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":"Indent API","notes":"Operates purely on leading/whitespace structure — it does not trim or reflow text (use a lines or word-wrap API) and does not parse code grammar (use a code formatter). CRLF line endings are preserved. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/indent","params":{"char":"'space' or 'tab' (default space)","text":"the text (required)","amount":"number of units (default 4)","prefix":"custom prefix string (overrides amount/char)","blank_lines":"true to also indent empty lines (default false)"},"returns":"the indented text"},{"path":"/v1/dedent","params":{"text":"the text (required)"},"returns":"the dedented text plus the common prefix that was removed"},{"path":"/v1/tabs","params":{"mode":"'expand' (tabs→spaces) or 'collapse' (spaces→tabs)","text":"the text (required)","tab_size":"spaces per tab stop (default 4)","leading_only":"only convert leading whitespace (default true)"},"returns":"the converted text"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Indent, dedent and convert tabs↔spaces on plain text, line by line. Add a fixed indentation (spaces or tabs, or any custom prefix) to every line; remove the longest common leading whitespace (Python-style dedent) to flatten a block; or convert between tabs and spaces honouring tab stops. Works on any text without parsing it as code. Pure local, no key."},"meta":{"timestamp":"2026-06-03T09:25:07.579Z","request_id":"fd43bdd5-1e0a-4f8b-81a2-70cfed3e2577"},"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":1435,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":295,"monthly_call_quota":10950,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2285,"monthly_call_quota":160500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6085,"monthly_call_quota":845000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/indent-api"}