Pixazo APIModelsSmart Resize
Pixazo APIModelsSmart Resize

Smart Resize API - AI Image Generation APIs

by Smart Resize

Smart Resize API leverages the Nano Banana Pro Vision-LLM-guided model to perform composition-aware recomposition that goes beyond simple cropping, understanding image context to resize visuals to multiple target dimensions while maintaining structural integrity. It utilizes adaptive prompting to ensure high-quality, visually balanced outputs across different aspect ratios.

Get API Key
Smart Resize API

Models Version

LIMITED TIME OFFER

Get $5 Free Credit on First Payment

No strings attached — add funds and get $5 bonus instantly

Claim Your $5 →

Smart Resize 1.0 Image to Image API Documentation

https://gateway.pixazo.ai/smart-resize/v1

Authentication

All requests require an API key passed via header.

Header Type Required Description
Ocp-Apim-Subscription-Key string Yes Your API subscription key

Smart Resize generate request - Smart Resize

Request Code

POST /smart-resize-request HTTP/1.1
Host: gateway.pixazo.ai
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg",
  "target_sizes": [
    "1024x1024",
    "1920x1080"
  ]
}
import requests

url = "https://gateway.pixazo.ai/smart-resize/v1/smart-resize-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg",
    "target_sizes": [
        "1024x1024",
        "1920x1080"
    ]
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/smart-resize/v1/smart-resize-request';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
  image_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg',
  target_sizes: [
    '1024x1024',
    '1920x1080'
  ]
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/smart-resize/v1/smart-resize-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg",
    "target_sizes": [
      "1024x1024",
      "1920x1080"
    ]
  }'

Output

{
  "images": [
    {
      "file_name": "nano-banana-pro-edit-output.png",
      "content_type": "image/png",
      "url": "[RESPONSE_URL]"
    }
  ],
  "description": ""
}

Request Parameters - Smart Resize generate request

Field Type Required Default Description
image_url string Yes URL of the source image to resize. Must be publicly accessible.
target_sizes string[] Yes Array of target dimensions in format "widthxheight", e.g., ["1920x1080", "1024x1024"].
prompt string No "" Optional extra instruction to guide the resizing process (e.g., "keep face centered", "preserve details").
num_images_per_size integer No 1 Number of variant images to generate for each target size.
resolution enum No "1K" Output resolution quality. Allowed: `1K`, `2K`, `4K`.
output_format enum No "png" Output image format. Allowed: `jpeg`, `png`, `webp`.
safety_tolerance enum No "4" Safety filtering intensity level. Allowed: `1`, `2`, `3`, `4`, `5`, `6`. Higher values are more restrictive.
seed integer No Random seed for reproducible results. Use the same seed to generate identical outputs.
sync_mode boolean No false If true, returns base64-encoded data URIs instead of CDN URLs in the output.

Minimum Request

{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg",
  "target_sizes": [
    "1024x1024"
  ]
}

Full Request (all options)

{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg",
  "target_sizes": [
    "1024x1024",
    "1920x1080"
  ],
  "prompt": "keep face centered",
  "num_images_per_size": 2,
  "resolution": "2K",
  "output_format": "webp",
  "safety_tolerance": "5",
  "seed": 42,
  "sync_mode": false
}

Response

{
  "request_id": "smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Response Fields - Smart Resize generate request

Field Type Description
request_id string Unique identifier for the request to use when polling for results.
status string Current status of the request (e.g., QUEUED, PROCESSING).
polling_url string URL to use for checking the status of the request.

Request Headers

Header Value
Content-Type application/json
Cache-Control no-cache
Ocp-Apim-Subscription-Key Your API subscription key

Response Handling

Common status codes for Smart Resize generate request.

Code Meaning
200 Success
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

Error Responses

400 Validation Error

{
  "error": "Invalid target_sizes format",
  "details": "Each item in target_sizes must be in format 'widthxheight'"
}

404 Not Found

{
  "error": "Resource not found",
  "details": "The requested endpoint does not exist"
}

Status Values

Status Description
QUEUED Request accepted, waiting to be processed
PROCESSING Being processed by the model
COMPLETED Done — output contains the result
FAILED Failed — check error field for details
ERROR System error occurred — request was not charged

Status Flow

QUEUED → PROCESSING → COMPLETED/FAILED/ERROR

Typical Workflow

  1. Submit image request via /smart-resize-request
  2. Receive request_id in response
  3. Poll /v2/requests/status/{request_id} every 2-3 seconds
  4. When status is COMPLETED, extract image URLs from output.media_url
  5. If FAILED or ERROR, check error field for diagnostic information

Smart Resize check status - Smart Resize

Request Code

POST /smart-resize-request-result HTTP/1.1
Host: gateway.pixazo.ai
Content-Type: application/json
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "request_id": "smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
import requests

url = "https://gateway.pixazo.ai/v2/requests/status/smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
headers = {
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())
const requestId = 'smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
const url = \`https://gateway.pixazo.ai/v2/requests/status/\${requestId}\`;
const headers = {
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};

fetch(url, {
  method: 'GET',
  headers: headers
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Output

{
  "images": [
    {
      "file_name": "nano-banana-pro-edit-output.png",
      "content_type": "image/png",
      "url": "[RESPONSE_URL]"
    }
  ],
  "description": ""
}

Request Parameters - Smart Resize check status

Field Type Required Default Description
request_id string Yes The request_id returned from the original /smart-resize-request submission.

Minimum Request

{
  "request_id": "smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Full Request (all options)

{
  "request_id": "smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Response

{
  "request_id": "smart-resize_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "smart-resize",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/smart-resize_019dxxxx/output_1024x1024_0.png",
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/smart-resize_019dxxxx/output_1920x1080_0.png",
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/smart-resize_019dxxxx/output_768x1344_0.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields - Smart Resize check status

Field Type Description
request_id string Unique identifier for the request.
status string Current status of the request (e.g., COMPLETED, FAILED).
model_id string The model used to process the request.
error string/null Error message if the request failed, otherwise null.
output.media_url string[] Array of public URLs for the generated images.
output.media_type string The MIME type of the generated images (e.g., image/png).
created_at string Timestamp when the request was created (ISO 8601).
updated_at string Timestamp when the request was last updated (ISO 8601).
completed_at string Timestamp when the request was completed (ISO 8601).

Request Headers

Header Value
Ocp-Apim-Subscription-Key Your API subscription key

Response Handling

Common status codes for Smart Resize check status.

Code Meaning
200 Success
Bad Request
401 Unauthorized
404 Not Found
Too Many Requests
500 Internal Server Error

Notes & Tips

  1. Poll the status endpoint every 2–3 seconds until status is COMPLETED, FAILED, or ERROR.
  2. Implement exponential backoff for retry logic on 5xx HTTP errors.
  3. Use the seed parameter for consistent results during testing or iterative refinement.
  4. For production use, validate image_url accessibility before submission.
  5. Prefer output_format: webp for smaller file sizes with high quality.
  6. Use sync_mode: true only for small batches or local testing — data URIs increase response size significantly.
  7. Processing time typically takes 10–30 seconds depending on image size and complexity.
  8. The API generates one image per target_size x num_images_per_size, so a single request with two target sizes and two variants per size will produce 4 output images.

Smart Resize 1.0 Image to Image API Pricing

No data available

Could not load current pricing