API reference
HazeFix API
The full pipeline — de-haze, flatten, 4× upscale, quantize, SVG trace — behind three REST endpoints. Create a job, poll it, download the files.
https://api.hazefix.comThis is the only supported origin — there is no same-origin fallback. The web Studio talks to it too, via a signed-in session cookie instead of a bearer key.
Authentication
Pass your key as a bearer token on every request. Create keys from your account dashboard — the full secret is shown once, on creation. Keys are metered at ~$0.03 per completed image on the API plan; failed jobs are never billed.
Authorization: Bearer hzfx_live_…Create a job
POST/api/v1/jobs
Send the image as multipart/form-data. Returns 202 Accepted immediately; processing typically finishes in 15–30 seconds with the GPU pass, under 10 without it.
imageThe image to fix — png, jpeg or webp, up to 24 MB.
presetOne of logo, clipart (default), illustration, lineart. Sets the palette size and export defaults.
kPalette-size override. Leave unset to use the preset value.
upscaleRun the illustration-tuned 4× GPU upscale (stage C).
svgTrace a true SVG from the quantized result (stage E).
curl -s https://api.hazefix.com/api/v1/jobs \ -H "Authorization: Bearer $HAZEFIX_API_KEY" \ -F "[email protected]" \ -F "preset=clipart" \ -F "upscale=true" \ -F "svg=true"
{ "id": "9f2b1c4e-6a1d-4c3b-9e7f-2d8a5b1c4e6f", "object": "job", "status": "processing", "created_at": "2026-07-12T14:31:07.412Z", "preset": "clipart", "options": { "k": 24, "upscale": true, "svg": true }, "warnings": [], "error": null, "result": null}
Poll a job
GET/api/v1/jobs/:id
Poll every second or two until status is done or error. Finished jobs include before/after quality metrics and per-stage timings — useful for asserting output quality in automated flows.
curl -s https://api.hazefix.com/api/v1/jobs/$JOB_ID \ -H "Authorization: Bearer $HAZEFIX_API_KEY"
{ "id": "9f2b1c4e-6a1d-4c3b-9e7f-2d8a5b1c4e6f", "object": "job", "status": "done", "preset": "clipart", "options": { "k": 24, "upscale": true, "svg": true }, "warnings": [], "error": null, "result": { "metrics": { "before": { "size": "1024x1536", "unique_colors": 77914, "black_point": 9.4, "white_point": 250.6 }, "after": { "size": "4096x6144", "unique_colors": 32, "black_point": 0.0, "white_point": 255.0 } }, "timings": { "t_dehaze_flatten_s": 0.9, "t_upscale_s": 12.4, "t_quantize_s": 4.1, "t_svg_s": 3.8 }, "files": { "png": "/api/v1/jobs/9f2b1c4e-…/files/img1_final.png", "svg": "/api/v1/jobs/9f2b1c4e-…/files/img1_final.svg" } }}
Download output
GET/api/v1/jobs/:id/files/:name
File names come from result.files on the job. Outputs are retained for 24 hours on the free tier, 30 days on Pro and API plans.
# stream the PNG (add ?download=1 for a Content-Disposition attachment)curl -sL "https://api.hazefix.com/api/v1/jobs/$JOB_ID/files/img1_final.png" \ -H "Authorization: Bearer $HAZEFIX_API_KEY" -o fixed.pngcurl -sL "https://api.hazefix.com/api/v1/jobs/$JOB_ID/files/img1_final.svg" \ -H "Authorization: Bearer $HAZEFIX_API_KEY" -o fixed.svg
Presets
| PRESET | K | BEST FOR |
|---|---|---|
| logo | 12 | Few bold colors, SVG-first |
| clipart | 24 | Transparent PNG + SVG, POD-ready |
| illustration | 48 | Richer palette, poster-grade |
| lineart | 2 | Pure black & white line art |
Errors
Errors return a JSON body of the shape { error: { code, message } }.
| STATUS | CODE | MEANING |
|---|---|---|
| 400 | invalid_request | Malformed body, unknown preset, or k outside 2–64. |
| 401 | unauthorized | Missing or invalid API key. |
| 404 | not_found | Unknown job id or output file. |
| 413 | too_large | Image exceeds 24 MB. |
| 415 | unsupported_type | Input must be png, jpeg or webp. |
| 429 | rate_limited | Monthly plan quota exceeded — upgrade at /pricing. |
| 500 | processing_failed | The pipeline failed on this input — you are not billed. |
Rate limits
Every request — bearer key or session cookie — is metered against your account’s monthly quota (10 images on Free, 500 on Pro). Going over returns 429 rate_limited. Need more? The API plan is uncapped and metered per image, with volume pricing at 10k+ images a month.