Skip to main content

Documentation Index

Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Image Upscaler is an asynchronous image-to-image API for enlarging and enhancing one source image. Use it when you already have an image URL and want a higher-resolution output without writing a text prompt.
CapabilityValue
Model IDimage-upscaler
Modeimage-to-image only
Input imagesExactly 1 public image URL
PromptNot supported
Resolution tiers2k, 4k, 8k
Output formatsjpg, png, webp

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/image-upscalerSubmit an upscaling task
GET/statusTask/image-upscaler?taskId={taskId}Poll task status and retrieve results
All requests require your APIXO API key:
Authorization: Bearer YOUR_API_KEY
Submit requests also require:
Content-Type: application/json

Copy-paste async quickstart

This minimal request submits a 4k JPG upscaling task and returns a taskId.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/image-upscaler" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "image-to-image",
      "image_urls": [
        "https://example.com/input.jpg"
      ],
      "resolution": "4k",
      "output_format": "jpg"
    }
  }'
Successful response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Save the taskId; you need it to poll for the final result.

Poll for result

curl -X GET "https://api.apixo.ai/api/v1/statusTask/image-upscaler?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Processing response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
Success response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/upscaled-image.jpg\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
Failed response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "Unknown error",
    "failMsg": "Unknown error.",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const imageUrls = payload.resultUrls;
Parse resultJson only after state becomes success.

Request body

Default 4k JPG

{
  "request_type": "async",
  "input": {
    "mode": "image-to-image",
    "image_urls": [
      "https://example.com/input.jpg"
    ],
    "resolution": "4k",
    "output_format": "jpg"
  }
}

8k WebP

{
  "request_type": "async",
  "input": {
    "mode": "image-to-image",
    "image_urls": [
      "https://example.com/product-shot.png"
    ],
    "resolution": "8k",
    "output_format": "webp"
  }
}

Parameters

request_type
string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
callback_url
string
Required when request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.
input
object
required
Image Upscaler input parameters.

Response format

Submit task response

POST /generateTask/image-upscaler returns a task ID when the task is accepted:
code
integer
API status code. 200 means the task was accepted.
message
string
Human-readable status message.
data.taskId
string
Unique task identifier used with the status endpoint.

Status response fields

taskId
string
Unique task identifier.
state
string
Current task state: pending, processing, success, or failed.
resultJson
string
JSON string containing the upscaled image URL in resultUrls. Present when state is success.
failCode
string
Machine-readable failure code. Present when state is failed.
failMsg
string
Human-readable failure message. Present when state is failed.
createTime
integer
Task creation timestamp in Unix milliseconds.
completeTime
integer
Task completion timestamp in Unix milliseconds. Present after completion.
costTime
integer
Processing duration in milliseconds when available. For polling success responses, Image Upscaler reads this from the upstream inference timing.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/image-upscaler" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "image-to-image",
      "image_urls": [
        "https://example.com/input.jpg"
      ],
      "resolution": "4k",
      "output_format": "jpg"
    }
  }'
Successful callback payload:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/upscaled-image.jpg\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
See Webhooks for delivery requirements and retry behavior.

Billing

Image Upscaler is billed per submitted image at $0.01 / image. In the current backend implementation, billing is fixed for the model and does not vary by resolution or output_format.
Billing dimensionValue
UnitPER_IMAGE
APIXO price$0.01 / image
Parameter-based tiersNone
Affected by resolutionNo
Affected by output_formatNo
For current route and market comparison pricing, see Pricing.

Latency and polling

Image Upscaler tasks run asynchronously. Actual latency varies by source image size, selected target resolution, upstream queue load, and result storage time.
PhaseStatus you may seeClient behavior
Upstream processingprocessingKeep polling
CompletedsuccessParse resultJson
FailedfailedRead failCode and failMsg
Recommended polling pattern:
Use caseRecommended first pollPoll interval
Normal workloads10s-15s after task creation5s-10s
8k or high-concurrency workloadsPrefer callback modeIf polling, use 10s or longer
For production queues or large batches, use callback mode to avoid frequent polling and to handle longer 8k jobs more cleanly.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

CodeMeaningWhat to do
400Invalid request body, mode, image URL shape, resolution, or output formatFix the request before retrying
401Missing or invalid API keyCheck the Authorization header
402Insufficient balance or quotaAdd balance or switch account/key
403Key or route cannot access the modelCheck permissions and route strategy
404Task not foundVerify the taskId and model ID
429Rate limit or concurrency limit reachedRetry with exponential backoff
500Server or unmapped upstream errorRetry with backoff
502Upstream service errorRetry with backoff
504Upstream timeoutRetry or use callback mode for long-running jobs

Request validation

ConditionBackend behavior
Missing inputReturns The required parameter {{input}} is missing.
Invalid modeReturns Invalid mode type. Supported: image-to-image
Missing image_urlsReturns The required parameter {{image_urls}} is missing.
image_urls is not an arrayReturns The parameter {{image_urls}} must be Array type.
image_urls length is not 1Returns The parameter {{image_urls}} must contain exactly 1 image.
image_urls[0] is not a stringReturns The parameter {{image_urls}} Array elements must be String type.
image_urls[0] is emptyReturns The parameter {{image_urls}} cannot contain empty string.
Invalid resolutionReturns The parameter {{resolution}} must be either '2k', '4k' or '8k'.
Invalid output_formatReturns The parameter {{output_format}} must be either 'jpg', 'png' or 'webp'.

Task failure codes

Fail codeMeaningWhat to do
ImageFormatIncorrectThe upstream service rejected the input image formatUse a direct public JPG, PNG, or WebP image URL
SensitiveContentInput or generated content was rejected by safety checksUse a different image
RateLimitedUpstream rate limit was reachedRetry with backoff
TimeoutUpstream service did not finish in timeRetry or use callback mode
Unknown errorUpstream service returned an unmapped failureRetry with backoff or contact support with the taskId
See Error Codes for the full error reference.