🔑 Business plan feature

API Documentation

Call any tool directly from your own code or app — no browser, no manual uploads. Available on the Business plan.

Authentication Getting your key Background Remover Image Upscaler Watermark Remover Image Expander Job status Bulk upload Errors

Getting your API key

Generate a key from your dashboard — Business plan only. The full key is shown once, right when you generate it; after that, only a masked preview is shown. Keys expire after 30 days and can be regenerated anytime.

Authentication

Include your API key in every request using the X-API-Key header:

curl -X POST https://your-domain.com/api/tools/bg-remove \ -H "X-API-Key: avt_live_your_key_here" \ -F "image=@photo.png"

A missing or invalid key returns a 401 response. An expired key is treated the same as an invalid one — generate a new one from your dashboard.

Endpoints

POST

/api/tools/bg-remove

Removes the background from an image. Costs 1 credit.

Request (multipart/form-data)

FieldTypeRequiredNotes
imagefileYesPNG, JPG, or WebP — max 15MB

Response

{ "success": true, "jobId": 1234 }

Processing happens asynchronously — use the jobId with GET /api/jobs/:id to check status and get the result.

POST

/api/tools/upscale

Upscales an image 2× or 4× with AI detail reconstruction. Costs 1 credit.

Request (multipart/form-data)

FieldTypeRequiredNotes
imagefileYesPNG, JPG, or WebP — max 15MB
scalenumberNo2 or 4 — defaults to 4

Response

{ "success": true, "jobId": 1235 }
POST

/api/tools/watermark-remove

Automatically detects and removes a watermark — no manual masking needed. Costs 2 credits.

Request (multipart/form-data)

FieldTypeRequiredNotes
imagefileYesPNG, JPG, or WebP — max 15MB

Response

{ "success": true, "jobId": 1236 }

The result's outputUrl (once the job completes) is a data: URL containing the image directly, rather than a hosted link.

POST

/api/tools/expand

Extends a photo's edges with AI-generated content matching the original. Costs 2 credits.

Request (multipart/form-data)

FieldTypeRequiredNotes
imagefileYesYour image, pre-padded with blank space on the sides you want to extend
maskfileYesWhite = area to generate, black = keep original — same dimensions as image
promptstringNoCustom guidance for the AI — a sensible default is used if omitted

Response

{ "success": true, "jobId": 1237 }

Building the padded image and mask requires some image manipulation on your end before calling this endpoint — see how the Image Expander tool itself constructs them if you need a reference.

GET

/api/jobs/:id

Checks the status of a job created by any of the endpoints above. Poll this every 2-3 seconds until the status is no longer "processing".

Rate limit

Max 10 requests per 5 seconds per key — comfortably covers polling every 2-3 seconds from several tabs at once, while still catching a runaway loop. Exceeding it returns a 429.

Response — while processing

{ "success": true, "status": "processing" }

Response — completed

{ "success": true, "status": "completed", "outputUrl": "https://replicate.delivery/..." }

Response — failed

{ "success": true, "status": "failed", "error": "..." }

Credits are only ever deducted on a successful completion — a failed job never costs anything.

POST

/api/tools/bulk-upload

Processes up to 10 images at once with the same tool. Available on Pro and Business plans.

Request (multipart/form-data)

FieldTypeRequiredNotes
toolstringYesbg-remove, upscale, or watermark-remove
imagesfile[]YesUp to 10 files, same field name repeated

Response

{ "success": true, "jobs": [ { "jobId": 1, "filename": "a.png" }, { "jobId": 2, "filename": "b.png" } ] }

Check each job individually with GET /api/jobs-batch?ids=1,2 — a single request covering multiple jobs, rather than polling each one separately.

Errors

StatusMeaning
400Missing or invalid request field (e.g. no image uploaded)
401Missing, invalid, or expired API key
402Not enough credits for this request
403Your plan doesn't include this feature (e.g. bulk upload on Free)
413File too large — 15MB max per image
429Too many requests to the job status endpoint — max 10 per 5 seconds per key
500Something went wrong on our end — safe to retry

Every error response has the shape { "success": false, "error": "..." }.