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:
ModeWhat HappensExample
PassthroughPassed as-is; provider may ignore if unsupportedstyle
RenamedField name mapped to provider’s expected name for this modelprompt
ConvertedValue transformed to provider’s format for this modelsize
EmulatedBehavior emulated even if model doesn’t support itn, response_format

Universal features

These features are normalized across all models, giving you consistent behavior regardless of which provider handles your request:
FeatureDescription
response_formatChoose url or b64_json for any model
output_formatChoose output format: png, jpeg, webp
output_compressionControl compression level for lossy formats
nRequest multiple images regardless of provider limits
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
# Get base64 data even if provider returns URLs
response = client.images.generate(
    model="gemini-3-pro-image",
    prompt="A mountain landscape",
    response_format="b64_json"
)

image_data = response.data[0].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, webp
response = client.images.generate(
    model="gemini-3-pro-image",
    prompt="A mountain landscape",
    output_format="webp",
    output_compression=85  # 0-100
)

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.
Provider ErrorNormalized To
Content policy violation400 content_policy_violation
Rate limit exceeded429 rate_limit_exceeded
Invalid image format400 invalid_request_error
Model not found404 model_not_found
Authentication failed401 invalid_api_key

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