API reference · Tools

Image tools

Upscale an image, remove its background or inpaint part of it. Each call returns a job straight away.

POST https://api.framera.ai/v1/tools/upscale
POST https://api.framera.ai/v1/tools/remove-background
POST https://api.framera.ai/v1/tools/inpaint

Background removal is $0.025 an image; upscales start at $0.11. Charged on success at the tool prices. Get the exact price first with POST /v1/quotes, product: "tool" and the operation. Needs the tools permission.

Headers

Authorizationstringrequired
Bearer fr_live_….
Idempotency-Keystring
Any unique string up to 200 characters. Retrying with the same key returns the first job instead of making a second one. The SDKs set one for you.

Upscale

POST /v1/tools/upscale makes an image two or four times larger, with results up to 512 megapixels. The price follows the size of the result: $0.11 up to 24 MP, $0.22 up to 48 MP, $0.43 up to 96 MP, $1.83 up to 512 MP.

imagestringrequired
The image to upscale: a public https URL or an upload_… id from POST /v1/uploads.
factorinteger
2 (default) or 4.
webhookUrlstring
A public https URL. We POST a signed job.succeeded, job.failed or job.cancelled event to it when the job finishes.
metadataobject
Up to 20 string values of your own (keys up to 40 characters, values up to 500), such as an order id. Returned on the job and in webhooks.

Remove background

POST /v1/tools/remove-background cuts out the subject and returns an image with a transparent background, for $0.025.

imagestringrequired
The image: a public https URL or an upload_… id from POST /v1/uploads.
webhookUrlstring
A public https URL. We POST a signed job.succeeded, job.failed or job.cancelled event to it when the job finishes.
metadataobject
Up to 20 string values of your own (keys up to 40 characters, values up to 500), such as an order id. Returned on the job and in webhooks.

Inpaint

POST /v1/tools/inpaint repaints the part of an image a mask marks, following a prompt, for $0.068 a megapixel per image, on images up to 16 megapixels.

imagestringrequired
The image to change: a public https URL or an upload_… id from POST /v1/uploads.
maskstringrequired
A black and white image exactly the same size as image; white marks what to repaint.
promptstringrequired
What to paint in the masked area. Up to 2,000 characters.
countinteger
How many versions to make, 1 (default) to 4.
webhookUrlstring
A public https URL. We POST a signed job.succeeded, job.failed or job.cancelled event to it when the job finishes.
metadataobject
Up to 20 string values of your own (keys up to 40 characters, values up to 500), such as an order id. Returned on the job and in webhooks.

Returns

201 Created with a job object: status: "queued", the settings you sent and its price. The job carries operation; upscales and inpaints also carry the image's width and height.

Errors

StatusCodeWhen
400invalid_requestA field is missing, wrong or out of range. The message says which; details.issues lists the fields.
401unauthorizedThe key is missing, wrong or revoked.
402insufficient_balanceYour balance is lower than the price. Top up or turn on auto-recharge.
403permission_deniedThe key lacks the permission, a monthly limit would be passed, or the address is not allowed. details.reason says which: key_permission, key_monthly_limit, monthly_limit or ip_not_allowed.
409idempotency_conflictThe Idempotency-Key was used with a different body, or the first request with it is still running.
422content_refusedThe request breaks the use rules. Nothing is charged.
429rate_limitedToo many requests. Retry after Retry-After seconds.
503model_pausedThe model is paused for a short while. Retry later.
500 or 503server_errorSomething went wrong on our side, or a service is briefly unavailable. Any hold is released at once.