{"openapi":"3.1.0","info":{"title":"SQL Formatter API","version":"1.0.0","description":"Format, beautify and minify SQL across 15+ dialects. Pass a query and get it pretty-printed with consistent indentation and keyword casing — for PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle (PL/SQL), BigQuery, Snowflake, Redshift, Spark, Trino, DuckDB, ClickHouse, DB2, Hive and standard SQL. Control the indent width and whether keywords are upper-cased, lower-cased or left as-is. A minify endpoint collapses a query to a single line (stripping comments while preserving string literals), and a dialects endpoint lists everything supported. Pure local processing — no key, no third-party service, instant. Live. 4 endpoints. Built for SQL editors and IDEs, query loggers, migration tooling, documentation and code review.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/sqlformat-api","description":"oanor gateway"}],"tags":[{"name":"SQL"},{"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":["SQL"],"summary":"Format / beautify SQL","description":"","parameters":[{"name":"sql","in":"query","required":true,"description":"SQL query","schema":{"type":"string"},"example":"select id,name from users where age>18 order by name"},{"name":"dialect","in":"query","required":false,"description":"postgresql|mysql|sqlite|tsql|bigquery|...","schema":{"type":"string"},"example":"postgresql"},{"name":"keyword_case","in":"query","required":false,"description":"upper|lower|preserve","schema":{"type":"string"}},{"name":"tab_width","in":"query","required":false,"description":"Indent width","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"dialect":"postgresql","formatted":"select\n  id,\n  name\nfrom\n  users\nwhere\n  age > 18\norder by\n  name"},"meta":{"timestamp":"2026-06-02T16:51:58.246Z","request_id":"32aad6d0-278e-4545-8d7a-ee2cdcec31d5"},"status":"ok","message":"Format SQL","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/minify":{"get":{"operationId":"get_v1_minify","tags":["SQL"],"summary":"Minify SQL","description":"","parameters":[{"name":"sql","in":"query","required":true,"description":"SQL query","schema":{"type":"string"},"example":"select id, name from users -- c\\nwhere age > 18"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"minified":"select id, name from users"},"meta":{"timestamp":"2026-06-02T16:51:58.353Z","request_id":"f1d5d167-12c5-42be-8d11-94c73cfe6b73"},"status":"ok","message":"Minify SQL","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/dialects":{"get":{"operationId":"get_v1_dialects","tags":["Reference"],"summary":"Supported dialects","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":21,"dialects":["bigquery","clickhouse","db2","db2i","duckdb","hive","mariadb","mysql","n1ql","plsql","postgresql","redshift","spark","sqlite","sql","tidb","trino","transactsql","tsql","singlestoredb","snowflake"]},"meta":{"timestamp":"2026-06-02T16:51:58.444Z","request_id":"952edcc2-b02f-43b6-b4de-11786dc9ab38"},"status":"ok","message":"Supported dialects","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":"SQL Formatter API","note":"Format/beautify SQL (/v1/format?sql=...&dialect=postgresql&keyword_case=upper&tab_width=2) across 15+ dialects (Postgres, MySQL, SQLite, BigQuery, Snowflake, T-SQL, …), and minify SQL to one line (/v1/minify, comments stripped, string literals preserved). /v1/dialects lists the dialects. Instant, nothing stored.","source":"Local SQL formatting (sql-formatter) — no key, no upstream","endpoints":4},"meta":{"timestamp":"2026-06-02T16:51:58.554Z","request_id":"366de6de-b72f-40dd-8ca2-c107f67b625d"},"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":1460,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":640,"monthly_call_quota":26000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2600,"monthly_call_quota":178000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6200,"monthly_call_quota":910000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/sqlformat-api"}