API Documentation
Integrate AI-powered image upscaling into your applications with a simple REST API.
Quick Start
Upscale an image in three steps. Choose your language:
Get your API key
Sign up free and verify your email to get your API key from the dashboard. A free account's monthly images can be used through the API. Use it as a Bearer token in all requests:
Authorization: Bearer YOUR_API_TOKEN
Upload an image for upscaling
curl -X POST https://www.upscale-media.ai/api/images/upscale \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -F "image=@photo.jpg" \ -F "scale_factor=2" # Returns 202 with image ID in data.id
response = requests.post(
"https://www.upscale-media.ai/api/images/upscale",
headers={"Authorization": f"Bearer {token}"},
files={"image": open("photo.jpg", "rb")},
data={"scale_factor": 2}
)
image_id = response.json()["data"]["id"]
const formData = new FormData();
formData.append("image", fileInput.files[0]);
formData.append("scale_factor", "2");
const upload = await fetch("https://www.upscale-media.ai/api/images/upscale", {
method: "POST",
headers: { "Authorization": `Bearer ${token}` },
body: formData
});
const imageId = (await upload.json()).data.id;
$response = Http::withToken($token)
->attach('image', file_get_contents('photo.jpg'), 'photo.jpg')
->post('https://www.upscale-media.ai/api/images/upscale', [
'scale_factor' => 2,
]);
$imageId = $response->json('data.id');
Poll until complete, then download
# Poll for completion
while true; do
STATUS=$(curl -s https://www.upscale-media.ai/api/images/$IMAGE_ID \
-H "Authorization: Bearer YOUR_API_TOKEN" \
| jq -r '.data.status')
echo "Status: $STATUS"
[ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] && break
sleep 3
done
# Get the download URL
curl -s https://www.upscale-media.ai/api/images/$IMAGE_ID/download \
-H "Authorization: Bearer YOUR_API_TOKEN" \
| jq -r '.data.download_url'
import time
# Poll for completion
while True:
result = requests.get(
f"https://www.upscale-media.ai/api/images/{image_id}",
headers={"Authorization": f"Bearer {token}"}
).json()
status = result["data"]["status"]
print(f"Status: {status}")
if status in ("completed", "failed"):
break
time.sleep(3)
# Get the download URL
download = requests.get(
f"https://www.upscale-media.ai/api/images/{image_id}/download",
headers={"Authorization": f"Bearer {token}"}
).json()
print(download["data"]["download_url"])
// Poll for completion
const poll = async (id) => {
while (true) {
const res = await fetch(`https://www.upscale-media.ai/api/images/${id}`, {
headers: { "Authorization": `Bearer ${token}` }
});
const { data } = await res.json();
console.log(`Status: ${data.status}`);
if (data.status === "completed" || data.status === "failed") {
return data;
}
await new Promise(r => setTimeout(r, 3000));
}
};
const image = await poll(imageId);
// Get the download URL
const dl = await fetch(`https://www.upscale-media.ai/api/images/${imageId}/download`, {
headers: { "Authorization": `Bearer ${token}` }
});
const { data: dlData } = await dl.json();
console.log(dlData.download_url);
// Poll for completion
do {
sleep(3);
$result = Http::withToken($token)
->get("https://www.upscale-media.ai/api/images/{$imageId}")
->json();
$status = $result['data']['status'];
echo "Status: {$status}\n";
} while (!in_array($status, ['completed', 'failed']));
// Get the download URL
$download = Http::withToken($token)
->get("https://www.upscale-media.ai/api/images/{$imageId}/download")
->json();
echo $download['data']['download_url'];
Overview
The Upscale Media API lets you integrate AI-powered image upscaling into your applications. Upload images (or send them by link), get notified or check when they're done, and download the enhanced versions, all via simple REST endpoints.
Response Format
All responses return JSON with a consistent envelope:
{
"success": true,
"message": "Human-readable status message",
"data": { ... }
}
Error responses include success: false and may include an errors object for validation failures.
Authentication
Authenticate by including a Bearer token in the Authorization header. Obtain a token by registering or logging in via the API, or from your
dashboard after signing up.
Authorization: Bearer YOUR_API_TOKEN
/api/auth/register
Public
Create a new account and receive a Bearer token. A verification email is sent automatically.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Full name (max 255 characters) |
| string | Yes | Valid email address (unique) | |
| password | string | Yes | Min 8 characters, mixed case, numbers |
| password_confirmation | string | Yes | Must match password |
| device_name | string | No | Label for the token (defaults to user agent) |
{
"success": true,
"message": "Registration successful. Please verify your email to access all features.",
"data": {
"user": {
"id": 1,
"name": "Jane Smith",
"email": "jane@example.com",
"email_verified_at": null,
"profile_photo_url": "https://...",
"created_at": "2026-02-15T12:00:00.000000Z",
"updated_at": "2026-02-15T12:00:00.000000Z",
"pricing_plan": {
"id": 1,
"name": "Free",
"slug": "free"
}
},
"token": "1|abc123...",
"token_type": "Bearer"
}
}
/api/auth/login
Public
Authenticate with email and password. Returns a Bearer token. Requires a verified email address.
curl -X POST https://www.upscale-media.ai/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "jane@example.com", "password": "your-password"}'
{
"success": true,
"message": "Login successful",
"data": {
"user": { ... },
"token": "2|xyz789...",
"token_type": "Bearer"
}
}
/api/auth/logout
Authenticated
Revoke the current API token.
{"success": true, "message": "Logout successful"}
/api/auth/revoke-all
Authenticated
Revoke all API tokens for your account. Use this if a token is compromised.
{"success": true, "message": "All tokens revoked successfully"}
Images
Upload images for AI upscaling, check processing status, and download enhanced results. Upscaling is asynchronous — submit an image, then poll for completion.
/api/images/upscale
Authenticated
Submit an image for upscaling. Returns immediately with a 202 Accepted status while processing happens in the background.
Body Parameters (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| image | file | This or image_url | JPEG, PNG, WebP, BMP, TIFF, or GIF. Max 10MB, 100 to 10,000 pixels a side. An image longer than 4,096 pixels is scaled down to 4,096 before upscaling, so 2x of it is 8,192 pixels on the longest side; for an exact larger size, use target_width/target_height. An image that could only come back smaller is refused with a 422 before it counts. |
| image_url | string | This or image | Send the image by link instead of uploading it. A public http:// or https:// address on the standard port; we fetch it once (up to 3 redirects, 20 seconds, your plan's file size). Addresses on private networks are refused. An account can have 2 links being fetched at once; past that you get a 429 with Retry-After. The link is returned as source_url. |
| callback_url | string | No | A public https:// address we notify the moment the image is finished or failed, so you don't need to keep checking. See Webhooks. |
| scale_factor | integer | No | 2, 3, or 4. Defaults to 2. Cannot be used with target_width/target_height. |
| target_width | integer | No | Exact output width in pixels (1–16384). If target_height is omitted, it is calculated automatically to preserve aspect ratio. Cannot be used with scale_factor. |
| target_height | integer | No | Exact output height in pixels (1–16384). If target_width is omitted, it is calculated automatically to preserve aspect ratio. Cannot be used with scale_factor. |
Sizing options: Use scale_factor for simple 2x/3x/4x upscaling, or specify a target resolution. You can provide both target_width and target_height for exact dimensions, or just one — the other will be calculated automatically to preserve the original aspect ratio. The target must be larger than the original and achievable within your plan's max scale (e.g., 4x).
curl -X POST https://www.upscale-media.ai/api/images/upscale \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -F "image=@photo.jpg" \ -F "scale_factor=2"
import requests
response = requests.post(
"https://www.upscale-media.ai/api/images/upscale",
headers={"Authorization": "Bearer YOUR_API_TOKEN"},
files={"image": open("photo.jpg", "rb")},
data={"scale_factor": 2}
)
print(response.json())
const formData = new FormData();
formData.append("image", fileInput.files[0]);
formData.append("scale_factor", "2");
const response = await fetch("https://www.upscale-media.ai/api/images/upscale", {
method: "POST",
headers: { "Authorization": "Bearer YOUR_API_TOKEN" },
body: formData
});
const data = await response.json();
$response = Http::withToken('YOUR_API_TOKEN')
->attach('image', file_get_contents('photo.jpg'), 'photo.jpg')
->post('https://www.upscale-media.ai/api/images/upscale', [
'scale_factor' => 2,
]);
$data = $response->json();
{
"success": true,
"message": "Image uploaded and queued for processing",
"data": {
"id": 42,
"original_filename": "photo.jpg",
"original_size": 2048576,
"original_size_human": "2 MB",
"original_dimensions": null,
"status": "pending",
"scale_factor": 2,
"target_width": null,
"target_height": null,
"api_request": true,
"created_at": "2026-02-15T12:00:00.000000Z",
"updated_at": "2026-02-15T12:00:00.000000Z"
}
}
Tip: Add a callback_url and we tell your system when the image is done. Otherwise poll GET /api/images/{id} every few seconds until status is completed or failed.
/api/images/{id}
Authenticated
Get the status and details of a specific image. Use this to poll for processing completion.
curl https://www.upscale-media.ai/api/images/42 \ -H "Authorization: Bearer YOUR_API_TOKEN"
response = requests.get(
"https://www.upscale-media.ai/api/images/42",
headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
print(response.json())
const response = await fetch("https://www.upscale-media.ai/api/images/42", {
headers: { "Authorization": "Bearer YOUR_API_TOKEN" }
});
const data = await response.json();
$response = Http::withToken('YOUR_API_TOKEN')
->get('https://www.upscale-media.ai/api/images/42');
$data = $response->json();
{
"success": true,
"message": "Image retrieved successfully",
"data": {
"id": 42,
"original_filename": "photo.jpg",
"original_path": "images/originals/abc123.jpg",
"upscaled_path": "images/upscaled/abc123.jpg",
"original_size": 2048576,
"upscaled_size": 8194304,
"original_size_human": "2 MB",
"upscaled_size_human": "7.81 MB",
"original_dimensions": "1920x1080",
"upscaled_dimensions": "3840x2160",
"original_dimensions_formatted": "1920 x 1080",
"upscaled_dimensions_formatted": "3840 x 2160",
"status": "completed",
"scale_factor": 2,
"target_width": null,
"target_height": null,
"processing_time": 4.82,
"api_request": true,
"download_url": "https://...",
"created_at": "2026-02-15T12:00:00.000000Z",
"updated_at": "2026-02-15T12:00:05.000000Z"
}
}
Image Statuses
/api/images
Authenticated
List all your images with pagination. Newest first.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number |
| per_page | integer | 15 | Items per page (max 100) |
| status | string | all | Filter: pending, processing, completed, or failed |
curl "https://www.upscale-media.ai/api/images?per_page=10&status=completed" \ -H "Authorization: Bearer YOUR_API_TOKEN"
{
"success": true,
"message": "Images retrieved successfully",
"data": [ { ... }, { ... } ],
"meta": {
"current_page": 1,
"last_page": 3,
"per_page": 10,
"total": 27
},
"links": {
"first": "https://www.upscale-media.ai/api/images?page=1",
"last": "https://www.upscale-media.ai/api/images?page=3",
"prev": null,
"next": "https://www.upscale-media.ai/api/images?page=2"
}
}
/api/images/{id}/download
Authenticated
Get a download URL for a completed image. Returns an error if the image is still processing.
{
"success": true,
"message": "Download URL generated successfully",
"data": {
"download_url": "https://...",
"filename": "photo.jpg"
}
}
/api/images/{id}
Authenticated
Permanently delete an image and its upscaled version.
{"success": true, "message": "Image deleted successfully"}
Batches
Upload multiple images at once for batch upscaling. Each image is processed independently and you can track overall batch progress.
/api/batches
Authenticated · Pro/Enterprise
Upload up to 20 images in a single request. Returns immediately with a 202 Accepted status while all images are queued for processing.
Body Parameters (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| images[] | file[] | Yes | 1-20 image files. JPEG, PNG, WebP, BMP, TIFF, or GIF. Max 10MB per file. |
| scale_factor | integer | No | 2, 3, or 4. Applied to all images. Defaults to 2. Cannot be used with target dimensions. |
| target_width | integer | No | Exact output width in pixels (1–16384). Applied to all images. If target_height is omitted, aspect ratio is preserved. |
| target_height | integer | No | Exact output height in pixels (1–16384). Applied to all images. If target_width is omitted, aspect ratio is preserved. |
| name | string | No | Optional label for this batch (max 255 characters). |
| callback_url | string | No | A public https:// address notified as each image in the batch finishes or fails. See Webhooks. |
curl -X POST https://www.upscale-media.ai/api/batches \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -F "images[]=@photo1.jpg" \ -F "images[]=@photo2.jpg" \ -F "images[]=@photo3.jpg" \ -F "scale_factor=2" \ -F "name=Product photos"
{
"success": true,
"message": "Batch created and images queued for processing",
"data": {
"id": 7,
"name": "Product photos",
"status": "pending",
"total_images": 3,
"completed_images": 0,
"failed_images": 0,
"scale_factor": 2,
"progress": 0,
"images": [
{ "id": 101, "batch_id": 7, "original_filename": "photo1.jpg", "status": "pending", ... },
{ "id": 102, "batch_id": 7, "original_filename": "photo2.jpg", "status": "pending", ... },
{ "id": 103, "batch_id": 7, "original_filename": "photo3.jpg", "status": "pending", ... }
],
"created_at": "2026-02-15T12:00:00.000000Z",
"updated_at": "2026-02-15T12:00:00.000000Z",
"completed_at": null
}
}
Tip: Poll GET /api/batches/{id} to track overall progress. The progress field shows completion percentage. All images must fit within your remaining monthly quota.
/api/batches/{id}
Authenticated · Pro/Enterprise
Get the status and details of a batch, including all its images. Use this to poll for batch completion.
curl https://www.upscale-media.ai/api/batches/7 \ -H "Authorization: Bearer YOUR_API_TOKEN"
{
"success": true,
"message": "Batch retrieved successfully",
"data": {
"id": 7,
"name": "Product photos",
"status": "completed",
"total_images": 3,
"completed_images": 3,
"failed_images": 0,
"scale_factor": 2,
"progress": 100,
"images": [
{ "id": 101, "status": "completed", "download_url": "https://...", ... },
{ "id": 102, "status": "completed", "download_url": "https://...", ... },
{ "id": 103, "status": "completed", "download_url": "https://...", ... }
],
"created_at": "2026-02-15T12:00:00.000000Z",
"updated_at": "2026-02-15T12:00:05.000000Z",
"completed_at": "2026-02-15T12:00:05.000000Z"
}
}
Batch Statuses
/api/batches
Authenticated · Pro/Enterprise
List all your batches with pagination. Newest first.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number |
| per_page | integer | 15 | Items per page (max 100) |
| status | string | all | Filter: pending, processing, completed, partially_failed, failed, or cancelled |
{
"success": true,
"message": "Batches retrieved successfully",
"data": [ { ... }, { ... } ],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 2
},
"links": { ... }
}
/api/batches/{id}
Authenticated · Pro/Enterprise
Cancel a pending/processing batch or permanently delete a completed batch. Cancelling marks unfinished images as failed.
{"success": true, "message": "Batch cancelled successfully"}
Webhooks
Add callback_url to an upload (or a batch) and we send a POST to that address as soon as each image is finished or has failed, so your code doesn't have to keep asking. The address must be public https:// on the standard port.
What we send
Content-Type: application/json
X-Upscale-Event: image.completed
X-Upscale-Delivery: 5b0c3f0e-9d5a-4c51-8a3e-3f1d2c7b9e10
X-Upscale-Signature: t=1795000000,v1=5f2c…
{
"event": "image.completed",
"created_at": "2026-11-17T18:04:12.000000Z",
"data": {
"id": 123,
"status": "completed",
"original_filename": "shoe.jpg",
"upscaled_dimensions": { "width": 2400, "height": 1800 },
"download_url": "https://…",
"callback": { "url": "https://example.com/hooks/upscale", "attempts": 1 }
}
}
event is image.completed or image.failed (then data.error_message says why). data is the same image object GET /api/images/{id} returns. The download_url expires after 30 minutes; for a fresh one call GET /api/images/{id}/download.
Answer quickly; we retry
Answer with any 2xx status within 10 seconds. Anything else, or no answer, is retried after 1 minute, 5 minutes, 30 minutes and 2 hours, then given up; the image's callback.delivered_at or callback.failed_at records how it went. Redirects are not followed. We send one notification per outcome; in the rare case an image reported failed is finished after all, you also get image.completed. Images in a batch you cancel are not notified. A delivery can occasionally arrive twice; use X-Upscale-Delivery or the image ID to ignore repeats.
Check that it came from us
Every request is signed with your account's webhook secret: X-Upscale-Signature holds a timestamp t and v1, the HMAC-SHA256 of t + "." + raw request body. Compute it yourself and compare, and reject old timestamps (say, older than 5 minutes).
// PHP
[$t, $v1] = sscanf($_SERVER['HTTP_X_UPSCALE_SIGNATURE'], 't=%d,v1=%s');
$body = file_get_contents('php://input');
$ok = hash_equals(hash_hmac('sha256', $t.'.'.$body, $secret), $v1) && abs(time() - $t) < 300;
// Node.js (Express: use express.raw() so the body is the exact bytes sent)
const [t, v1] = req.get('X-Upscale-Signature').match(/t=(\d+),v1=([a-f0-9]+)/).slice(1);
const expected = crypto.createHmac('sha256', secret).update(`${t}.${req.body}`).digest('hex');
const ok = v1.length === expected.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1)) && Math.abs(Date.now() / 1000 - t) < 300;
# Python
t, v1 = re.match(r"t=(\d+),v1=([a-f0-9]+)", request.headers["X-Upscale-Signature"]).groups()
expected = hmac.new(secret.encode(), f"{t}.".encode() + request.get_data(), hashlib.sha256).hexdigest()
ok = hmac.compare_digest(expected, v1) and abs(time.time() - int(t)) < 300
Your webhook secret
| GET /api/user/webhook-secret | Returns webhook_secret (starts with whsec_). Created the first time you ask. |
| POST /api/user/webhook-secret/rotate | Replaces it, for example if it leaked. Notifications are signed with the new one from then on. |
Account
Manage your profile, check usage quotas, and view subscription details.
/api/user
Authenticated
Get the authenticated user's profile and current plan.
{
"success": true,
"message": "User retrieved successfully",
"data": {
"id": 1,
"name": "Jane Smith",
"email": "jane@example.com",
"email_verified_at": "2026-02-15T12:05:00.000000Z",
"profile_photo_url": "https://...",
"created_at": "2026-02-15T12:00:00.000000Z",
"updated_at": "2026-02-15T12:00:00.000000Z",
"pricing_plan": {
"id": 2,
"name": "Starter",
"slug": "starter"
}
}
}
/api/usage
Authenticated
Check your current month's usage against your plan quota.
{
"success": true,
"message": "Usage statistics retrieved successfully",
"data": {
"plan": "starter",
"image_uploads": {
"used": 42,
"limit": 100,
"remaining": 58,
"unlimited": false,
"exceeded": false,
"percentage": 42.0
},
"period": {
"starts_at": "2026-10-06T14:20:11+00:00",
"renews_at": "2026-11-06T14:20:11+00:00",
"basis": "billing_period"
},
"in_progress": {
"count": 3,
"limit": 10
},
"api_test_images": {
"left": 0,
"total": 0
},
"features": ["api_access", "priority_support"]
}
}
/api/subscription
Authenticated
Get your current subscription status and plan details.
{
"success": true,
"message": "Subscription details retrieved successfully",
"data": {
"subscription": {
"id": 1,
"type": "default",
"status": "active",
"quantity": 1,
"trial_ends_at": null,
"ends_at": null,
"created_at": "2026-01-01T00:00:00.000000Z",
"is_active": true,
"is_on_trial": false,
"is_cancelled": false,
"is_on_grace_period": false
},
"plan": {
"name": "Starter",
"slug": "starter",
"price": 9,
"features": [...],
"limits": [...]
}
}
}
/api/user/tokens
Authenticated
List all your active API tokens.
{
"success": true,
"message": "API tokens retrieved successfully",
"data": {
"tokens": [
{
"id": 1,
"name": "My App",
"abilities": ["images:read", "images:write", "images:delete", "user:read"],
"last_used_at": "2026-02-15T11:30:00.000000Z",
"created_at": "2026-01-15T09:00:00.000000Z"
}
],
"count": 1
}
}
/api/user/tokens/{id}
Authenticated
Revoke a specific API token by its ID.
{"success": true, "message": "Token revoked successfully"}
Rate Limits
API requests are rate-limited based on your plan. Limits reset every hour.
| Plan | Requests / Hour | Images / Month |
|---|---|---|
| Unauthenticated | 10 | — |
| Free | 100 | 5 |
| Starter | 500 | 50 |
| Professional | 2,000 | 300 |
| Enterprise | 10,000 | 1,000 – 25,000 |
Rate Limit Headers
Image endpoints include headers to help you track your upload quota:
| Header | Description |
|---|---|
| X-RateLimit-Limit | Your plan's monthly image quota |
| X-RateLimit-Remaining | Remaining image uploads in the current period |
| X-Test-Images-Remaining | Only for a free account that has been given one-time API test images: how many are left. Uploads use these first, at up to 4x, and they do not count against the monthly images; once they are gone, uploads use the monthly images at the plan's 2x |
When Your Allowance Renews
Your allowance starts again either on the first of each month or on your billing date, depending on when your subscription began; the Free plan's is always the first of the month. GET /api/usage returns the exact dates in period.starts_at and period.renews_at.
Images in Progress
Each plan also limits how many of your images can be waiting or processing at the same moment. An upload beyond that is refused with 429 and a Retry-After header. A refused upload is not stored and does not count against your allowance; send it again once some of your images have finished.
| Plan | Images in Progress |
|---|---|
| Free | 2 |
| Starter | 10 |
| Professional | 25 |
| Enterprise | 50 – 300, by volume tier |
Retry-After: 15
{
"success": false,
"error": "too_many_in_progress",
"message": "You have 25 images in progress, the most your plan allows at once. Wait for some to finish, then try again.",
"in_progress": 25,
"limit": 25,
"retry_after": 15
}
GET /api/usage reports the current count and your limit in in_progress.
Errors
The API uses standard HTTP status codes. Errors return a consistent JSON structure.
{
"success": false,
"message": "Validation failed",
"errors": {
"image": ["The image field is required."],
"scale_factor": ["The scale factor must be between 2 and 4."]
}
}
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | The request was malformed or image processing failed |
| 401 | Unauthorized | Missing or invalid Bearer token |
| 403 | Forbidden | Email not verified, no API access on plan, subscription expired, or quota exceeded. When the quota is used up, error is quota_exceeded and the message gives the date it renews. |
| 404 | Not Found | Image or token not found |
| 422 | Validation Error | Invalid input. Check the errors object for field-specific messages. |
| 429 | Too Many Requests | Rate limit exceeded, or too many of your images in progress at once (error is too_many_in_progress). Wait for the number of seconds in Retry-After and send the request again. |
| 500 | Server Error | Something went wrong on our end. Try again later. |