{"openapi":"3.1.0","info":{"title":"SVG Optimizer API","version":"1.0.0","description":"Shrink and clean SVG files automatically with SVGO, the industry-standard SVG optimiser. The optimize endpoint strips comments, metadata, editor cruft and redundant attributes, collapses and merges paths, and returns minified markup together with the original and optimised byte sizes and the percentage saved — typically 30-60% smaller. The data-uri endpoint goes one step further and returns a ready-to-paste CSS data URI (URL-encoded or base64) plus the matching background-image rule, so you can inline icons without an extra HTTP request. Perfect for build pipelines, icon systems, design tooling, email and embedding SVGs in CSS. Pure local processing — no key, no third-party service, instant; send markup via POST for large files (up to 2 MB). Live, nothing stored. 3 endpoints. Distinct from raster image compression, QR/code generation and JSON/HTML formatting.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/svgo-api","description":"oanor gateway"}],"tags":[{"name":"SVG"},{"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/datauri":{"get":{"operationId":"get_v1_datauri","tags":["SVG"],"summary":"SVG to CSS data URI","description":"","parameters":[{"name":"svg","in":"query","required":true,"description":"SVG markup","schema":{"type":"string"},"example":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\"><!-- icon --><rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"#ff0000\"/></svg>"},{"name":"encoding","in":"query","required":false,"description":"uri|base64 (default uri)","schema":{"type":"string"},"example":"uri"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"css":"background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath fill='red' d='M0 0h100v100H0z'/%3E%3C/svg%3E\");","datauri":"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath fill='red' d='M0 0h100v100H0z'/%3E%3C/svg%3E","encoding":"uri","optimized_bytes":109},"meta":{"timestamp":"2026-06-02T16:51:47.361Z","request_id":"b6c55ece-4955-4cab-b44d-73caf33b94ae"},"status":"ok","message":"SVG to CSS data URI","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/optimize":{"get":{"operationId":"get_v1_optimize","tags":["SVG"],"summary":"Optimize SVG markup","description":"","parameters":[{"name":"svg","in":"query","required":true,"description":"SVG markup","schema":{"type":"string"},"example":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\"><!-- icon --><rect x=\"0\" y=\"0\" width=\"100\" height=\"100\" fill=\"#ff0000\"/></svg>"},{"name":"multipass","in":"query","required":false,"description":"true/false (default true)","schema":{"type":"string"},"example":"true"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"multipass":true,"optimized":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\"><path fill=\"red\" d=\"M0 0h100v100H0z\"/></svg>","saved_bytes":34,"saved_percent":23.8,"original_bytes":143,"optimized_bytes":109},"meta":{"timestamp":"2026-06-02T16:51:47.486Z","request_id":"96b27d68-7100-45e9-b086-7e510065f5dc"},"status":"ok","message":"Optimize SVG markup","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":"SVG Optimizer API","notes":"Max input 2 MB. Uses SVGO's default preset (removes comments, metadata, redundant attributes; merges paths). Send markup via POST for large files.","version":"v1","endpoints":[{"path":"/v1/optimize","params":{"svg":"SVG markup (required)","multipass":"true/false, default true"},"returns":"optimised SVG + byte sizes + savings"},{"path":"/v1/datauri","params":{"svg":"SVG markup (required)","encoding":"uri|base64 (default uri)","multipass":"default true"},"returns":"a data: URI + ready CSS rule"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Minify and clean SVG markup with SVGO, and turn an SVG into a CSS-ready data URI. Pure local, no key."},"meta":{"timestamp":"2026-06-02T16:51:47.593Z","request_id":"357f8ba3-dff6-41b4-a907-a2fcd6d77262"},"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":960,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":210,"monthly_call_quota":8100,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2100,"monthly_call_quota":135000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5700,"monthly_call_quota":695000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/svgo-api"}