# Upscale an image or video

URL: https://clippie.ai/developers/docs/upscale

Upscales an image (2x-6x) or a video (to 720p, 1080p or 4K) with Topaz. Spends credits: about 7 for a 2x image (more at 4x and 6x) and 155 for a video of up to 30 seconds to 1080p at 60 fps. The price follows the real file: bigger images, longer videos (up to 10 minutes) and 4K cost more. Run with dryRun: true (or estimate_cost) first and confirm the cost. Images finish within the call; videos return a running job, so use get_job with waitSeconds.

## At a glance

| Property | Value |
| --- | --- |
| REST | `POST https://api.clippie.ai/v1/ai/upscale` |
| MCP tool | `upscale` |
| Scope | `create` |
| Cost | Spends credits or minutes, at the same prices as the app. Send `"dryRun": true` (or call [estimate_cost](https://clippie.ai/developers/docs/estimate-cost.md)) first to see the exact cost without spending anything. |
| Limit bucket | `upscale` (see [Rate limits](https://clippie.ai/developers/docs.md#rate-limits)) |

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `fileId` | body | string | No |  | The image or video to upscale: a file id from POST /v1/files. 1-80 chars. |
| `url` | body | string | No |  | The image or video to upscale: a file id from POST /v1/files (file_…) or a public https URL (copied into Clippie first, up to 100 MB). 1-2048 chars. |
| `mediaType` | body | string | No |  | Optional check: refuse the call unless the file is this type. One of `image`, `video`. |
| `upscaleFactor` | body | string | No | `"2x"` | Images: how much bigger. One of `2x`, `4x`, `6x`. |
| `enhanceModel` | body | string | No | `"Standard V2"` | One of `Standard V2`, `Low Resolution V2`, `CGI`, `High Fidelity V2`, `Text Refine`. |
| `outputFormat` | body | string | No | `"jpg"` | One of `jpg`, `png`, `webp`. |
| `faceEnhancement` | body | boolean | No | `false` |  |
| `targetResolution` | body | string | No | `"1080p"` | Videos: output resolution. One of `720p`, `1080p`, `4k`. |
| `targetFps` | body | integer | No | `60` | Videos: output frame rate. 15-60. |
| `dryRun` | body | boolean | No |  | Check the request and return { estimate } (credits and minutes) without spending anything. |
| `webhookUrl` | body | string (URL) | No |  | https URL that receives job.completed / job.failed, signed with your webhook secret. Up to 2048 chars. |
| `Idempotency-Key` | header | string | No |  | Retry-safe key: a retry with the same key and body within 24 hours returns the first job instead of starting (and charging) again. The same key with a different body is a 409. MCP clients pass it as the idempotencyKey argument. 1-255 chars. MCP: `idempotencyKey`. |

## Example

curl:

```bash
# 1. Dry run: the exact cost, nothing is spent.
curl https://api.clippie.ai/v1/ai/upscale \
  -H "Authorization: Bearer $CLIPPIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/photo.jpg",
    "upscaleFactor": "2x",
    "dryRun": true
  }'
# => { "dryRun": true, "estimate": { "credits": ..., "minutes": { ... }, "wouldSucceed": true } }

# 2. The real call. Keep the key and send the same one if you retry, so it is never charged twice.
KEY=$(uuidgen)
curl https://api.clippie.ai/v1/ai/upscale \
  -H "Authorization: Bearer $CLIPPIE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $KEY" \
  -d '{
    "url": "https://example.com/photo.jpg",
    "upscaleFactor": "2x"
  }'
# => 202 { "job": { "id": "job_...", "status": "queued", ... } }
```

upscale.mjs:

```js
import { randomUUID } from 'node:crypto';

const auth = { Authorization: `Bearer ${process.env.CLIPPIE_API_KEY}` };

const input = {
  "url": "https://example.com/photo.jpg",
  "upscaleFactor": "2x"
};

async function call(body, headers = {}) {
  const res = await fetch('https://api.clippie.ai/v1/ai/upscale', {
    method: 'POST',
    headers: { ...auth, 'Content-Type': 'application/json', ...headers },
    body: JSON.stringify(body),
  });
  const json = await res.json();
  if (!res.ok) throw new Error(`${json.error.type}: ${json.error.message}`);
  return json;
}

// 1. Dry run: the exact cost, nothing is spent. Confirm it before going on.
const { estimate } = await call({ ...input, dryRun: true });
console.log(estimate); // { credits, minutes, wouldSucceed, reason }

// 2. Create. Keep the key and reuse it on retries, so a retry never charges twice.
let { job } = await call(input, { 'Idempotency-Key': randomUUID() });

// 3. Wait. Each call holds for up to 30 seconds until the job changes.
while (!['completed', 'failed', 'canceled'].includes(job.status)) {
  const res = await fetch(`https://api.clippie.ai/v1/jobs/${job.id}?wait=30`, { headers: auth });
  ({ job } = await res.json());
}
console.log(job.status, job.output);
```

## Response

`202 { job }`: the job, straight away. Wait for it with [Get job](https://clippie.ai/developers/docs/get-job.md) (`?wait=30`) or a `webhookUrl`; see [Jobs and waiting](https://clippie.ai/developers/docs.md#jobs). With `"dryRun": true` the answer is `200 { dryRun: true, estimate }` and nothing is started.

202 Accepted:

```json
{
  "job": {
    "id": "job_abc123",
    "object": "job",
    "kind": "upscale",
    "status": "queued",
    "step": null,
    "progress": null,
    "input": {
      "prompt": "The lost library of Alexandria"
    },
    "output": null,
    "cost": {
      "credits": 0,
      "minutes": {
        "voiceover": 1,
        "captions": 1,
        "export": 1
      }
    },
    "error": null,
    "source": "api",
    "webhookUrl": null,
    "createdAt": "2026-10-24T12:00:00.000Z",
    "startedAt": null,
    "completedAt": null
  }
}
```

Dry run (200), shape only:

```json
{
  "dryRun": true,
  "estimate": {
    "credits": 0,
    "minutes": {
      "voiceover": 0,
      "captions": 0,
      "export": 0
    },
    "wouldSucceed": true
  }
}
```

## From an MCP client

Your AI calls `upscale` with the same fields as JSON arguments, plus `idempotencyKey` instead of the header. See [MCP server](https://clippie.ai/developers/docs.md#mcp) to connect one.

tools/call:

```json
{
  "name": "upscale",
  "arguments": {
    "url": "https://example.com/photo.jpg",
    "upscaleFactor": "2x",
    "idempotencyKey": "a-unique-key-per-thing-you-make"
  }
}
```
