python calls DALL·E
Request Sandbox
1from openai import OpenAI23client = OpenAI(4 base_url="https://api.AiApiGiaRe.io/v1",5 api_key=key6)78response = client.images.generate(9 model="dall-e-3",10 prompt="a white siamese cat",11 size="1024x1024",12 quality="standard",13 n=1,14)1516image_url = response.data[0].urlTarget: api.aiapigiare.io.vn
TLS 1.3 ActiveImage Generation API Guide
Request Sandbox
1from openai import OpenAI23client = OpenAI(4 base_url="https://api.AiApiGiaRe.io/v1",5 api_key=key6)78response = client.images.generate(9 model="dall-e-3",10 prompt="a white siamese cat",11 size="1024x1024",12 quality="standard",13 n=1,14)1516image_url = response.data[0].urlTarget: api.aiapigiare.io.vn
TLS 1.3 ActiveOverview of Features
The API provides three main functionalities:
- 🎨 Text-to-Image Generation (DALL·E 3 and DALL·E 2)
- ✏️ Image Editing (DALL·E 2 only)
- 🔄 Image Variations (DALL·E 2 only)
1. Image Generation
Basic Usage
(Code extracted to sandbox)
Parameter Details
- Size Options:
1024x1024,1024x1792,1792x1024 - Quality Options:
standard(default)hd(exclusive to DALL·E 3)
- Quantity Limits:
- DALL·E 3: Up to 1 image per request
- DALL·E 2: Up to 10 images per request
2. Image Editing (DALL·E 2)
Example Usage
(Code extracted to sandbox)
Requirements
- 📝 The image and mask must be in PNG format.
- 📏 The image must be square.
- 💾 File size must be <4MB.
- ⚖️ The image and mask must have the same dimensions.
3. Image Variations (DALL·E 2)
Example Usage
(Code extracted to sandbox)
Technical Requirements
- 📝 Must be in PNG format.
- 📏 The image must be square.
- 💾 File size must be <4MB.
Prompting Tips
DALL·E 3 Features
- Automatically optimizes prompts for better results.
- You can control prompt optimization using special instructions:
(Code extracted to sandbox)
Important Notes
Content Moderation
- Strict adherence to content policies is required.
- Requests containing prohibited content will return an error.
Image URLs
- URLs are valid for 1 hour.
- Optionally, you can request the image in Base64 format.