> ## Documentation Index
> Fetch the complete documentation index at: https://docs.venice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Venice API is OpenAI-compatible: use any OpenAI SDK with the base URL `https://api.venice.ai/api/v1` and a Venice API key, or pay per request from a USDC wallet through x402 with no account.
> Read model IDs from `GET /models` or `GET /models/traits` at runtime instead of hardcoding them from memory or from these pages. Models are added and retired often.
> Every model's price is in https://docs.venice.ai/pricing.md. Quote video and audio jobs with `POST /video/quote` or `POST /audio/quote` before you queue them.
> Search these docs from an MCP client at https://docs.venice.ai/mcp. The full agent guide is https://docs.venice.ai/agents.md.

# Image Upscaling

> Enhance and upscale images with Venice's synchronous /image/upscale endpoint.

Image upscaling improves the resolution and visual quality of an existing image. Send an image to `/image/upscale`, choose a scale factor and optional creativity level, and Venice returns the enhanced image as binary data.

Use image upscaling when you already have an image and want a higher-resolution output. Use [image generation](https://docs.venice.ai/guides/media/image-generation.md) when you need to create an image from a prompt, and [image editing](https://docs.venice.ai/guides/media/image-editing.md) when you need to change image content.

## Basic Usage

```python Python theme={"system"}
import base64
import os
from pathlib import Path

import requests

image_base64 = base64.b64encode(Path("input.jpg").read_bytes()).decode("utf-8")

response = requests.post(
    "https://api.venice.ai/api/v1/image/upscale",
    headers={
        "Authorization": f"Bearer {os.environ['VENICE_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "image": image_base64,
        "scale": 2,
        "creativity": 0.01,
    },
)

response.raise_for_status()
Path("upscaled.png").write_bytes(response.content)
```

```javascript Node.js theme={"system"}
import { readFile, writeFile } from "node:fs/promises";

const image = await readFile("input.jpg");

const response = await fetch("https://api.venice.ai/api/v1/image/upscale", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.VENICE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    image: image.toString("base64"),
    scale: 2,
    creativity: 0.01,
  }),
});

if (!response.ok) {
  throw new Error(await response.text());
}

const output = Buffer.from(await response.arrayBuffer());
await writeFile("upscaled.png", output);
```

```bash cURL theme={"system"}
IMAGE_BASE64=$(base64 < input.jpg | tr -d '\n')

curl https://api.venice.ai/api/v1/image/upscale \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"image\": \"$IMAGE_BASE64\",
    \"scale\": 2,
    \"creativity\": 0.01
  }" \
  --output upscaled.png
```

You can also upload a file directly with `multipart/form-data` instead of base64-encoding it:

```bash cURL (multipart) theme={"system"}
curl https://api.venice.ai/api/v1/image/upscale \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -F "image=@input.jpg" \
  -F "scale=2" \
  -F "creativity=0.01" \
  --output upscaled.png
```

Send exactly one `image` part per request. Uploaded files must be under 25 MB.

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `image` | string or file | Yes | Source image. Send base64 in JSON, or upload a file part with `multipart/form-data`. Must be at least 256×256 pixels. File uploads must be 25 MB or smaller; JSON bodies are capped at 35 MB. |
| `scale` | number | No | Upscale factor between `2` and `4`. Defaults to `2`; use `2` or `4` (in-between values are accepted and billed at the 4x rate). Output is capped at 16,777,216 pixels (4096×4096): if the requested scale would exceed the cap, the server reduces the effective scale automatically. Inputs already at or near the cap are rejected with `400`, so downsize them first. |
| `creativity` | number | No | How much detail and texture the upscaler adds. `0`–`0.02`, default `0.01`. Higher values add more; lower values stay closer to the source. Values outside the range are clamped. |

> [!NOTE]
>
> The response is binary image data, not JSON. Write the response body directly to a file or stream it to storage.

## Input Tips

* Start with the cleanest source image you have. Upscaling improves detail, but it cannot fully recover information that is not present.
* Use moderate scale factors for production workflows. Very large outputs can increase latency and file size.
* Keep the original image around if you need to compare quality or retry with different settings.

## Related Resources

* [Image Upscale API](https://docs.venice.ai/api-reference/endpoint/image/upscale.md)
* [Image Models](https://docs.venice.ai/models/image.md)
* [Image Editing Guide](https://docs.venice.ai/guides/media/image-editing.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.