Authentication
Every request to /v1/ needs an API Key in the X-API-Key header. Result Links are the only exception. A key in the URL is rejected with key_in_url. Errors always come back as JSON with code, message and request_id, also when you asked for an image.
curl -X POST 'https://synthflux.synthetixmind.com/v1/transform' -H 'X-API-Key: sf_YOUR_KEY' -F '[email protected]' -o photo.webp
Batch
POST/v1/batch
Process 2 to 50 images with one parameter set. Upload 2 to 50 files in the multipart field files (repeat the field). The answer is JSON with one Result Link to a ZIP that holds the Output Images and report.json. Failed files are listed in the report; the request fails only when every file fails. Batches above the Async Threshold (default 50 MB) run as a Job.
Needs an API Key in the X-API-Key header.
| Parameter | Type | Default | Allowed values | Description |
files | binary | required | 2-50 files | Source Images (multipart field files, repeated). |
format | string | webp | webp, avif, original | Output format. original keeps JPEG, PNG or SVG (minified). |
quality | string | medium | low, medium, high, 1-100 | Strength of lossy compression. |
ratio | string | none | W:H, 1-100 each | Crop to the largest area of this aspect ratio, e.g. 16:9. |
focus | string | center | center, point, detail | Crop Focus: the middle, a point (x, y) or the most detailed area. |
x | integer | 50 | 0-100 | Horizontal focus point in percent (focus=point). |
y | integer | 50 | 0-100 | Vertical focus point in percent (focus=point). |
width | integer | none | 1-16384 | Target width in pixels. |
height | integer | none | 1-16384 | Target height in pixels. |
fit | string | contain | contain, cover, fill | With width and height: fit inside, fill and crop, or stretch. |
upscale | boolean | false | true, false | Allow output larger than the source. |
keep_exif | boolean | false | true, false | Keep EXIF data (orientation set to normal). Default removes EXIF, XMP, IPTC and GPS. |
preset | string | none | a Preset name | Applies a stored Preset; parameters in the request override it. |
webhook_url | string | none | https URL, public host | Called once when a Job ends (requests above the Async Threshold). |
Responses
- 200 (application/json): JSON with url, expires_at, files, done, failed, byte counts and report.
- 202 (application/json): JSON with job_id: the batch runs as a Job.
Errors
| HTTP | Code | When |
|---|
| 400 | key_in_url | An API Key was sent in the query string. |
| 401 | invalid_key | No API Key, or an unknown one. |
| 403 | key_disabled | The API Key is disabled. |
| 403 | key_expired | The API Key is past its expiry date. |
| 429 | rate_limited | The key's Rate Limit is used up; Retry-After gives the seconds to wait. |
| 429 | quota_exceeded | The key's Monthly Quota is used up; it resets on the 1st at 00:00 UTC. |
| 500 | internal | An unexpected server error; quote request_id. |
| 400 | invalid_parameter | A parameter is unknown or out of range; the message names it. |
| 400 | preset_not_found | No Preset has that name. |
| 400 | webhook_url_not_allowed | webhook_url is not https or resolves to a loopback, private or link-local address. |
| 400 | file_missing | The request has no file, or a batch has fewer than 2 or more than 50 files. |
| 413 | file_too_large | One file is larger than the file size limit (default 25 MB). |
| 413 | request_too_large | The whole request is larger than the maximum request size (default 95 MB; 1 MB = 1,048,576 bytes). Requests above about 100 MB are refused by the CDN in front of this instance with its own HTML 413 page, before they reach SynthFlux. |
| 422 | all_files_failed | Every file of a batch failed; report lists the reason per file. |
Example
curl -X POST 'https://synthflux.synthetixmind.com/v1/batch?preset=thumb' -H 'X-API-Key: sf_YOUR_KEY' -F '[email protected]' -F '[email protected]'
Example response
{"url":"https://synthflux.synthetixmind.com/v1/results/Tq3...","expires_at":"2026-12-02T13:00:00.000Z","files":2,"done":2,"failed":0,"source_bytes":4194304,"output_bytes":524288,"saved_percent":87.5,"report":[...]}
Jobs
GET/v1/jobs/{job_id}
Read the status of a Job. Status queued, processing, done (with result) or failed (with error_code). Only the API Key that created the Job can read it; other keys get 404.
Needs an API Key in the X-API-Key header.
| Parameter | Type | Default | Allowed values | Description |
job_id | string | required | UUID | From the HTTP 202 answer. |
Responses
- 200 (application/json): JSON with job_id, status, created_at, updated_at, result or error_code.
Errors
| HTTP | Code | When |
|---|
| 400 | key_in_url | An API Key was sent in the query string. |
| 401 | invalid_key | No API Key, or an unknown one. |
| 403 | key_disabled | The API Key is disabled. |
| 403 | key_expired | The API Key is past its expiry date. |
| 429 | rate_limited | The key's Rate Limit is used up; Retry-After gives the seconds to wait. |
| 429 | quota_exceeded | The key's Monthly Quota is used up; it resets on the 1st at 00:00 UTC. |
| 500 | internal | An unexpected server error; quote request_id. |
| 404 | not_found | Unknown route, Job or Result Link. |
Example
curl 'https://synthflux.synthetixmind.com/v1/jobs/3f2b8c1e-5d4a-4b6f-9e1c-7a8d9b0c1d2e' -H 'X-API-Key: sf_YOUR_KEY'
Example response
{"job_id":"3f2b8c1e-5d4a-4b6f-9e1c-7a8d9b0c1d2e","status":"done","result":{"url":"https://synthflux.synthetixmind.com/v1/results/Tq3..."}}
Result Links
GET/v1/results/{token}
Download a result file. No API Key needed: the random token is the access. Files are kept for the Retention Time (default 1 hour), then the link answers 410 and the file is deleted within 5 minutes.
No API Key needed.
| Parameter | Type | Default | Allowed values | Description |
token | string | required | token from a Result Link | Last part of the Result Link. |
Responses
- 200 (application/octet-stream): The file (image or ZIP).
Errors
| HTTP | Code | When |
|---|
| 404 | not_found | Unknown route, Job or Result Link. |
| 410 | gone | The Result Link's Retention Time has ended. |
Example
curl -O 'https://synthflux.synthetixmind.com/v1/results/Tq3...'
Example response
HTTP/1.1 200 OK
Content-Type: image/webp
<binary>
Health
GET/health
Readiness. 200 when the instance accepts requests, 503 while it starts or stops. No API Key needed.
No API Key needed.
Responses
- 200 (application/json): {"status":"ok"}
- 503 (application/json): {"status":"starting"}
Example
curl https://synthflux.synthetixmind.com/health
Example response
{"status":"ok"}
Limits and retention
- File size limit
- 25 MB
- Pixel limit
- 50 megapixels
- Maximum total request size
- 95 MB
- Retention Time
- 60 minutes
- Async Threshold
- 50 MB
Files are deleted when the response is sent. Files behind Result Links are deleted no later than 5 minutes after the Retention Time.
Webhooks
Requests above the Async Threshold run as a Job (HTTP 202 with job_id). With webhook_url (https, public host), SynthFlux sends one POST when the Job ends: {"job_id", "status", "result_url" or "error_code"}. If the call doesn't answer 2xx within 10 seconds, it is retried after 1, 5 and 15 minutes, then stops.
The header X-SynthFlux-Signature holds the lowercase hex HMAC-SHA256 of the raw body, keyed with your API Key value. Check it before you trust the call:
import { createHmac, timingSafeEqual } from "node:crypto";
function isFromSynthFlux(rawBody, signatureHeader, apiKey) {
const expected = createHmac("sha256", apiKey).update(rawBody).digest("hex");
return expected.length === signatureHeader.length
&& timingSafeEqual(Buffer.from(expected), Buffer.from(signatureHeader));
}
Error codes
| HTTP | Code | When |
|---|
| 400 | key_in_url | An API Key was sent in the query string. |
| 400 | invalid_parameter | A parameter is unknown or out of range; the message names it. |
| 400 | preset_not_found | No Preset has that name. |
| 400 | format_not_supported | format=original for GIF, WebP, TIFF, BMP, AVIF or HEIC sources. |
| 400 | animation_not_supported | AVIF output was requested for an animated image. |
| 400 | webhook_url_not_allowed | webhook_url is not https or resolves to a loopback, private or link-local address. |
| 400 | file_missing | The request has no file, or a batch has fewer than 2 or more than 50 files. |
| 401 | invalid_key | No API Key, or an unknown one. |
| 403 | key_disabled | The API Key is disabled. |
| 403 | key_expired | The API Key is past its expiry date. |
| 404 | not_found | Unknown route, Job or Result Link. |
| 410 | gone | The Result Link's Retention Time has ended. |
| 413 | file_too_large | One file is larger than the file size limit (default 25 MB). |
| 413 | request_too_large | The whole request is larger than the maximum request size (default 95 MB; 1 MB = 1,048,576 bytes). Requests above about 100 MB are refused by the CDN in front of this instance with its own HTML 413 page, before they reach SynthFlux. |
| 415 | unsupported_format | The file is not JPEG, PNG, GIF, WebP, TIFF, BMP, AVIF, HEIC/HEIF or SVG. |
| 422 | invalid_image | The file can't be decoded (for example truncated). |
| 422 | image_too_large | The image has more pixels than the pixel limit (default 50 megapixels). |
| 422 | all_files_failed | Every file of a batch failed; report lists the reason per file. |
| 429 | rate_limited | The key's Rate Limit is used up; Retry-After gives the seconds to wait. |
| 429 | quota_exceeded | The key's Monthly Quota is used up; it resets on the 1st at 00:00 UTC. |
| 500 | internal | An unexpected server error; quote request_id. |
| 503 | busy | The server is starting or shutting down; retry shortly. |
Transform parameters at a glance
format, quality, ratio, focus, x, y, width, height, fit, upscale, keep_exif, widths, placeholder, preset, response, webhook_url. Defaults: WebP, quality medium, no crop, no resize, metadata removed, sRGB.