{"openapi":"3.1.0","info":{"title":"Gradient API","version":"1.0.0","description":"Generate colour gradients and colour scales programmatically. Produce an evenly-spaced scale of N colours between two or more stops (interpolated in a perceptually smooth colour space — lab, lch, oklab, oklch — or plain rgb/hsl), get a single interpolated colour at any position between two colours, and build a ready-to-paste CSS gradient string (linear with any angle, or radial) from a list of stops. Colours accept hex (#f00, #ff0000) or CSS names (red, steelblue). Perfect for data-visualisation colour ramps, heatmaps, chart palettes, theme generation and UI backgrounds. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. Distinct from colour conversion / harmonious palettes (one base colour) and image palette extraction.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/gradient-api","description":"oanor gateway"}],"tags":[{"name":"Gradient"},{"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/css":{"get":{"operationId":"get_v1_css","tags":["Gradient"],"summary":"Build a CSS gradient string","description":"","parameters":[{"name":"colors","in":"query","required":true,"description":"Comma-separated stops","schema":{"type":"string"},"example":"#ff0000,#00ff00,#0000ff"},{"name":"type","in":"query","required":false,"description":"linear|radial (default linear)","schema":{"type":"string"},"example":"linear"},{"name":"angle","in":"query","required":false,"description":"Angle in degrees for linear (default 90)","schema":{"type":"string"},"example":"45"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"css":"linear-gradient(45deg, #ff0000 0%, #00ff00 50%, #0000ff 100%)","type":"linear","angle":45,"stops":["#ff0000 0%","#00ff00 50%","#0000ff 100%"]},"meta":{"timestamp":"2026-06-02T16:51:48.368Z","request_id":"f094b430-959e-4e2f-8e7d-fed66867a25e"},"status":"ok","message":"Build a CSS gradient","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/interpolate":{"get":{"operationId":"get_v1_interpolate","tags":["Gradient"],"summary":"Interpolate between two colours","description":"","parameters":[{"name":"colors","in":"query","required":true,"description":"Exactly two stops","schema":{"type":"string"},"example":"black,white"},{"name":"t","in":"query","required":true,"description":"Position 0-1","schema":{"type":"string"},"example":"0.5"},{"name":"mode","in":"query","required":false,"description":"Colour space (default lab)","schema":{"type":"string"},"example":"lab"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"t":0.5,"to":"white","hex":"#777777","rgb":[119,119,119],"from":"black","mode":"lab"},"meta":{"timestamp":"2026-06-02T16:51:48.468Z","request_id":"ac4620cc-6edb-4fc3-942e-3f57c5602207"},"status":"ok","message":"Interpolate between two colours","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/scale":{"get":{"operationId":"get_v1_scale","tags":["Gradient"],"summary":"Generate a colour scale","description":"","parameters":[{"name":"colors","in":"query","required":true,"description":"Comma-separated stops (hex or CSS names)","schema":{"type":"string"},"example":"red,yellow,green"},{"name":"steps","in":"query","required":false,"description":"Number of colours 2-256 (default 7)","schema":{"type":"string"},"example":"5"},{"name":"mode","in":"query","required":false,"description":"rgb|lrgb|hsl|hsv|lab|lch|oklab|oklch (default lab)","schema":{"type":"string"},"example":"lab"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"mode":"lab","steps":5,"colors":["#ff0000","#ffa100","#ffff00","#91bf00","#008000"],"input_colors":["red","yellow","green"]},"meta":{"timestamp":"2026-06-02T16:51:48.584Z","request_id":"ea1c8a8e-4578-4b53-b2ad-a7d338bbfa9b"},"status":"ok","message":"Generate a colour scale","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":"Gradient API","notes":"Interpolating in lab/lch/oklab/oklch is perceptually smoother than rgb. Colours accept hex (#rgb, #rrggbb) or CSS names.","version":"v1","endpoints":[{"path":"/v1/scale","params":{"mode":"rgb|lrgb|hsl|hsv|lab|lch|oklab|oklch, default lab","steps":"2-256, default 7","colors":"comma-separated stops (required)"},"returns":"array of N hex colours"},{"path":"/v1/interpolate","params":{"t":"0-1 (required)","mode":"colour space, default lab","colors":"exactly two stops (required)"},"returns":"a single interpolated colour"},{"path":"/v1/css","params":{"type":"linear|radial","angle":"degrees (linear, default 90)","colors":"comma-separated stops (required)"},"returns":"a CSS gradient string + stops"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Generate colour gradients and scales — interpolate between colour stops in a chosen colour space, produce evenly-spaced colour scales, and build ready-to-use CSS gradient strings. Powered by chroma-js. Pure local, no key."},"meta":{"timestamp":"2026-06-02T16:51:48.693Z","request_id":"6a3c718b-30a9-473d-a01c-9a943b6371ac"},"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":1000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":230,"monthly_call_quota":8500,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2140,"monthly_call_quota":137000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5740,"monthly_call_quota":705000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/gradient-api"}