Base URL
All API requests should be made to:Authentication
Include your API key in theAuthorization header:
Generate images
Make a POST request to/images/generations:
Response
Request parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
model | string | required | Model ID (e.g., gemini-3-pro-image, gpt-image-1.5, flux.2-max) |
prompt | string | required | Text description of the desired image |
n | integer | 1 | Number of images to generate (1-10) |
size | string | 1024x1024 | Image dimensions |
quality | string | standard | Image quality (standard or hd) |
response_format | string | url | Response format (url or b64_json) |
style | string | vivid | Image style (vivid or natural) |
Get base64 response
Passing additional parameters
Include any additional parameters in the JSON request body:Edit images
Make a POST request to/images/edits with multipart form data:
With a mask
Provide a mask to specify which areas should be edited:List models
Get all available models:Get a specific model
Estimate costs (dry run)
Add?dryRun=true to get a cost estimate without generating:
Response headers
Lumenfall includes useful headers in every response:| Header | Description |
|---|---|
X-Lumenfall-Provider | The provider that handled the request |
X-Lumenfall-Model | The model that was used |
X-Lumenfall-Request-Id | Unique request identifier for debugging |
Error handling
Error response format
HTTP status codes
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Invalid request parameters |
| 401 | AUTHENTICATION_FAILED | Invalid or missing API key |
| 402 | INSUFFICIENT_BALANCE | Account balance too low |
| 404 | MODEL_NOT_FOUND | Requested model doesn’t exist |
| 429 | RATE_LIMITED | Too many requests |
| 502 | ALL_PROVIDERS_EXHAUSTED | All providers failed |