OpenAI

1. Overview

The industry's largest language model.

Available model list:

  • dall-e-2

  • dall-e-3

2. Request Description

  • Request method: POST

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

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 application/json

application/json

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

dall-e-2

prompt

string

Yes

A text describing the required image. The maximum length of the dall-e-2 description is 1000 characters, and the maximum length of the dall-e-3 description is 4000 characters.

A cute baby sea otter

n

number

No

The number of generated images must be between 1 and 10. dall-e-3 only supports n=1.

1

size

string

No

The size of the generated image. dall-e-2 supports 256x256, 512x512, 1024x1024, and dall-e-3 supports 1024x1024, 1792x1024, 1024x1792.

1024x1024

quality

string

No

Quality options for generated images. hd will create images with finer details and higher consistency. This parameter is only applicable to dall-e-3.

standard

style

string

No

Style of the generated image. vivid tends to generate surreal and dramatic images, while natural tends to generate more natural and less surreal images. This parameter is only applicable to dall-e-3.

vivid

4. Request Example

POST /v1/images/generations
Content-Type: application/json
Accept: application/json
Authorization: Bearer $YOUR_API_KEY

{
	"model": "dall-e-2",
	"prompt": "A cute baby sea otter",
	"n": 1,
	"size": "1024x1024"
}

5. Response Example

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

Last updated