API reference

Run HazeFix from your code.

Submit an image to the full de-haze, flatten, 4× upscale, quantise and SVG trace pipeline. Create a job, poll its status, then download the files through three REST endpoints.

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 time varies with image dimensions, preset, queue load and whether the GPU pass is enabled; poll the job endpoint instead of assuming a fixed duration.

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 it unset to use the preset value.

upscale
boolean · default true

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

svg
boolean · default true

Trace an editable SVG from the reduced-palette result (stage E).

CURL
curl -s https://api.hazefix.com/api/v1/jobs \  -H "Authorization: Bearer $HAZEFIX_API_KEY" \  -F "image=@./input.png" \  -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 output metrics and per-stage timings for monitoring or automated checks. The values below illustrate the response shape; actual metrics and timings come from each job.

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 Free and 30 days on the API plan. Pro is not currently available.

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 colours, 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 — see /pricing for current plan availability.
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; API usage is metered). Going over returns 429 rate_limited. The API plan is uncapped and metered per image, with volume pricing at 10,000+ images a month.