OpenAI Image Generation
Interface description: Compatible endpoint (Vensen diagram) of OpenAI Images API /v1/images/generations. The request, response and error formats fully comply with the OpenAI specification: OpenAI original ImagesResponse is returned, and the AiToEarn universal response package is not used; the image link is the original return from the upstream and is not transferred. Authentication uses Authorization: Bearer <API Key> (OpenAI SDK carries it by default). Existing OpenAI SDK or ecological tools only need to replace the baseURL and API Key to access, and billing is based on AiToEarn points.
The model value comes from data[n].name returned by the “Image Generation Model” interface. If you need the AiToEarn universal response format (code === 0) and the stable image link after dumping, please use the “Generate Image” interface instead.
Authorizations
Pass the API Key obtained from AiToEarn. Go to the "API Key Tutorial". Example: Bearer xxx.
Body
"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"
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.
"1024x1024"

