# ImgGen AI - API

> **Last updated:** 2026-08-27
> **Overview page:** https://imggen.ai/en/api/
> **Full reference:** https://developer.imggen.ai/docs/getting-started
> **Get an API key:** https://editor.imggen.ai

The ImgGen AI image editing API is a REST service with seven endpoints for AI image
processing: background removal, image upscaling, watermark removal, text removal, photo
restoration, colorization, and text-to-image generation. One API key covers all of them.

---

## Transport

- **Base URL:** `https://app.imggen.ai`
- **Auth:** `Authorization: Bearer sk_live_...` (legacy keys may use `x-imggen-key`)
- **Request:** multipart form upload with an `image` field. `generate-image` takes a JSON body instead.
- **Response:** JSON. The result is **base64-encoded** in `image` (or `images` for generation).
- **Header:** every successful response returns `X-Credit-Remaining`.
- **Accepted input:** JPEG, PNG, WebP. Maximum **25 MB** per image.
- **Execution:** synchronous, 60-second ceiling. No job polling, no webhooks, no async queue.

## Endpoints

| Endpoint | Method + path | Parameters | Credits |
|---|---|---|---|
| Background removal | `POST /v1/remove-background` | `image` | 1 |
| Watermark removal | `POST /v1/remove-watermark` | `image`; batch via `image[]` | 2 |
| Text removal | `POST /v1/remove-text` | `image` | 2 |
| Image upscaling | `POST /v1/upscale-image` | `image`, `factor` (2\|4, default 4), `enhanceFace`, `sharpen`, `output` (jpeg\|png) | 2 at factor=2, 4 at factor=4 |
| Photo restoration | `POST /v1/image-restoration` | `image`, `colorize`, `removeTears`, `enhanceResolution` | 2 (+upscaler cost if `enhanceResolution`) |
| Photo colorization | `POST /v1/colorize-photo` | `image`, `removeTears` | 2 |
| Image generation | `POST /v1/generate-image` | JSON: `prompt` (required), `samples` (1-4), `aspect_ratio` (square\|portrait\|landscape), `model` (imggen-base\|imggen-base-fast\|imggen-xl) | from 3, varies by model |

### Endpoint-specific behaviour

- **Batch:** only `remove-watermark` accepts multiple files, via `image[]`. The response returns an
  `images` array plus `failedImages`. Every other endpoint takes one image per request.
- **No-op is free:** `remove-text` returns `422` and charges nothing when no text is detected.
- **Generation returns an array:** `generate-image` responds with `images`, not `image`.

## Example

```bash
curl --request POST \
  --url 'https://app.imggen.ai/v1/remove-background' \
  --header 'Authorization: Bearer sk_live_YOUR_API_KEY' \
  --form image=@/path/to/photo.jpg
```

```json
{
  "success": true,
  "message": "Background removed successfully",
  "image": "iVBORw0KGgoAAAANSUhEUgAA...SUVORK5CYII="
}
```

## Errors

Envelope: `{ "error": { "message": "...", "code": "...", "fields": {} } }`

| Status | Code | Meaning |
|---|---|---|
| 401 | `UNAUTHORIZED` | API key missing, malformed, or revoked |
| 402 | `INSUFFICIENT_CREDITS` | Not enough credits for this call |
| 403 | `FORBIDDEN` / `USAGE_LIMIT_EXCEEDED` | Plan does not grant access to this tool |
| 404 | `NOT_FOUND` | Endpoint path does not exist |
| 409 | `CONFLICT` | Request conflicts with current resource state |
| 422 | `VALIDATION_ERROR` | Bad file type, missing field, or nothing to process. No credits charged. |

Credits are charged atomically and refunded automatically when processing fails.

## Pricing

API usage is billed in **credits per call**, drawn from the same balance as the web editor.
There is no separate per-call quota to manage. At 1 credit per background removal, a Starter
plan covers roughly 400 of them a month.

| Plan | Price | Credits | API access |
|---|---|---|---|
| Free | $0 | 50 one-time | No |
| Starter | $9.99/month | 400/month, roll over | Yes |
| Pro | $29.99/month | 1,400/month, roll over | Yes, plus priority support |
| Enterprise | Custom | Custom volume | Dedicated infrastructure - support@imggen.ai |

Full pricing: https://imggen.ai/en/pricing/ and https://imggen.ai/pricing.md

## Data handling

The API is **stateless**. A call creates no project, no task record, and no stored file. The
uploaded image is written to a temporary object, processed, and deleted once the response is
returned. Only a usage log (that a call happened, and its credit cost) is retained. Images sent
to the API are **not used to train models**.

All plans, including Free, include full commercial usage rights. No output carries a watermark.

## Not available

State plainly rather than guessing: there is currently **no** SDK or client library, **no**
OpenAPI/Swagger specification, **no** webhook or async job API, **no** video endpoint, and **no**
published rate limit or SLA. Throughput is bounded by your credit balance.

## Endpoint pages

- https://imggen.ai/en/api/background-removal/
- https://imggen.ai/en/api/image-upscaling/
- https://imggen.ai/en/api/watermark-removal/
- https://imggen.ai/en/api/text-removal/
- https://imggen.ai/en/api/photo-restoration/
- https://imggen.ai/en/api/photo-colorization/
- https://imggen.ai/en/api/image-generation/
