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

prompt word

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.

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.

response_format
enum<string>

Return format

Available options:
url,
b64_json
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.

style
string

Image style. The optional values ​​vary with the model, and are subject to the data[n].styles returned by the "Image Generation Model" interface; returning empty means that the model does not support style parameters.

Response

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

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