{"openapi":"3.1.0","info":{"title":"Prettier API","version":"1.0.0","description":"Format and beautify source code with Prettier, the de-facto code formatter. Pass code and a language and get it consistently re-formatted: JavaScript, JSX, TypeScript, TSX, CSS, SCSS, LESS, GraphQL and Vue. Tune the output with print width, tab width / tabs, semicolons, single vs double quotes and trailing-comma style. Syntax errors come back with a clear message. The inverse of a minifier. Pure local processing — no key, no third-party service, instant. Live. 3 endpoints. Built for code editors and playgrounds, paste-and-format tools, snippet beautification, docs and CI formatting checks. Complements the SQL formatter and the JSON/YAML/Markdown tools (which cover their own languages).","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/prettier-api","description":"oanor gateway"}],"tags":[{"name":"Format"},{"name":"Reference"},{"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/format":{"get":{"operationId":"get_v1_format","tags":["Format"],"summary":"Format code with Prettier","description":"","parameters":[{"name":"code","in":"query","required":true,"description":"Source code","schema":{"type":"string"},"example":"const x=[1,2,3].map(i=>i*2);console.log(x)"},{"name":"language","in":"query","required":true,"description":"js|jsx|ts|tsx|css|scss|less|graphql|vue","schema":{"type":"string"},"example":"js"},{"name":"print_width","in":"query","required":false,"description":"Wrap width (default 80)","schema":{"type":"string"}},{"name":"tab_width","in":"query","required":false,"description":"Indent width","schema":{"type":"string"}},{"name":"single_quote","in":"query","required":false,"description":"true for single quotes","schema":{"type":"string"}},{"name":"semi","in":"query","required":false,"description":"false to omit semicolons","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"parser":"babel","language":"js","formatted":"const x = [1, 2, 3].map((i) => i * 2);\nconsole.log(x);\n"},"meta":{"timestamp":"2026-06-02T16:51:56.844Z","request_id":"de384e7e-1662-47dc-863a-c918900fb65c"},"status":"ok","message":"Format code with Prettier","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/languages":{"get":{"operationId":"get_v1_languages","tags":["Reference"],"summary":"Supported languages","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":15,"parsers":["babel","flow","typescript","css","scss","less","graphql","vue","json5"],"languages":["js","javascript","jsx","babel","flow","ts","typescript","tsx","css","scss","less","graphql","gql","vue","json5"]},"meta":{"timestamp":"2026-06-02T16:51:56.950Z","request_id":"2f6b5ae1-f073-49f0-bdbb-44870d1ba8a6"},"status":"ok","message":"Supported languages","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":"Prettier API","note":"Format/beautify code with Prettier. /v1/format?code=...&language=js|ts|jsx|tsx|css|scss|less|graphql|vue (options: tab_width, print_width, semi, single_quote, use_tabs, trailing_comma). /v1/languages lists what's supported. Syntax errors return 422. Instant, nothing stored. Complements minify-api (the inverse) and the SQL/JSON/YAML/Markdown tools.","source":"Local code formatting (Prettier 3) — no key, no upstream","endpoints":3},"meta":{"timestamp":"2026-06-02T16:51:57.055Z","request_id":"c598fa8c-a6c0-402d-bd9a-ea1c1046d4c8"},"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":1380,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":560,"monthly_call_quota":22000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2520,"monthly_call_quota":170000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6120,"monthly_call_quota":870000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/prettier-api"}