# Text-to-Image

**Method**: `POST`
**Endpoint**: `/v1/images/generations`

[image](https://platform.openai.com/docs/api-reference/images)

This section contains endpoint-specific behavior, parameters, or usage notes for this API.

This section contains endpoint-specific behavior, parameters, or usage notes for this API.

This section contains endpoint-specific behavior, parameters, or usage notes for this API.

## Request Parameters

### Header Parameters

```text
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}
```

### Body Parameters application/json

```text
prompt
string
Required
  // provider-specific example normalized for English documentation
n
integer
Optional
  // provider-specific example normalized for English documentation
size
string
Optional
  // provider-specific example normalized for English documentation
Example
{
"prompt"
:
"string"
,
"n"
:
0
,
"size"
:
"string"
}
```

## Example Request

### Shell

```bash
curl --location --request POST '/v1/images/generations' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "string",
    "n": 0,
    "size": "string"
}'
```

## Response

### 🟢 200 Create image

**Content Type**: `application/json`

#### Response Schema

```text
created
integer
Required
data
array
[object]
Required
url
string
Required
```

#### Example

```json
{
    "created": 1589478378,
    "data": [
        {
            "url": "https://..."
        },
        {
            "url": "https://..."
        }
    ]
}
```
