# Upsampler API v2 > Asynchronous image and video upscaling, plus single-purpose image utilities. Priced in credits. ## How to call it - Base URL: `https://upsampler.com/api/v2` - Auth: `Authorization: Bearer ` on every request except `GET /models`, which is public. - A submission's body is always `{ "webhook"?: string, "input": { ... } }`. `POST /uploads` is not a submission and takes a flat body. - A submission responds `{ "id", "status", "creditCost" }`. The job is asynchronous. - Get the result by polling `GET /status/{id}` until `status` is `SUCCESS` or `FAILED`, or by supplying `webhook` and receiving one POST. - Result URLs expire after 3 hours. `GET /status/{id}` reissues fresh ones on demand, so re-fetch rather than caching a URL. - Jobs are deleted 7 days after submission, result included, and `GET /status/{id}` then answers 404. Download what you need within that window. - `GET /account` returns the credit balance (`credits`, split into `monthlyCredits` and `bonusCredits`) and is free. A submission the balance cannot cover is refused with `insufficient_credits`. ## Not sure which model? - `POST /image/upscale/recommend` with `{ "input": { "imageUrl": "..." } }` is free. It measures how much real detail the image holds (a stretched or softly captured file holds less than its size), names its content and damage, and returns `picks`: a `faithful` pick that keeps the image as it is and a `detail` pick that lets the model redraw fine detail. Each pick has `endpoint`, the exact `input` to POST there, `output` size and `credits`. - `POST /image/upscale/auto` does it in one call: same body, plus optional `intent` (`"faithful"` default, or `"detail"`), `outputFormat` and `shouldEnhanceFaces`. It submits the pick through the model's own endpoint, so the response is that endpoint's, plus `auto` saying what was chosen. - Video works the same way: `POST /video/upscale/recommend` and `POST /video/upscale/auto` with `{ "input": { "videoUrl": "..." } }`. The clip is probed for its size, duration and frame rate, so each pick already carries the `durationSeconds`, `width` and `height` the video endpoints require, and a frame of it is measured and classified like an image. `fps` passes through on `auto`. ```bash 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/image.jpg" } }' ``` ## Reliability - Send an `Idempotency-Key` header on every submission. The same key inside 24h returns the original job instead of starting and charging a second one. Use a fresh UUID per job. - Every response carries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`. Pace against those rather than waiting for a 429. - Webhooks are signed: `Upsampler-Signature: t=,v1=`, an HMAC-SHA256 over `"."` with your key's webhook secret. Verify before trusting, and reject a stale `t`. ## Errors Failures return `{ "status": "FAILED", "error": , "code": }`. Branch on `code`, never on the message text. Codes: `unauthorized`, `rate_limited`, `invalid_request`, `insufficient_credits`, `input_unreadable`, `input_too_large`, `unsupported_format`, `output_too_large`, `content_rejected`, `model_unavailable`, `idempotency_conflict`, `not_found`, `provider_failed`, `internal`. A failed job is refunded automatically. ## Sending a file Three ways, in the order you should reach for them: 1. **A public URL.** Pass it as `imageUrl` or `videoUrl`. Best when the file is already hosted. 2. **Upload it.** `POST /uploads` with `{ "extension": "png", "size": 123456 }` (`size` is the file's exact byte length, signed into the URL, so the PUT is refused if it sends any other number of bytes) returns `{ "uploadUrl", "contentType", "fileUrl", "expiresIn" }`. PUT the raw bytes to `uploadUrl` with `Content-Type` set to the returned `contentType` (it is signed into the URL, so the upload is refused otherwise), then submit `fileUrl` as your `imageUrl`. The bytes go straight to storage, so the request body cap does not apply and nothing is charged for the upload itself; the model's own input and output limits still do. Not subject to the change check below. Extensions: jpg, jpeg, png, webp, mp4, webm, mov. 3. **A base64 data URI.** Convenient for small files and nothing else: base64 inflates by a third, and the request body cap is 3 MB, so keep the image under about 2.25 MB. Above that use `POST /uploads`. ```bash # 2. upload, then submit UPLOAD=$(curl -s -X POST https://upsampler.com/api/v2/uploads \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"extension\":\"png\",\"size\":$(wc -c < photo.png)}") curl -s -X PUT "$(echo "$UPLOAD" | jq -r .uploadUrl)" \ -H "Content-Type: $(echo "$UPLOAD" | jq -r .contentType)" \ --data-binary @photo.png # pass this as imageUrl on any submit below echo "$UPLOAD" | jq -r .fileUrl ``` ## Your files - Your input is read from your URL at 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 (ETag, size) at submit and check it again before running; if it changed, the job fails with a full refund rather than being priced on one file and run on another. - Files you uploaded to us, and base64 inputs, are stored by us and never change, so neither is subject to that check. - An uploaded file that you never submit may be removed after 10 days, so upload and submit in the same run rather than warehousing keys. Once submitted it follows the job, and goes when the job does. - A URL on our own domain is only accepted if the file is yours: one you uploaded, or one from an earlier job of yours. Anything else is refused with `invalid_request`. ## Image upscale ### POST /image/upscale/flux Upscale an image with Flux. Price: 1 credit per output megapixel. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to upscale, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https) or a base64 data URI (e.g., data:image/png;base64,...). Supported formats are png, jpeg, jpg, and webp. Base64 images have a 3MB size limit. - `inputImageType` ("realism" | "anime" | "universal", required): Style that best matches the image. Allowed values: "realism", "anime", "universal". - `upscaleFactor` (number, required): Factor by which to upscale. Number, 1-4. Output image must not exceed 100 megapixels (100,000,000 pixels). - `globalCreativity` (integer, required): The creativity value determines how much the AI can change the original image. Integer between 0-10. - `regionalCreativityImageUrl` (string, optional): URL of a black and white mask image that defines creativity levels per pixel, or the image encoded as a base64 data URI. White areas (255) receive maximum creativity, black areas (0) receive minimum creativity, with grayscale values interpolated. Must be a publicly accessible URL (http/https) or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. Must have the same aspect ratio as the main image (within 5% tolerance). Base64 images have a 3MB size limit. - `detail` (integer, required): A higher value enhances detail, but can lead to unwanted artifacts or noise in the image. Integer between 0-10. - `description` (string, optional): Text prompt to guide the creative upscaling process. - `shouldEnhanceFaces` (boolean, optional): If true, attempts to better preserve and enhance facial features. ```bash curl -X POST https://upsampler.com/api/v2/image/upscale/flux \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg", "upscaleFactor": 2, "inputImageType": "universal", "globalCreativity": 5, "detail": 5 } }' ``` ### POST /image/upscale/gan Upscale an image with GAN. Price: 0.25 credits per output megapixel. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to upscale, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https) or a base64 data URI (e.g., data:image/png;base64,...). Supported formats are png, jpeg, jpg, and webp. Base64 images have a 3MB size limit. - `inputImageType` ("realism" | "anime" | "universal", required): Style that best matches the image. Allowed values: "realism", "anime", "universal". - `upscaleFactor` (number, required): Factor by which to upscale. Number, 2-8. Output image must not exceed 100 megapixels (100,000,000 pixels). - `shouldEnhanceFaces` (boolean, optional): If true, applies face restoration techniques. ```bash curl -X POST https://upsampler.com/api/v2/image/upscale/gan \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg", "upscaleFactor": 2, "inputImageType": "universal" } }' ``` ### POST /image/upscale/seedvr2 Upscale an image with Seed VR 2 Small. Price: 0.25 credits per output megapixel. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to upscale, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https) or a base64 data URI (e.g., data:image/png;base64,...). Supported formats are png, jpeg, jpg, and webp. Base64 images have a 3MB size limit. - `upscaleFactor` (number, required): Factor by which to upscale. Number, 2-6. Output image must not exceed 100 megapixels (100,000,000 pixels). - `shouldEnhanceFaces` (boolean, optional): If true, applies face restoration techniques. ```bash curl -X POST https://upsampler.com/api/v2/image/upscale/seedvr2 \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg", "upscaleFactor": 2 } }' ``` ### POST /image/upscale/stable-diffusion Upscale an image with Stable Diffusion. Price: 1 credit per output megapixel. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to upscale, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https) or a base64 data URI (e.g., data:image/png;base64,...). Supported formats are png, jpeg, jpg, and webp. Base64 images have a 3MB size limit. - `inputImageType` ("realism" | "anime" | "universal", required): Style that best matches the image. Allowed values: "universal", "realism", "anime". - `upscaleFactor` (number, required): Factor by which to upscale. Number, 1-4. Output image must not exceed 50 megapixels (50,000,000 pixels). - `globalCreativity` (integer, required): The creativity value determines how much the AI can change the original image. Integer, 0-10. - `regionalCreativityImageUrl` (string, optional): URL of a black and white mask image that defines creativity levels per pixel, or the image encoded as a base64 data URI. White areas (255) receive maximum creativity, black areas (0) receive minimum creativity, with grayscale values interpolated. Must be a publicly accessible URL (http/https) or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. Must have the same aspect ratio as the main image (within 5% tolerance). Base64 images have a 3MB size limit. - `resemblance` (integer, required): Resemblance to the original image structure. Higher values adhere more closely. Integer, 0-10. - `detail` (integer, required): Level of detail enhancement. Integer, 0-10. - `description` (string, optional): Text prompt to guide the creative upscaling process. - `shouldEnhanceFaces` (boolean, optional): If true, attempts to better preserve and enhance facial features. ```bash curl -X POST https://upsampler.com/api/v2/image/upscale/stable-diffusion \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg", "upscaleFactor": 2, "inputImageType": "universal", "globalCreativity": 5, "resemblance": 5, "detail": 5 } }' ``` ### POST /image/upscale/seed-vr-2 Upscale an image with Seed VR 2 Small. Price: 0.25 credits per output megapixel. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to upscale, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https), a URL from POST /uploads, or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. A base64 image must be under 2.25 MB, since it travels inside the capped request body; upload anything larger. Keep the file at a URL of your own unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale. Number, 2-6. Output image must not exceed 100 megapixels (100,000,000 pixels). - `shouldEnhanceFaces` (boolean, optional): If true, attempts to better preserve and enhance facial features. - `outputFormat` ("webp" | "png", optional): Format of the delivered image. Allowed values: "png", "webp". Defaults to "png". ```bash curl -X POST https://upsampler.com/api/v2/image/upscale/seed-vr-2 \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg", "upscaleFactor": 2 } }' ``` ### POST /image/upscale/seed-vr-2-large Upscale an image with Seed VR 2 Large. Price: 0.5 credits per output megapixel. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to upscale, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https), a URL from POST /uploads, or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. A base64 image must be under 2.25 MB, since it travels inside the capped request body; upload anything larger. Keep the file at a URL of your own unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale. Number, 2-6. Output image must not exceed 100 megapixels (100,000,000 pixels). - `shouldEnhanceFaces` (boolean, optional): If true, attempts to better preserve and enhance facial features. - `outputFormat` ("webp" | "png", optional): Format of the delivered image. Allowed values: "png", "webp". Defaults to "png". ```bash curl -X POST https://upsampler.com/api/v2/image/upscale/seed-vr-2-large \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg", "upscaleFactor": 2 } }' ``` ### POST /image/upscale/p-image-upscale Upscale an image with P Image Upscale. Price: 0.25 credits per output megapixel. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to upscale, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https), a URL from POST /uploads, or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. A base64 image must be under 2.25 MB, since it travels inside the capped request body; upload anything larger. Keep the file at a URL of your own unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale. Number, 2-6. Output image must not exceed 100 megapixels (100,000,000 pixels). - `shouldEnhanceFaces` (boolean, optional): If true, attempts to better preserve and enhance facial features. - `outputFormat` ("webp" | "png", optional): Format of the delivered image. Allowed values: "png", "webp". Defaults to "png". ```bash curl -X POST https://upsampler.com/api/v2/image/upscale/p-image-upscale \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg", "upscaleFactor": 2 } }' ``` ### POST /image/upscale/krea-2 Upscale an image with Krea 2. Price: 1 credit per output megapixel. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to upscale, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https), a URL from POST /uploads, or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. A base64 image must be under 2.25 MB, since it travels inside the capped request body; upload anything larger. Keep the file at a URL of your own unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale. Number, 1-4. Output image must not exceed 100 megapixels (100,000,000 pixels). - `shouldEnhanceFaces` (boolean, optional): If true, attempts to better preserve and enhance facial features. - `outputFormat` ("webp" | "png", optional): Format of the delivered image. Allowed values: "png", "webp". Defaults to "png". - `inputImageType` ("universal" | "realism" | "anime", optional): Style that best matches the image. Allowed values: "universal", "realism", "anime". - `description` (string, optional): Text prompt to guide the creative upscaling process. - `globalCreativity` (integer, optional): How much the model may change the original image. Integer between 0-10. - `detail` (integer, optional): A higher value enhances detail, but can introduce artifacts or noise. Integer between 0-10. - `regionalCreativityImageUrl` (string, optional): URL of a black and white mask defining creativity per pixel, or a base64 data URI. White areas receive maximum creativity, black minimum. Must be a publicly accessible URL or a base64 data URI, with the same aspect ratio as the main image (within 5% tolerance). ```bash curl -X POST https://upsampler.com/api/v2/image/upscale/krea-2 \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg", "upscaleFactor": 2 } }' ``` ## Video upscale ### POST /video/upscale/ltx-2-5 Upscale a video with LTX 2.5. Price: 2 credits per output megapixel-second, plus 0.01 per second for each fps of a target above 24. Fields (all inside `input`): - `videoUrl` (string, required): Publicly accessible URL of the video to upscale. Must be an http(s) URL. Keep the file reachable and unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale each frame. Number, 1-4. Output frames must not exceed 4,200,000 pixels. - `durationSeconds` (number, required): Length of the clip in seconds, used to price the job. The real clip is probed at dispatch and a job whose charge understates it is failed and fully refunded. - `width` (integer, required): Width of the source video in pixels. - `height` (integer, required): Height of the source video in pixels. - `fps` (integer, optional): Target output frame rate, reached by frame interpolation. Omit to keep the source rate. Allowed values: 30, 48, 50, 60. Each frame per second above 24 adds 0.01 credits per second of video, priced from the target alone: a target at or below the source rate changes nothing but is still charged, so omit fps then. - `creativity` (integer, optional): How far the model may redraw detail rather than reconstruct it. Omit for the model's default. Integer 0-10, default 5. Higher invents more fine detail, which can change faces and text. Does not affect the price. ```bash curl -X POST https://upsampler.com/api/v2/video/upscale/ltx-2-5 \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "videoUrl": "https://example.com/clip.mp4", "upscaleFactor": 2, "durationSeconds": 12.5, "width": 1280, "height": 720 } }' ``` ### POST /video/upscale/relay-vsr Upscale a video with RelayVSR. Price: 0.5 credits per output megapixel-second, plus 0.01 per second for each fps of a target above 24. Fields (all inside `input`): - `videoUrl` (string, required): Publicly accessible URL of the video to upscale. Must be an http(s) URL. Keep the file reachable and unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale each frame. Number, 2-4. Output frames must not exceed 4,200,000 pixels. - `durationSeconds` (number, required): Length of the clip in seconds, used to price the job. The real clip is probed at dispatch and a job whose charge understates it is failed and fully refunded. - `width` (integer, required): Width of the source video in pixels. - `height` (integer, required): Height of the source video in pixels. - `fps` (integer, optional): Target output frame rate, reached by frame interpolation. Omit to keep the source rate. Allowed values: 30, 48, 50, 60. Each frame per second above 24 adds 0.01 credits per second of video, priced from the target alone: a target at or below the source rate changes nothing but is still charged, so omit fps then. ```bash curl -X POST https://upsampler.com/api/v2/video/upscale/relay-vsr \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "videoUrl": "https://example.com/clip.mp4", "upscaleFactor": 2, "durationSeconds": 12.5, "width": 1280, "height": 720 } }' ``` ### POST /video/upscale/seed-vr-2 Upscale a video with SeedVR 2. Price: 2.5 credits per output megapixel-second, plus 0.01 per second for each fps of a target above 24. Fields (all inside `input`): - `videoUrl` (string, required): Publicly accessible URL of the video to upscale. Must be an http(s) URL. Keep the file reachable and unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale each frame. Number, 1-4. Output frames must not exceed 4,200,000 pixels. - `durationSeconds` (number, required): Length of the clip in seconds, used to price the job. The real clip is probed at dispatch and a job whose charge understates it is failed and fully refunded. - `width` (integer, required): Width of the source video in pixels. - `height` (integer, required): Height of the source video in pixels. - `fps` (integer, optional): Target output frame rate, reached by frame interpolation. Omit to keep the source rate. Allowed values: 30, 48, 50, 60. Each frame per second above 24 adds 0.01 credits per second of video, priced from the target alone: a target at or below the source rate changes nothing but is still charged, so omit fps then. ```bash curl -X POST https://upsampler.com/api/v2/video/upscale/seed-vr-2 \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "videoUrl": "https://example.com/clip.mp4", "upscaleFactor": 2, "durationSeconds": 12.5, "width": 1280, "height": 720 } }' ``` ### POST /video/upscale/rtx-vsr Upscale a video with RTX VSR. Price: 0.1 credits per output megapixel-second, plus 0.01 per second for each fps of a target above 24. Fields (all inside `input`): - `videoUrl` (string, required): Publicly accessible URL of the video to upscale. Must be an http(s) URL. Keep the file reachable and unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale each frame. Number, 2-6. Output frames must not exceed 8,300,000 pixels. - `durationSeconds` (number, required): Length of the clip in seconds, used to price the job. The real clip is probed at dispatch and a job whose charge understates it is failed and fully refunded. - `width` (integer, required): Width of the source video in pixels. - `height` (integer, required): Height of the source video in pixels. - `fps` (integer, optional): Target output frame rate, reached by frame interpolation. Omit to keep the source rate. Allowed values: 30, 48, 50, 60. Each frame per second above 24 adds 0.01 credits per second of video, priced from the target alone: a target at or below the source rate changes nothing but is still charged, so omit fps then. ```bash curl -X POST https://upsampler.com/api/v2/video/upscale/rtx-vsr \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "videoUrl": "https://example.com/clip.mp4", "upscaleFactor": 2, "durationSeconds": 12.5, "width": 1280, "height": 720 } }' ``` ### POST /video/upscale/gan Upscale a video with GAN. Price: 0.2 credits per output megapixel-second, plus 0.01 per second for each fps of a target above 24. Fields (all inside `input`): - `videoUrl` (string, required): Publicly accessible URL of the video to upscale. Must be an http(s) URL. Keep the file reachable and unchanged until the job completes; a file that changes after submission fails the job with a refund. - `upscaleFactor` (number, required): Factor by which to upscale each frame. Number, 2-6. Output frames must not exceed 8,300,000 pixels. - `durationSeconds` (number, required): Length of the clip in seconds, used to price the job. The real clip is probed at dispatch and a job whose charge understates it is failed and fully refunded. - `width` (integer, required): Width of the source video in pixels. - `height` (integer, required): Height of the source video in pixels. - `fps` (integer, optional): Target output frame rate, reached by frame interpolation. Omit to keep the source rate. Allowed values: 30, 48, 50, 60. Each frame per second above 24 adds 0.01 credits per second of video, priced from the target alone: a target at or below the source rate changes nothing but is still charged, so omit fps then. ```bash curl -X POST https://upsampler.com/api/v2/video/upscale/gan \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "videoUrl": "https://example.com/clip.mp4", "upscaleFactor": 2, "durationSeconds": 12.5, "width": 1280, "height": 720 } }' ``` ## Utilities ### POST /image/edit/background-removal Remove an image's background, returning the subject on transparency. Price: 1 credit per image, flat. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to process, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https), a URL from POST /uploads, or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. A base64 image must be under 2.25 MB, since it travels inside the capped request body; upload anything larger. Keep the file at a URL of your own unchanged until the job completes; a file that changes after submission fails the job with a refund. ```bash curl -X POST https://upsampler.com/api/v2/image/edit/background-removal \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg" } }' ``` ### POST /image/edit/depth-map Generate a depth map of an image. Price: 1 credit per image, flat. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to process, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https), a URL from POST /uploads, or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. A base64 image must be under 2.25 MB, since it travels inside the capped request body; upload anything larger. Keep the file at a URL of your own unchanged until the job completes; a file that changes after submission fails the job with a refund. ```bash curl -X POST https://upsampler.com/api/v2/image/edit/depth-map \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg" } }' ``` ### POST /image/edit/colorize Colorize a black and white image, keeping the original resolution and detail. Price: 5 credits per image, flat. Fields (all inside `input`): - `imageUrl` (string, required): URL of the image to process, or the image encoded as a base64 data URI. Must be a publicly accessible URL (http/https), a URL from POST /uploads, or a base64 data URI. Supported formats are png, jpeg, jpg, and webp. A base64 image must be under 2.25 MB, since it travels inside the capped request body; upload anything larger. Keep the file at a URL of your own unchanged until the job completes; a file that changes after submission fails the job with a refund. ```bash curl -X POST https://upsampler.com/api/v2/image/edit/colorize \ -H "Authorization: Bearer $UPSAMPLER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "webhook": "https://your-service.com/webhook", "input": { "imageUrl": "https://example.com/image.jpg" } }' ``` ## Machine-readable - Full reference (this document): https://upsampler.com/api/v2/llms.txt - OpenAPI 3.1: https://upsampler.com/api/v2/openapi.json - Live model table with current prices, limits and what each model is best for (public, no key): `GET https://upsampler.com/api/v2/models` - MCP server (Streamable HTTP, OAuth or the same API key): https://upsampler.com/api/mcp