Skip to main content
POST
https://ai.kaiho.cc
/
v1
/
images
/
generations
GPT-4o Image Generation
curl --request POST \
  --url https://ai.kaiho.cc/v1/images/generations \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "model": "<string>",
  "size": "<string>",
  "quality": "<string>"
}
'

Overview

The GPT-4o Image Generation API allows you to create high-quality AI-generated images from text descriptions, supporting various sizes and styles.

Supported Models

DALL-E 3

OpenAI’s latest image generation model

DALL-E 2

Cost-effective image generation

Stable Diffusion

Open-source image generation model

Request Parameters

prompt
string
required
Image description text, up to 4000 characters. More detailed descriptions produce more precise images.
model
string
default:"dall-e-3"
Model to use:
  • dall-e-3 - Latest and most powerful
  • dall-e-2 - Economical choice
  • stable-diffusion-xl - Open-source option
size
string
default:"1024x1024"
Image size:
  • DALL-E 3: 1024x1024, 1024x1792, 1792x1024
  • DALL-E 2: 256x256, 512x512, 1024x1024
quality
string
default:"standard"
Image quality (DALL-E 3 only):
  • standard - Standard quality
  • hd - High definition (slower, more expensive)

Request Example

import openai

client = openai.OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://ai.kaiho.cc/v1"
)

response = client.images.generate(
    model="dall-e-3",
    prompt="A Shiba Inu wearing sunglasses surfing at the beach, digital art style",
    n=1,
    size="1024x1024",
    quality="hd",
    style="vivid"
)

image_url = response.data[0].url
print(f"Generated image: {image_url}")

Prompt Examples

A professional Asian woman in a business suit in a modern office,
natural lighting, shallow depth of field, shot on Sony A7III,
professional photography, ultra HD, realistic style
Usage Restrictions: Generated images are valid for 24 hours. Please download and save them promptly. Review terms of use before commercial use.