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 - 4000Image 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.
Number of images generated
1 <= x <= 10Image quality. The optional values vary from model to model, and are subject to the data[n].qualities returned by the "Image Generation Model" interface.
Return format
url, b64_json 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.
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
The request has been processed by the service. Business success is determined by whether the response body has code === 0.

