OpenAI

1. Overview

The industry's largest language model. Edit an image based on the text prompt.

Available model list:

  • gpt-image-1

  • gpt-image-1.5

2. Request Description

  • Request method: POST

  • Request address: https://gateway.theturbo.ai/v1/images/edits

3. Input Parameters

3.1 Header Parameters

Parameter Name
Type
Required
Description
Example Value

Content-Type

string

Yes

Set the request header type, which must be multipart/form-data

multipart/form-data; boundary=------------------------y0QNRDhXQUE3yHQi7DEbLz

Accept

string

Yes

Set the response type, which is recommended to be unified as application/json

application/json

Authorization

string

Yes

API_KEY required for authentication. Format: Bearer $YOUR_API_KEY

Bearer $YOUR_API_KEY

3.2 Body Parameters (application/json)

Parameter Name
Type
Required
Description
Example (Default Value)

model

string

Yes

Model ID to use. See available models listed in the Overview for details, such as gpt-image-1.

gpt-image-1

prompt

string

Yes

A text describing the required image. The maximum length of the gpt-image description is 32000 characters.

A cute baby sea otter

image

file/file array

No

Submit images for editing.

For gpt-image, each image must be a PNG, WEBP, or JPG file smaller than 25 MB. You can submit up to 16 images in the array.

mask

file

No

An additional image used as a mask. Fully transparent areas (for example, where alpha equals zero) indicate the regions to be edited.

If multiple images are provided, the mask will be applied to the first image.

The mask must be a valid PNG file smaller than 4 MB, and its dimensions must match those of the image.

n

number

No

The number of generated images must be between 1 and 10. gpt-image-1.5 only supports n=1.

1

size

string

No

The size of the generated image. gpt-image-1.5 supports 1024x1024, 1792x1024, 1024x1792, and gpt-image-1 supports 1024x1024, 1536x1024, 1024x1536.

1024x1024

quality

string

No

Quality options for generated images. Supports high, medium, and low.

high

4. Request Example

5. Response Example

Last updated