---
title: HazeFix API reference
canonical: https://hazefix.com/developers/
description: Create HazeFix jobs, poll status and download PNG or SVG output through three REST operations.
---

# HazeFix API reference

Base URL: `https://api.hazefix.com`

Machine-readable contract: https://hazefix.com/openapi.json

## Authentication

Pass a HazeFix API key on every request:

```http
Authorization: Bearer hzfx_live_…
```

Signed-in users create and revoke keys from https://hazefix.com/account/. The full key is shown once. OAuth, OpenID Connect and automated agent registration are not currently supported.

## Create a job

`POST /api/v1/jobs` with `multipart/form-data` returns `202 Accepted`.

Fields:

- `image` — required PNG, JPEG or WebP file, up to 24 MB.
- `preset` — `logo`, `clipart`, `illustration` or `lineart`; default `clipart`.
- `k` — optional palette-size integer from 2 to 64.
- `upscale` — optional boolean, default `true`.
- `svg` — optional boolean, default `true`.

```sh
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"
```

## Poll a job

`GET /api/v1/jobs/{id}` returns the job. Poll until `status` is `done` or `error`. Processing time varies with the image, preset and current service conditions; do not assume a fixed duration.

Completed jobs include their own output metrics, stage timings and file paths.

## Download output

`GET /api/v1/jobs/{id}/files/{name}` returns a file listed by the completed job. Add `?download=1` to request an attachment response.

## Errors

Errors use the shape:

```json
{ "error": { "code": "unauthorized", "message": "Missing or invalid API key." } }
```

Documented status codes include 400, 401, 404, 413, 415, 429 and 500.

## Availability and retention

The API is documented at $0.03 per completed image, with failed jobs not billed. Output retention is documented as 24 hours on Free and 30 days on the API plan. Check the canonical HTML documentation for current service details.
