Skip to main content
Each AI provider has its own API format, parameter names, and supported features. Lumenfall abstracts these differences for you, so you can write code once and have it work consistently across all models and providers.

Parameter support

When you make a request, Lumenfall handles parameters in four ways, from weakest to strongest support:
Provider-specific parameters: Any parameters not recognized by Lumenfall are passed through to the upstream provider. This lets you use provider-specific features without waiting for explicit Lumenfall support. See Passing additional parameters for examples.

Universal features

These features are normalized across all models, giving you consistent behavior regardless of which provider handles your request:
When a model natively supports a feature, Lumenfall uses the native capability. Emulation only kicks in when needed.

response_format

Request images as URLs or base64-encoded data. When you request url but the provider returns base64, we temporarily store the image on our servers and return a URL valid for 60 minutes. The image is deleted after expiry with no copies retained. This applies regardless of your data retention settings. Supported values: url, b64_json

output_format and output_compression

Specify the image format you want. If the provider generates a different format, Lumenfall converts the image for you. Use output_compression to control quality for lossy formats. Supported formats: png, jpeg, gif, webp, avif
Lumenfall supports more output formats than OpenAI’s API. In addition to png, jpeg, and webp, we also support gif and avif. Note that AVIF conversion is limited to images up to 1,600 pixels; larger images will fall back to the original format.

Size, aspect ratio, and resolution

Control the shape and scale of generated images using three parameters. Lumenfall translates these into whatever format each provider expects — pixel dimensions, aspect ratio strings, resolution tiers, or preset sizes.
Always use size, aspect_ratio, and resolution instead of provider-specific parameters like image_size, width/height, or imageSize. Since Lumenfall may route your request to different providers, these three universal parameters ensure consistent behavior regardless of which provider handles it.

Parameters

All three are optional. When omitted, the model uses its defaults.

How parameters interact

When you provide multiple parameters, more specific inputs take priority:
  • size is the most specific — it determines both shape and scale. If you also pass aspect_ratio or resolution, they are ignored.
  • aspect_ratio + resolution — resolved independently. Shape is matched against the model’s supported ratios; scale is matched against supported tiers.
  • aspect_ratio alone — determines shape. Scale is left to the model’s default.
  • resolution alone — determines scale without changing shape (useful for upscaling).

Shape matching

When the exact aspect ratio you request isn’t supported by the model, Lumenfall finds the closest match by comparing the numeric ratio values. For example, requesting "7:1" on a model that supports ["4:1", "8:1"] will match to "8:1". If you request an exact ratio the model supports, it’s used as-is with no transformation.

Scale matching

Resolution tiers are matched against the model’s supported values. If you request a tier the model doesn’t support, Lumenfall picks the closest available tier rather than silently dropping your preference. For example, requesting "8K" on a model that supports ["1K", "4K"] will match to "4K". Two tier formats exist across providers — Lumenfall handles both transparently:

Dimension clamping

When a model accepts pixel dimensions with constraints (min/max width, height, or megapixels), Lumenfall clamps your dimensions to fit within the model’s bounds while preserving the aspect ratio when possible.

Error normalization

Each provider returns errors in different formats. Lumenfall transforms all provider errors into the standard OpenAI error format, so you can handle errors consistently.

Why this matters

  • Write once, switch freely - Change models without rewriting code
  • No provider lock-in - Your integration works with any provider
  • Predictable behavior - Same parameters, same results, regardless of which provider handles the request

Next steps

Available Models

Explore all available image and video generation models.

Routing

Learn how requests are routed to providers.