Enhance an image
Upscale, add detail, remove a background or extend the frame.
POST/v2/enhancementsReturns 202 straight away with the job and what it charged. Poll GET /v2/jobs/{id} for the result; a job that fails is refunded.
upscale, enhance and outpaint need an account that has topped up its API wallet. On an account that never has, they return 403 PLAN_REQUIRED and nothing is charged.| Kind | Does | Price |
|---|---|---|
| upscale | Enlarge a finished render for print and presentation boards. | $0.0198 per image |
| enhance | Add detail and realism to an existing render. | $0.297 per image |
| bg-remove | Cut a building or product out onto a transparent background. | $0.0297 per image |
| outpaint | Widen the frame beyond the original image. | $0.0594 per image |
Headers
AuthorizationstringRequiredBearer mk_live_…: your API key. See Authentication.Content-TypestringRequiredapplication/json, ormultipart/form-datato send a file.Idempotency-Keystring- Your own key, 1 to 255 visible ASCII characters. A retry with the same key and request within 24 hours returns the first answer instead of running again.
Body
kindstringRequired- What to do to the image.
upscaleenhancebg-removeoutpaint imagestring- The JPEG, PNG or WebP to work on, up to 15 MB: a public
https://link we fetch, adata:image/…;base64,URI, or bare base64. With multipart form data, attach the file itself (-F [email protected]). Send one ofimageorjob_id. job_idstring- A finished job of yours: work on its output without downloading it first.
creativityintegerenhanceonly: 0 keeps closest to the image, 100 reinvents the most.promptstringenhanceoroutpaintonly: a direction, in plain words.aspect_ratiostringoutpaintonly, and required there: the shape to extend the image to.1:13:24:35:416:921:92:33:44:59:16webhook_urlstring- A public
https://URL to send this job’s settle event to, signed like every webhook, on top of your account’s endpoints.
Response
On success (202): Started. Poll GET /v2/jobs/{id} for the result. The JSON is { "success": true, "data": … }, and inside data:
idstringRequired- The job. Read it at GET /v2/jobs/{id}.
statusstringRequired- The job’s status when it was accepted, usually
queued.queuedprocessingsucceededfailedcanceled charged_usdnumberRequired- What this call charged, in US dollars. A job that fails is refunded.
replayedbooleanRequired- True when this is the stored answer to an earlier identical request with the same
Idempotency-Key: nothing ran or was charged again. See Idempotency. notesstring[]Required- What was accepted but not applied, in plain words: a setting that does not fit the engine, a seed it does not take. Empty when everything applied.
Response headers (5)
X-Request-Idstring- This request, for support and the console log.
RateLimit-Limitinteger- Requests this key may make per minute.
RateLimit-Remaininginteger- Requests left in the current minute.
RateLimit-Resetinteger- Seconds until the current minute resets.
Idempotent-Replayedstring- Present, as
true, when this is the stored answer to an earlier request.
Status codes
- 202
- Started. Poll GET /v2/jobs/{id} for the result.
- 401
- The API key is missing, malformed, unknown or revoked.
- 402
- The balance does not cover this call.
- 409
- The Idempotency-Key was reused for a different request, or is still in progress.
- 429
- A limit was reached: requests per minute, or a daily or concurrency limit.
- Other
- Any other error, in the same envelope.
Every error answers { "success": false, "error": { "code", "message" } }. What each code means, and what to do, is on Errors.