# Smart Resize > Smart image resize to arbitrary dimensions, powered by Nano Banana Pro with vision-LLM-guided prompting for composition-aware recomposition. Crop, cropping, resize ads. ## Overview - **Endpoint**: `https://inference.mixio.pro/models/run` - **Model ID**: `mixio/smart-resize` - **Category**: image-to-image ## Credits - **Currency**: credits - **Rounding**: Per-unit credit rates use the catalog precision; the final request charge rounds up to a whole credit. - **Estimate API**: `/models/pricing/estimate` - **Rate card**: `default` - **Base credits**: 11 - **Minimum credits**: 11 ## API Information ### Input Schema - **`seed`** (`unknown`, _optional_): Optional random seed forwarded to the inner nano-banana-pro /edit calls for reproducibility. The same seed is used for every target size when set. - **`prompt`** (`string`, _optional_): Optional extra instruction that is forwarded to nano-banana-pro alongside the auto-generated resize prompt. Leave empty to let the model preserve the original image content as closely as possible. - Default: `""` - **`image_url`** (`string`, _required_): The URL of the source image to resize. - **`sync_mode`** (`boolean`, _optional_): When True, the response contains data URIs in place of CDN URLs so the client can decode the images without an extra HTTP request. Adds latency for large outputs. - Default: `false` - **`resolution`** (`string`, _optional_): Hint for the minimum resolution tier to use internally. The smart-resize algorithm may pick a higher tier automatically when the requested target size is too large for this tier. This field does not affect the final output dimensions — those come from ``target_sizes``. - Default: `"1K"` - Options: `1K`, `2K`, `4K` - **`target_sizes`** (`array`, _required_): The list of target dimensions to generate, each written as ``x`` (e.g. ``"1920x1080"``). One output image is produced per target size (multiplied by ``num_images_per_size``). The endpoint internally picks the smallest nano-banana-pro preset that fully covers each target so the final image is a pixel-perfect match with no upscaling. - **`output_format`** (`string`, _optional_): The output image format. - Default: `"png"` - Options: `jpeg`, `png`, `webp` - **`safety_tolerance`** (`string`, _optional_): The safety tolerance level applied to the inner nano-banana-pro /edit calls. Higher numbers loosen safety filtering. - Default: `"4"` - Options: `1`, `2`, `3`, `4`, `5`, `6` - **`num_images_per_size`** (`integer`, _optional_): The number of nano-banana-pro variants to produce for each target size. The response images list will contain ``len(target_sizes) * num_images_per_size`` images in total. - Default: `1` **Example**: ```json { "image_url": "" } ``` ### Output Schema - **`images`** (`array`): All generated images, flattened across every target size. Order matches the order of ``results`` below: the first ``num_images_per_size`` entries correspond to ``target_sizes[0]`` and so on. - **`results`** (`array`): Per-target-size breakdown with the requested width/height and the nano-banana-pro (aspect_ratio, resolution) preset that was used internally. - **`description`** (`string`): The description of the generated images. ## Usage Examples ### cURL ```bash curl "https://inference.mixio.pro/models/run" \ -H "content-type: application/json" \ -H "x-api-key: $MIXIO_API_KEY" \ -d '{"endpointId": "mixio/smart-resize", "input": {"prompt": "..."}}' ``` ### TypeScript ```typescript import { client, postModelsRun } from "@mixio-pro/sdk-ts"; client.setConfig({ baseUrl: "https://inference.mixio.pro", headers: { "x-api-key": process.env.MIXIO_API_KEY } }); const { data } = await postModelsRun({ body: { endpointId: "mixio/smart-resize", input: { prompt: "..." } } }); ``` ### Python ```python from mixio_pro import Sdk sdk = Sdk(base_url="https://inference.mixio.pro", headers={"x-api-key": "your-key"}) result = sdk.client.post("/models/run", json={"endpointId": "mixio/smart-resize", "input": {"prompt": "..."}}) print(result.json()["requestId"]) ``` ## Additional Resources - [Console](https://console.mixio.pro/models/mixio/smart-resize) - [API Docs](https://inference.mixio.pro/docs) - [OpenAPI Schema](https://inference.mixio.pro/models/openapi.json?endpoint_id=mixio/smart-resize)