python calls DALL·E

Request Sandbox
1from openai import OpenAI
2
3client = OpenAI(
4 base_url="https://api.AiApiGiaRe.io/v1",
5 api_key=key
6)
7
8response = client.images.generate(
9 model="dall-e-3",
10 prompt="a white siamese cat",
11 size="1024x1024",
12 quality="standard",
13 n=1,
14)
15
16image_url = response.data[0].url
Target: api.aiapigiare.io.vn
TLS 1.3 Active

Image Generation API Guide

Request Sandbox
1from openai import OpenAI
2
3client = OpenAI(
4 base_url="https://api.AiApiGiaRe.io/v1",
5 api_key=key
6)
7
8response = client.images.generate(
9 model="dall-e-3",
10 prompt="a white siamese cat",
11 size="1024x1024",
12 quality="standard",
13 n=1,
14)
15
16image_url = response.data[0].url
Target: api.aiapigiare.io.vn
TLS 1.3 Active

Overview of Features

The API provides three main functionalities:

  1. 🎨 Text-to-Image Generation (DALL·E 3 and DALL·E 2)
  2. ✏️ Image Editing (DALL·E 2 only)
  3. 🔄 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.
Infrastructure: AiApiGiaRe-v10.0
Gateway Status: Operational