2 credits per call
Photo Restoration API
Repair old, damaged and faded photographs from your own backend. Optionally colorize and increase resolution in the same request instead of chaining three calls.
- REST · JSON
- No watermark
- Nothing stored
POST /v1/image-restoration
What is the Photo Restoration API?
The ImgGen AI photo restoration API is a REST endpoint that repairs damaged photographs. It reduces scratches, tears, stains, fading and blur, and can optionally add colour to a black-and-white original and raise its resolution in the same call. You upload the scan and the restored image is returned in the response.
It is one of seven endpoints in the ImgGen AI image editing API, all of which share a single API key, a single base URL, and the same request and response shape. If you also need this capability in a browser rather than from code, the same AI model powers the Image Restoration tool.
Request parameters
Send a POST request to https://app.imggen.ai/v1/image-restoration, authenticated with an API key in the Authorization header.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| image | file | REQUIRED | — | Add realistic colour to a black-and-white photograph while restoring it. |
| colorize | boolean | optional | false | Repair scratches, tears and physical damage. |
| removeTears | boolean | optional | false | Upscale the restored image for extra resolution. Adds the upscaler cost to the call. |
| enhanceResolution | boolean | optional | false | Upscale the restored image for extra resolution. Adds the upscaler cost to the call. |
How do I integrate the photo restoration API?
Create an API key in your ImgGen account, set it as an environment variable, and call the endpoint. Here is the same request in cURL, Node.js and Python.
curl --request POST \
--url 'https://app.imggen.ai/v1/image-restoration' \
--header 'Authorization: Bearer sk_live_YOUR_API_KEY' \
--form image=@/path/to/photo.jpg \
--form colorize=false \
--form removeTears=true \
--form enhanceResolution=falseimport fs from 'node:fs';
const form = new FormData();
form.append('image', new Blob([fs.readFileSync('photo.jpg')]), 'photo.jpg');
form.append('colorize', 'false');
form.append('removeTears', 'true');
form.append('enhanceResolution', 'false');
const res = await fetch('https://app.imggen.ai/v1/image-restoration', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.IMGGEN_API_KEY}` },
body: form,
});
const data = await res.json();
// data.image is a base64-encoded PNG
fs.writeFileSync('result.png', Buffer.from(data.image, 'base64'));import base64, os, requests
with open("photo.jpg", "rb") as f:
res = requests.post(
"https://app.imggen.ai/v1/image-restoration",
headers={"Authorization": f"Bearer {os.environ['IMGGEN_API_KEY']}"},
files={"image": f},
data={"colorize": "false", "removeTears": "true", "enhanceResolution": "false"},
)
data = res.json()
with open("result.png", "wb") as out:
out.write(base64.b64decode(data["image"]))Response
A successful call returns JSON. The result is base64-encoded — decode it before writing to disk or object storage. Every successful response also carries an X-Credit-Remaining header with your balance after the call.
{
"success": true,
"message": "Image restored successfully",
"image": "iVBORw0KGgoAAAANSUhEUgAA...SUVORK5CYII="
}Limits and behaviour worth knowing
The endpoint accepts JPEG (JPG), PNG and WebP with a 25 MB maximum file size, and responds synchronously within 60 seconds — there is no job to poll and no webhook to configure.
Three operations, one call
Repair, colorize, and upscale are flags on the same request rather than separate endpoints, so a full restoration is one round trip instead of three.
enhanceResolution costs extra
Turning on enhanceResolution adds the upscaler’s cost on top of the base restoration charge, because it runs the upscaling model as well.
Scan quality matters
The model reconstructs from what it can see. A flat, evenly lit scan at the highest resolution your scanner supports gives noticeably better results than a phone photo of a print.
What is the photo restoration API used for?
Where teams put this endpoint into production to process images programmatically, at scale.
Genealogy and archive platforms
Offer one-click restoration of user-uploaded family photographs without building or hosting a restoration model.
Digitization services
Run restoration automatically as scans come off the scanner, so operators review results instead of editing every frame.
Museum and library collections
Produce presentable access copies of deteriorated photographic material while the originals stay untouched.
Photo-printing products
Repair and upscale a customer’s uploaded photograph in one call before it goes to print.
How much does the photo restoration API cost?
Each successful call costs 2 credits, so your effective cost per image follows whichever plan you are on. Credits come from your plan and are shared across every endpoint and the web editor, so you are not buying a separate quota per tool. A call that fails is refunded automatically. See the full pricing page for details.
| Plan | Price | Credits | API |
|---|---|---|---|
| Free | $0 | 50 one-time free credits | No API access |
| Starter | $9.99 / month | 400 credits / month | API access included |
| Pro | $29.99 / month | 1,400 credits / month | API access + priority support |
| Enterprise | Custom | Custom volume | Dedicated infrastructure |
Credit costs and limits last verified 2026-08-27.
Related endpoints and tools
Teams using the photo restoration API usually reach for these next.
Also available: Background Removal, Watermark Removal, Text Removal, Image Generation.
Photo Restoration API FAQ
- It is an HTTP endpoint that repairs damaged photographs automatically. It reduces scratches, tears, stains, fading, and blur, and can optionally colorize and enlarge the result. It exists so that a product can offer restoration to its users without anyone doing retouching work by hand.
- Yes. Set colorize=true and the model adds realistic colour as part of the same restoration pass. If colour is all you need and the photograph is not damaged, the dedicated colorize endpoint is the cheaper, more direct option.
- Two credits per successful call. Setting enhanceResolution=true adds the upscaler cost on top, because it runs a second model. Starter includes 400 credits a month at $9.99 and Pro includes 1,400 at $29.99, and unused credits roll over while you stay subscribed.
- Scratches, tears, stains, water damage, colour fading, yellowing, and general softness. Set removeTears=true for physical damage specifically. Areas where the original image content is entirely missing are reconstructed plausibly rather than recovered — the model is inferring, not undoing.
- It can, and that is worth understanding before you put it in front of users. The model reconstructs missing information by inference, so a face that is heavily damaged or very low-resolution may come back subtly different from the person in the original. It works from what is visible; where nothing is visible, it produces a plausible guess. Treat output as a restored interpretation, not a recovered original.
- One photograph per request. There is no batch form on this endpoint — only watermark removal supports image[]. For an archive, run requests concurrently from your own worker; each is independent and each is charged separately.
- The API accepts JPEG (JPG), PNG and WebP files up to 25 MB per image. Results are returned as a base64-encoded image in the JSON response.
- No. The API is stateless: it does not create a project, save a file, or keep your image. Your upload is written to a temporary object, processed, and deleted as soon as the response is returned. The only thing retained is a usage log recording that a call happened and how many credits it cost. Your images are never used to train models.
- Yes. Every plan, including Free, includes full commercial usage rights, and no output carries a watermark. You can sell, print, or publish anything the API returns.
Get started
Start calling the Photo Restoration API
One key unlocks all seven endpoints. No watermark, full commercial rights, and nothing you send is stored after the response is returned.
Get your API key