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.

BASE URL
https://api.hazefix.com

This 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.

AUTH HEADER
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.

image
filerequired

The image to fix — png, jpeg or webp, up to 24 MB.

preset
string

One of logo, clipart (default), illustration, lineart. Sets the palette size and export defaults.

k
integer · 2–64

Palette-size override. Leave unset to use the preset value.

upscale
boolean · default true

Run the illustration-tuned 4× GPU upscale (stage C).

svg
boolean · default true

Trace a true SVG from the quantized result (stage E).

CURL
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"
202 ACCEPTED
{  "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
curl -s https://api.hazefix.com/api/v1/jobs/$JOB_ID \  -H "Authorization: Bearer $HAZEFIX_API_KEY"
200 OK
{  "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.

CURL
# 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

PRESETKBEST FOR
logo12Few bold colors, SVG-first
clipart24Transparent PNG + SVG, POD-ready
illustration48Richer palette, poster-grade
lineart2Pure black & white line art

Errors

Errors return a JSON body of the shape { error: { code, message } }.

STATUSCODEMEANING
400invalid_requestMalformed body, unknown preset, or k outside 2–64.
401unauthorizedMissing or invalid API key.
404not_foundUnknown job id or output file.
413too_largeImage exceeds 24 MB.
415unsupported_typeInput must be png, jpeg or webp.
429rate_limitedMonthly plan quota exceeded — upgrade at /pricing.
500processing_failedThe 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.