Skip to main content
POST
OpenAI Image Generation

Authorizations

Authorization
string
header
required

Pass the API Key obtained from AiToEarn. Go to the "API Key Tutorial". Example: Bearer xxx.

Body

application/json
prompt
string
required
Example:

"A cute orange cat sitting by a window, soft natural light"

model
string
required

Image generation model name. First call the "Image Generation Model" interface (GET /api/ai/models/image/generation) and pass in the data[n].name returned by it; the size, quality, style and price supported by each model shall be subject to the return of this interface.

Example:

"gpt-image-2"

quality
string

Image quality. The optional values ​​vary from model to model, and are subject to the data[n].qualities returned by the "Image Generation Model" interface.

Example:

"low"

response_format
enum<string>
Available options:
url,
b64_json
Example:

"url"

size
string

Image size. The optional values ​​vary with the model, and are subject to the data[n].sizes returned by the "Image Generation Model" interface; the prices for different sizes are different, see data[n].pricing.

Example:

"1024x1024"

Response

Native third-party protocol response or SSE data, not wrapped in the AiToEarn common response envelope.

data
object[]
created
number
quality
string
size
string
usage
object
Last modified on July 31, 2026