Generate Image
Interface description: Generate images synchronously, and return the generation results based on the selected model and prompt words.
Before calling this interface, please request the “Image Generation Model” interface (GET /api/ai/models/image/generation) to obtain the currently available model list and the size, quality, style and price supported by each model, and then fill in the parameters of this interface accordingly.
The image is generated as Wen Sheng Picture: Generate a new image only through text prompts, without passing in pictures. If you need to modify or redraw based on existing images, please use the “Edit Image” interface.
If you are already using the OpenAI SDK or ecological tools, you can use the OpenAI compatible endpoint “OpenAI Image Generation” instead.
Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Body
Image description tips
1 - 4000"A cute orange cat sitting by a window, soft natural light"
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.
"gpt-image-2"
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.
"low"
Return format
url, b64_json "url"
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. This example uses 1024x1024, the lowest-priced size at 1 credit.
"1024x1024"
Response
The request has been processed by the service. Business success is determined by whether the response body has code === 0.

