Upscale image — POST /v1/upscale
Updated
https://api.imagemcpserver.com/v1/upscaleRuns a crisp upscaler over the input image and returns the enlarged result. Use it after generation and editing are settled, but before removing a background — the upscaler returns an opaque image, so transparent pixels come back white.
Overview
Increase an image's resolution while sharpening detail.
Flat 15 credits per call.
Pricing, examples and when to use it: AI image upscaler API.
Request
Headers
| Field | Type | Description |
|---|---|---|
Authorizationrequired | string | Bearer <IMAGEMCP_API_KEY>. The header x-api-key: <key> is accepted as an alternative. |
Content-Typerequired | string | application/json |
Body parameters
| Field | Type | Description |
|---|---|---|
imagerequired | string | Input image as an https URL or a base64 data URI. imageBase64 is accepted as an alias for the same value. |
responseFormat | "url" | "b64_json" | Defaults to "url". Pass "b64_json" to also receive result.b64_json and result.imageBase64 alongside the hosted URL. |
Examples
The same call in every form we support. The MCP tab is what an MCP client sends under the hood; the CLI tab is what an agent with the agent skill runs.
curl -X POST "https://api.imagemcpserver.com/v1/upscale" \
-H "Authorization: Bearer $IMAGEMCP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "https://example.com/photo.jpg"
}'imagemcp.js upscale --image ./photo.jpg --out ./photo-large.pngconst res = await fetch("https://api.imagemcpserver.com/v1/upscale", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.IMAGEMCP_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"image": "https://example.com/photo.jpg"
}),
});
const data = await res.json();
console.log(data.result.imageUrl);import os
import requests
res = requests.post(
"https://api.imagemcpserver.com/v1/upscale",
headers={"Authorization": f"Bearer {os.environ['IMAGEMCP_API_KEY']}"},
json={
"image": "https://example.com/photo.jpg"
},
timeout=120,
)
print(res.json()){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "upscale_image",
"arguments": {
"image": "https://example.com/photo.jpg"
}
}
}Response
Response fields
| Field | Type | Description |
|---|---|---|
result.imageUrl | string | Public URL of the upscaled image. |
result.scaleFactor | string | Echoes any scaleFactor you sent, "4x" otherwise. The upscaler takes no scale input, so this does not describe the output. |
deductedCredits | number | Always 15. |
userCredits | number | Balance remaining after the call. |
{
"success": true,
"message": "Image upscaled successfully via Fal.ai Crisp Upscaler",
"deductedCredits": 15,
"userCredits": 2424,
"result": {
"imageUrl": "https://cdn.imagemcpserver.com/upscale/upscale_5142312.png",
"scaleFactor": "4x",
"action": "upscale",
"hasInputImage": true,
"model": "fal-ai/recraft/upscale/crisp",
"seed": 118427,
"latency": "6.12s",
"cost": "$0.0250",
"deductedCredits": 15,
"userCredits": 2424
}
}When it fails
success: false with a message. See errors & troubleshooting for the status codes and whether a retry is worth it.FAQ
Can I choose 2x, 4x or 8x?
No. The upscaler takes no scale parameter — scaleFactor and scale are accepted and ignored, and every call is 15 credits.
Does upscaling keep transparency?
No. Transparent pixels come back white, so upscale first and run remove_background afterwards.
Should I upscale before or after editing?
After editing, but before removing a background — the upscaler flattens alpha to white.