# AI Background  I/O

### Intro

The AI Background Endpoint allows you to turn simple product photos into beautiful visual assets. In just a few seconds, you can get up to 4 options and select the images that work best for you.

The generated images have a size of 1024×1024 pixels. You can further improve their resolution and quality using our Image Editing API, see the [Resizing](https://docs.claid.ai/image-editing-api/image-operations/resizing) and [Upscale](https://docs.claid.ai/image-editing-api/image-operations/restorations#upscale) sections for more info.

#### Limitations

Only one product image can be processed per request.

### Output

Configuring output is optional. By default, you may omit the output option from the request payload. In this case, our system stores the result in a temporary bucket with a lifespan of 24 hours and provides a public URL to the image.

Alternatively, you can use a connected [Cloud Storage](https://docs.claid.ai/storage-connectors): just configure the path to the folder where you want to store results.

#### Output image file types

The following image formats are supported for the output: JPEG, PNG, WEBP, and AVIF.

#### Basic and advanced output options

You may also specify advanced output, like number of images to generate, image format, and format-specific options like PNG compression level, JPEG quality, or using JPEG progressive display type.

{% tabs %}
{% tab title="Basic Usage" %}

```json
{
    "output": "storage://storage-name/result-path/image-name.jpg"
}
```

{% endtab %}

{% tab title="Advanced Usage" %}

```json
"output": {
    "destination": "storage://storage-name/result-path/image-name.jpg",
    "format": "jpeg",
    "number_of_images": 1
}
```

{% endtab %}

{% tab title="Advanced Format Usage" %}

```json
"output": {
    "destination": "storage://storage-name/result-path/image-name.jpg",
    "format": {
        "type": "jpeg",
        "quality": 85,
        "progressive": true
    },
    "number_of_images": 1
}

```

{% endtab %}
{% endtabs %}

&#x20;See the full list of the advanced format-specific options at [Image I/O](https://docs.claid.ai/image-editing-api/image-i-o#basic-and-advanced-output-options) for more info.

#### Number of images

With AI Background API, you can generate up to 4 images with one request.

{% hint style="danger" %}
Every generated image charges 2 credit.&#x20;

Setting <mark style="color:purple;">`number_of_images`</mark> to <mark style="color:purple;">4</mark> will charge 8 credits per request.

The <mark style="color:purple;">`number_of_images`</mark> option **defaults** to <mark style="color:purple;">4</mark>.
{% endhint %}

```json
{
    "output": {
        "number_of_images": 2
    }
}
```
