# POST /ai/upscale-image

**Resource:** [AI](./ai.md)  
**Scopes:** `ai:use`  
**Write operation:** yes

Upscale an image using AI (Runware imageUpscale). Multiplies the source image dimensions by the given factor (2x, 3x, or 4x). Accepts any public http(s) image URL -- including URLs returned by generate-image or edit-image. The upscaled result is automatically saved to R2 and company files. Costs the same credits as generate-image (ai_image feature cost). Requires scope: ai:use.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `image_url` | body | string | yes | Public http(s) URL of the image to upscale. |
| `upscale_factor` | body | number | no | Multiplication factor: 2, 3, or 4. Default 2. A 1024x1024 source at 2x becomes 2048x2048. |
| `output_format` | body | string | no | Output format: "PNG" (default, lossless), "WEBP" (recommended -- ~10x smaller than PNG at same quality), "JPEG". Use WEBP if you plan to pass the result to optimize_image -- it stays within the 3 MB optimizer ceiling. |

## Response example

```json
{
  "data": {
    "image_url": "https://cdn.trustpager.com/files/company-id/images/upscaled.png",
    "cdn_url": "https://cdn.trustpager.com/files/company-id/images/upscaled.png",
    "image_id": "uuid",
    "upscale_factor": 2,
    "source_image_url": "https://example.com/source.png"
  },
  "meta": {
    "credits_remaining": 9150
  }
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`