Skip to main content
Image generation is a Pro feature. Upgrade to access.
Generate high-quality images from text descriptions using our optimized Flux architecture.

Endpoint

POST https://api.llm.kiwi/v1/images/generations

Request Parameters

ParameterTypeRequiredDescription
promptstringYesText description of the desired image.
modelstringNoModel to use: flux (default) or dall-e-3.
nintegerNoNumber of images to generate (1-4). Default: 1.
sizestringNoImage dimensions: 1024x1024, 1792x1024, 1024x1792.
qualitystringNoQuality level: standard or hd. Default: standard.
stylestringNoStyle preset: vivid or natural. Default: vivid.
response_formatstringNoReturn format: url or b64_json. Default: url.

Example Usage

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llm.kiwi/v1",
    api_key="YOUR_API_KEY"
)

response = client.images.generate(
    model="flux",
    prompt="A futuristic city built on a floating island, digital art",
    size="1024x1024",
    quality="hd"
)

print(response.data[0].url)

Response Object

{
  "created": 1706745600,
  "data": [
    {
      "url": "https://cdn.llm.kiwi/images/abc123.png",
      "revised_prompt": "A cute kiwi bird in a detailed spacesuit..."
    }
  ]
}

Content Moderation

All prompts are filtered for safety. Requests that violate our content policy will be rejected with a 400 error.
Prohibited content includes:
  • Violence or gore
  • Adult or explicit content
  • Hate speech or discrimination
  • Real public figures without consent

Prompt Engineering Tips

  • Be Specific: “A red sports car” → “A cherry red 1965 Ford Mustang convertible on a coastal highway at sunset”
  • Add Style: Include terms like photorealistic, oil painting, 3D render, minimalist
  • Set Mood: Use descriptors like golden hour lighting, moody atmosphere, high contrast
  • Describe Composition: Specify camera angle, focal length, or framing

Need More?

Contact us for batch image generation or custom model training.