Edit images through conversational interface using Gemini Pro Image model
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
model | string | ✅ Yes | - | - | Model ID used to generate the response. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models. |
messages | array | ✅ Yes | - | - | A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. |
>messages.role | string | ✅ Yes | - | developerusersystem | The role of the messages author. |
>messages.name | string | ❌ No | - | - | An optional name for the participant. Provides the model information to differentiate between participants of the same role. |
>messages.content | string / array | ✅ Yes | - | - | The contents of the developer message. |
>>messages.content.type | string | ✅ Yes | - | textimage_url | The type of the content part |
>>messages.content.text | string | ❌ No | - | - | The text content |
>>messages.content.image_url | object | ❌ No | - | - | The image URL content |
>>messages.content.image_url.url | string | ❌ No | - | - | The URL of the image |
| Error Code | Error Name | Description |
|---|---|---|
| 401 | Unauthorized | API key is missing or invalid |
| 403 | Forbidden | Your API key doesn’t have permission to access this resource, or insufficient balance for the requested operation |
| 429 | Too Many Requests | You’ve exceeded your rate limit |
| 500 | Internal server error | An internal server error occurred |
| 503 | Content policy violation | Content blocked due to safety concerns (actual status code is 400) |