Skip to main content
This guide walks you through generating your first AI image using Lumenfall’s API.

Prerequisites

Generate an image

Lumenfall uses an OpenAI-compatible API, so you can use any OpenAI SDK or make direct HTTP requests.
curl https://api.lumenfall.ai/openai/v1/images/generations \
  -H "Authorization: Bearer $LUMENFALL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-3",
    "prompt": "A serene mountain landscape at sunset with dramatic clouds",
    "n": 1,
    "size": "1024x1024"
  }'

Response

The API returns image URLs in the standard OpenAI format:
{
  "created": 1702345678,
  "data": [
    {
      "url": "https://..."
    }
  ]
}

Available models

Lumenfall routes your requests to the best available provider. You can specify any supported model:
ModelProviderDescription
imagen-3Google VertexGoogle’s latest image generation model
imagen-3-fastGoogle VertexFaster variant with slightly lower quality
dall-e-3OpenAIOpenAI’s DALL-E 3
dall-e-2OpenAIOpenAI’s DALL-E 2
flux-proReplicateBlack Forest Labs Flux Pro
flux-schnellReplicateFast Flux variant
Use the Models API to list all available models and their capabilities.

Estimate costs before generating

Add ?dryRun=true to any request to get a cost estimate without actually generating the image:
curl "https://api.lumenfall.ai/openai/v1/images/generations?dryRun=true" \
  -H "Authorization: Bearer $LUMENFALL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-3",
    "prompt": "A test prompt",
    "size": "1024x1024"
  }'
The response includes cost breakdown in micros (1/1,000,000 of a dollar):
{
  "estimated": true,
  "model": "imagen-3",
  "provider": "vertex",
  "total_cost_micros": 40000,
  "currency": "USD",
  "components": [
    {
      "type": "output",
      "metric": "image",
      "quantity": 1,
      "billable_quantity": 1,
      "unit_price": 0.04,
      "total_cost": 40000
    }
  ]
}

Next steps