AI Image and Video Upscaling API

One REST API for image upscaling, video upscaling to 4K, and image utilities, built for apps, pipelines, and AI agents. Pay per result with the same credits as the web app.

Images
Up to 100 MP
Video
4K, 60 fps
Billing
Per result
curl -X POST https://upsampler.com/api/v2/image/upscale/auto \
  -H "Authorization: Bearer $UPSAMPLER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "input": {
      "imageUrl": "https://example.com/photo.jpg",
      "maxCredits": 20
    },
    "webhook": "https://your.app/hooks/upsampler"
  }'
200 OK
{
  "id": "cmh2x8f3k0001",
  "status": "IN_QUEUE",
  "creditCost": 4,
  "auto": {
    "intent": "faithful",
    "model": "p-image-upscale",
    "input": { "upscaleFactor": 4 },
    "output": { "width": 4096, "height": 3072 },
    "credits": 4,
    "reason": "A clean photo with real detail, so it is enlarged as it is."
  }
}

Every endpoint, with its price

Prices are in credits and match the web app. The cost of each job comes back in the submit response, before anything runs.

  • POSTmodel: auto (default)/api/v2/image/upscale/{model}

    The advisor picks the model, settings and size for the image, then it runs. Add preview to see a tile first, or compare the options side by side.

    The model's price
  • POSTRecommend/api/v2/image/upscale/recommend

    Measures the image and returns which model to use, with the exact input and price.

    Free
  • POSTFlux/api/v2/image/upscale/flux

    Creative upscaling: regenerates fine detail as it enlarges.

    1 credit per output MPUp to 100 MP
  • POSTKrea 2/api/v2/image/upscale/krea-2

    Creative upscaling with a natural, photographic look.

    1 credit per output MPUp to 100 MP
  • POSTStable Diffusion/api/v2/image/upscale/stable-diffusion

    Creative upscaling with the classic SD look.

    1 credit per output MPUp to 50 MP
  • POSTSeed VR 2 Small/api/v2/image/upscale/seed-vr-2

    Faithful upscaling: sharper, cleaner, nothing invented.

    1 credit per 4 output MPUp to 100 MP
  • POSTSeed VR 2 Large/api/v2/image/upscale/seed-vr-2-large

    The larger SeedVR2: more fine texture recovered, nothing invented.

    1 credit per 2 output MPUp to 100 MP
  • POSTP Image Upscale/api/v2/image/upscale/p-image-upscale

    Fast faithful upscaling with a photorealistic lift.

    1 credit per 4 output MPUp to 100 MP
  • POSTGAN/api/v2/image/upscale/gan

    Fast faithful upscaling for large batches.

    1 credit per 4 output MPUp to 100 MP
  • POSTmodel: auto (default)/api/v2/video/upscale/{model}

    The advisor picks the model, settings and size for the clip, then it runs. Add preview to see a few seconds first, or compare the options side by side.

    The model's price
  • POSTRecommend/api/v2/video/upscale/recommend

    Measures the clip and returns which model to use, with the exact input and price.

    Free
  • POSTLTX 2.5/api/v2/video/upscale/ltx-2-5

    Rebuilds the most detail; a creativity setting controls how much.

    2 credits per MP·sUp to about 4 MP
  • POSTSeedVR 2/api/v2/video/upscale/seed-vr-2

    Diffusion upscaler, strong on AI clips and heavy compression.

    2.5 credits per MP·sUp to about 4 MP
  • POSTRelayVSR/api/v2/video/upscale/relay-vsr

    Faithful detail with steady motion, nothing invented.

    0.5 credits per MP·sUp to about 4 MP
  • POSTRTX VSR/api/v2/video/upscale/rtx-vsr

    Fast, clean sharpening all the way to 4K.

    0.1 credits per MP·sUp to 4K (2160p)
  • POSTGAN/api/v2/video/upscale/gan

    Fast GAN upscaling to 4K.

    0.2 credits per MP·sUp to 4K (2160p)

Image utilities

  • POSTBackground removal/api/v2/image/edit/background-removal

    Transparent cutout of the subject.

    1 credit per image
  • POSTColorize/api/v2/image/edit/colorize

    Natural color for black and white photos.

    5 credits per image
  • POSTDepth map/api/v2/image/edit/depth-map

    A grayscale depth map for 3D and compositing.

    1 credit per image

Jobs and files

  • POSTUploads/api/v2/uploads

    A signed upload URL for files too large to send by link.

    Free
  • GETStatus/api/v2/status/{id}

    Job status and result URLs; fresh links on every call.

    Free
  • GETAccount/api/v2/account

    The credit balance, to check before a large job.

    Free
  • GETModels/api/v2/models

    Every model the API serves.

    Free

The models behind the endpoints

Runs from the same models the API serves.

Before
Illustration upscaled faithfully before enhancement and upscaling
After
Illustration upscaled faithfully after enhancement and upscaling
Before
Fantasy art upscaled with creative detail before enhancement and upscaling
After
Fantasy art upscaled with creative detail after enhancement and upscaling

Drag the split to compare. Zoom in to check the detail.

Built for agents

Everything an AI agent needs to find the endpoints, call them safely, and get the result back without a human in the loop.

Docs agents can read
The whole reference as plain markdown, generated from the schemas the API validates with, so it never drifts from what the endpoints accept.
/api/v2/llms.txt
OpenAPI 3.1
Point a code generator or an agent's tool loader at the spec and every endpoint becomes a typed call.
/api/v2/openapi.json
Safe retries
Send an Idempotency-Key with each submission. A retried request returns the original job instead of charging twice.
Idempotency-Key: <uuid>
Results that come back on their own
Pass a webhook and get one signed POST when the job finishes, or poll the status endpoint. Failed jobs are refunded automatically.
"webhook": "https://..."

Reference

API Documentation 🖼️

Integrate our powerful image upscaling capabilities into your application.

Introduction

Welcome to the Upsampler API! It upscales images and video with the same models as the web app: creative ones that redraw fine detail as they enlarge (Krea 2, Flux, Stable Diffusion) and faithful ones that keep the image as it is (P Image, SeedVR2, GAN), plus a few image utilities. It runs over HTTPS with JSON request and response bodies, and the input fields match the settings in the web app.

Not sure which model to use? Send auto as the model and the API picks one for your file, or add preview to see a small tile before you pay for the whole image. See Choosing a model below.

Use the API version toggle below to view either the legacy v1 endpoints or the new v2 paths. v1 remains supported for existing integrations.

All tasks are processed asynchronously. You can provide a webhook URL to be notified when processing is complete, or you can poll the status endpoint. Please note that all returned image URLs are temporary and will expire after 3 hours.


Pricing

Every endpoint shows its own price, on the endpoint. Rates differ per model and per media type, so a single table at the top of this page could only ever be a summary of some of them, and would go stale the first time a model was added.

  • Image upscaling is priced per megapixel of the output, so the cost follows the upscale factor. keepIdentity adds 5 credits per image and restore 5.
  • Video upscaling is priced per output megapixel-second, so it follows the factor and the clip length. A target fps above 24 adds 0.01 credits per second of video for each frame per second over it, and keepIdentity adds 3 per second of video.
  • Utilities are a flat cost per image.

The submit response returns the exact creditCost charged. GET /models returns the live rate for every model, which is what to read if you are computing costs ahead of time. A failed job is refunded automatically.


Authentication

All API requests require authentication. Include your API key in the Authorization header as a Bearer token.

Authorization: Bearer YOUR_API_KEY

API Version

Select the API version you want to use. v2 introduces clearer endpoint naming while keeping request payloads nearly identical. New integrations should use v2 by default.


Base URL

All API requests should be made to the following base URL:

https://staging.upsampler.com/api/v2

General Request Structure

All POST requests to the upscaling endpoints share a common structure:

{
  "webhook": "YOUR_WEBHOOK_URL", // Optional
  "input": { /* Schema-specific input parameters as detailed below */ }
}
  • webhook (string, optional): A HTTPS URL where a POST request with the results (or error) will be sent upon completion or failure of the upscaling job. We will attempt to deliver the webhook notification up to 3 times with exponential backoff if the initial attempts fail. Your endpoint should respond with a 2xx status code to acknowledge receipt.
  • input (object, required): An object containing the specific parameters for the chosen endpoint. The schema for this object varies by endpoint (see below).

Retries and idempotency

Send an Idempotency-Key header on any submission and we will treat repeats of that key as one job for 24 hours, returning the original response instead of starting and charging a second job. Use a fresh UUID per job. Without it, a retry after a timeout starts a second job and costs a second time.

Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset, so you can pace requests without waiting to be refused. Failures also carry a stable code field alongside the human-readable error; branch on code, never on the message text.

What happens to your images

Your input is read from your URL when you submit, and again when the job runs. Keep the file reachable and unchanged until the job completes. We record what your origin reports about the file (its ETag and size) at submit and check it again before running; if it changed in between, the job fails with a full refund rather than being priced on one file and processed on another. Base64 inputs are uploaded to our storage at submit and are not subject to this.

Jobs are deleted 7 days after submission, result included. After that GET /status/{id} returns 404. Download what you need within that window; result URLs can be re-issued from the status endpoint any time until then.

Webhook signatures

Every webhook we deliver carries an Upsampler-Signature header shaped t=<unix seconds>,v1=<hex>. The signature is an HMAC-SHA256 over "<t>.<raw body>" using your key's webhook secret, which you can reveal next to the key above. Verify it before trusting a delivery, and reject a t older than a few minutes so a captured delivery cannot be replayed.


Choosing a model

Every upscale is POST /image/upscale/{model} or POST /video/upscale/{model}. Use auto as the model unless you need a specific one: the advisor looks at the file, picks the model, settings and size, and the job runs through that model's route with its own price, validation, idempotency and refunds.

  • auto takes the same fields as the model routes, all optional except the file, plus intent: "faithful" (the default) keeps the image as it is, "detail" lets the model redraw fine detail. Any setting you send overrides the pick. The response adds an auto object with the model, the input that ran, the output size, the credits and a one-sentence reason. Picks improve over time, so pin a model (with the settings from auto.input) when you need the same result every time.
  • recommend (POST /image/upscale/recommend or /video/upscale/recommend) is free: the plan without the job. It returns what the file shows and two picks, faithful and detail, each with the endpoint, the exact input to send, the output size and the price.
  • maxCredits on any upscale is a cap on what the request may charge. A job that would cost more is refused with code budget_exceeded and nothing is charged; it is never made smaller or swapped to fit. With auto, the pick for your intent is checked: over the cap, the request is refused, and the other intent's pick never runs in its place. With preview, the cap applies to the preview's price; with several candidates, to all of them together.
curl -X POST https://staging.upsampler.com/api/v2/image/upscale/auto \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "input": { "imageUrl": "https://example.com/image.jpg", "maxCredits": 20 } }'

Look before you pay: preview

Add "preview": true (or a preview object) to any upscale and the job runs on a square tile of the image, or a few seconds of a video, at the model's normal rate for that much output: usually 1 to 2 credits for an image tile. The response says which tile ran (crop or segment), the fullCreditCost of the whole file, and fullRequest, the exact request to send for it.

  • Image: crop is "auto" (the default: the largest face, else text, else the most detailed area) or { "x", "y", "size" }, the tile's centre and side as shares of the image. cropPixels sets the tile's output side (default 1024, up to 2048).
  • Video: segment is "auto" or { "start", "seconds" }, 1 to 5 seconds.
  • Compare (with auto only): "candidates": "recommended" previews the faithful and detail picks side by side, or list up to 4 models as { "model": "<slug>", ...settings }. All run on the same tile, as one job with one id (starting cmp_); GET /status/{id} lists every candidate with its result, price and fullRequest. Each candidate counts as one request against your rate limit, and a webhook arrives once per candidate.
curl -X POST https://staging.upsampler.com/api/v2/image/upscale/auto \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "input": { "imageUrl": "https://example.com/image.jpg", "preview": { "candidates": "recommended" } } }'

Restore first

For old, damaged or very blurry photos, "restore": true has an edit model repair the image (tears, stains, missing areas, fading, compression artifacts) before the upscale, for 5 extra credits. The repair redraws the image, so small details can change. Output is capped at 8 MP, inputs larger than about 3.7 MP are refused, and it has no preview. With "intent": "detail", auto turns it on by itself for an image that needs it.

Keep identity

"keepIdentity": true upscales every face separately with a faithful face model and blends it back, so people keep looking like themselves on a creative model. It adds 5 credits per image, and on video 3 credits per second, previews included, charged whether or not a face is found. Leave it off for files without people.

Fields a model doesn't use: ignoredFields

A request is never refused over a field the route doesn't need. Unknown fields, settings the chosen model lacks and retired fields are accepted and dropped, and the response lists each one in ignoredFields with the reason. Check it: an ignored setting did not apply. Wrong values in fields the route does use (an upscaleFactor out of range, a missing imageUrl) are still a 400.


Endpoints

Click on an endpoint below to see its request structure and code examples.


Response Handling

Upon submitting a valid request to an upscale endpoint, you will receive an initial synchronous response confirming that the job has been started or queued. Make sure you store the id from this response, as it is the key to associating the final, asynchronous result with your initial request. The actual results, including image URLs or any processing errors, are delivered asynchronously. If you provide a webhook URL, the final results will be send there. Otherwise, you must use the GET /status/{id} endpoint to retrieve the results.

Initial Synchronous Response:

// Synchronous Response on Success
{
  "id": "xxxxxxxxxxxx",
  "status": "IN_PROGRESS", // or "IN_QUEUE"
  "creditCost": x,
  // Only when you sent fields this route did not use:
  "ignoredFields": [{ "field": "fooBar", "reason": "Unknown field." }]
}

// Synchronous Response on Failure
{
  "status": "FAILED",
  "error": "ERROR MESSAGE",
  "code": "invalid_request" // stable; branch on this, not on the message
}

Asynchronous Results:

Once the job is complete, you can retrieve the final results in one of two ways:

  1. Webhook: Our server will send a POST request to the provided `webhook` URL with the final result.
  2. Status endpoint: You can call the GET /status/{id} endpoint with the job ID.

Important: The compressedImageUrl and imageUrl are temporary and will only be valid for 3 hours. Please download and store the images.

Final Result Payloads (via Webhook or GET):

// Payload on Success
{
  "id": "xxxxxxxxxxxx",
  "status": "SUCCESS",
  "compressedImageUrl": "URL_TO_COMPRESSED_IMAGE", // display-sized rendition
  "imageUrl": "URL_TO_FULL_QUALITY_IMAGE", // full-quality output (PNG for upscales)
  "creditCost": x
}

// Payload on Failure
{
  "id": "xxxxxxxxxxxx",
  "status": "FAILED",
  "error": "Failed to process image due to an internal error. Your credits have been refunded."
}

Error Handling (Synchronous)

Errors that occur before a job is started or queued (e.g., authentication issues, invalid request structure, validation errors) will be returned synchronously. The API uses standard HTTP status codes.

  • 400 Bad Request: The request JSON was malformed or contained semantic errors (e.g., upscaleFactor out of range).
  • 401 Unauthorized: No API key was provided, or the API key is invalid.
  • 403 Forbidden: API key inactive or insufficient credits.
  • 404 Not Found: The requested job ID does not exist (applies to the GET /status/{id} endpoint).
  • 413 Payload Too Large: The request payload exceeds the maximum allowed size.
  • 429 Too Many Requests: You have exceeded the rate limit, or your account already has as many jobs running and queued as your plan allows.
  • 500 Internal Server Error: An unexpected error occurred on our side before the job could be started or queued.

Every failure also carries a stable code. Branch on it, never on the error text:

  • invalid_request: a value is wrong or a required field is missing (400).
  • unauthorized: missing, invalid or inactive key.
  • insufficient_credits: the balance doesn't cover the job (403).
  • budget_exceeded: the job costs more than your maxCredits; nothing was charged (400).
  • rate_limited: too many requests, or a full job queue (429). Wait for Retry-After.
  • idempotency_conflict: a request with the same Idempotency-Key is still in progress (409).
  • model_unavailable: no such model slug; use auto or GET /models (404).
  • input_unreadable, unsupported_format, input_too_large, output_too_large: the file could not be fetched or read, or is too big in or out.
  • content_rejected: the input failed moderation.
  • not_found: no such job for this key, or it expired.
  • provider_failed, internal: an error on our side. Nothing is charged for a job that fails; retry later.

Processing errors that occur after a job has been queued will be reported via the webhook.


Rate Limits

To ensure service stability, API requests are rate-limited per API key. The current limit for the upscaling endpoints is 90 requests per minute and 6000 requests per hour. For the GET /status/{id} endpoint, the limit is 240 requests per minute. The advisor (recommend, and the analysis step of auto) has its own budget of 20 requests per minute and 300 per hour, since it decodes your file on our servers. A compare counts each candidate as one request. Exceeding these limits will result in a 429 Too Many Requests error. Keep in mind that your subscription plan’s concurrent job and queue size limits apply as well: jobs beyond the concurrent limit are queued, and a full queue also returns 429.


Support

If you have any questions, encounter issues, or need assistance with the API, please do not hesitate to contact us.

Frequently Asked Questions

Image upscaling with faithful and creative models up to 100 megapixels, with an optional repair pass for old and damaged photos; video upscaling up to 4K with frame interpolation to 60 fps; and image utilities: background removal, colorization, and depth maps. Send auto as the model and the API picks one for each file, or preview a small tile before paying for the whole image. Generation and editing are available in the web app.

Yes. The reference is published as plain markdown at /api/v2/llms.txt and as an OpenAPI file at /api/v2/openapi.json, both generated from the schemas the API validates with, so an agent can read them and call the endpoints directly. For Claude, ChatGPT, Cursor, and other MCP clients there is also a remote MCP server at upsampler.com/api/mcp.

Sign in and create a key under Developer API. Requests are authenticated with an Authorization: Bearer header.

You pay per result in credits, the same prices as the web app, with no subscription. Every submission returns its credit cost before it runs, and failed jobs are refunded automatically.

Jobs run asynchronously. Pass a webhook to receive one signed POST when the job is done, or poll GET /api/v2/status/{id}. Result URLs expire after a few hours; the status endpoint issues fresh ones on demand.