{"openapi":"3.1.0","info":{"title":"Swatch Palette Remap","version":"1.0.0","description":"Map source swatches to the nearest color in an approved palette using RGB channel distance and report threshold failures.","contact":{"email":"jeremy@jeremycarter.ca"}},"servers":[{"url":"https://gptenv-x402-catalog.defcronyke.workers.dev"}],"paths":{"/swatch-palette-remap/v1/check":{"post":{"operationId":"swatch_palette_remap","summary":"Map source swatches to the nearest color in an approved palette using RGB channel distance and report threshold failures.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.04"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"hex":{"type":"string","pattern":"^#[\\da-fA-F]{6}$"}},"required":["id","hex"],"additionalProperties":false}},"palette":{"minItems":1,"maxItems":120,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"hex":{"type":"string","pattern":"^#[\\da-fA-F]{6}$"}},"required":["id","hex"],"additionalProperties":false}},"max_channel_distance":{"type":"number","minimum":0,"maximum":442}},"required":["source","palette","max_channel_distance"],"additionalProperties":false},"example":{"source":[{"id":"a","hex":"#0F1012"},{"id":"b","hex":"#ffffff"}],"palette":[{"id":"dark","hex":"#101010"},{"id":"neutral","hex":"#808080"}],"max_channel_distance":10}}}},"responses":{"200":{"description":"Service result","content":{"application/json":{"schema":{"type":"object"},"example":{"mapped":[{"source":"a","palette":"dark","distance":2.24}],"unmapped":[{"source":"b","nearest":"neutral","distance":219.97}]}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 exact payment required on Base"},"503":{"description":"Payment unavailable"}}}}}}