> For the complete documentation index, see [llms.txt](https://docs.slier.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.slier.ai/api-reference/images.md).

# Images

### The image object <a href="#the-image-object" id="the-image-object"></a>

#### Represents the url or the content of an image generated by the S**lier**.AI API.

* Name`url`TypestringDescription

  The URL of the generated image, if `response_format` is `url` (default).

#### The image object

```json
{
  "url": "...."
}
```

***

### [Create image](https://docs.theb.ai/images#create-image) <a href="#create-image" id="create-image"></a>

**POST <https://api.Slier.ai/v1/images/generations>**

**POST <https://api.Slier.ai/v2/images/generations>**

Creates an image given a prompt.

**Available parameters**

`model` string Required ID of the model to use. See the model endpoint compatibility table for details on which models work with the Images API.

`prompt` string Required A text description of the desired image(s). The maximum length is 1000 characters.

`model_params` object Optional Each model is different Used to set various parameters of the model.

* `n` number or null Optional
  * The number of images to generate. Must be between 1 and 10.
* Obtain the other configurable parameters from the model interface.

#### Example Request

POST /v1/images/generations

```python

import requests
import json

url = "https://api.Slier.ai/v1/images/generations"
# url = "https://api.Slier.ai/v2/images/generations"

payload = json.dumps({
  "model": "dall-e-2",
  "model_params": {
    "n": 2,
    "size": "1024x1024"
  },
  "prompt": "a cute cat"
})
headers = {
  'Authorization': 'Bearer $API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.json())
```

#### Response

```json
{
  "id": "a71f6681d8e24b1ebcccc5966be884d1",
  "created": 1692157133,
  "data": [
    {
      "url": "https://example.com/a71f6681d8e24b1ebcccc5966be884d1_0"
    },
    {
      "url": "https://example.com/a71f6681d8e24b1ebcccc5966be884d1_1"
    }
  ]
}

```
