Skip to main content
Use dry run mode to estimate the cost of a request without executing it. This validates your request parameters and returns pricing information so you can make informed decisions before generating.

Making a dry run request

Add ?dryRun=true as a query parameter to any image generation or edit request:
curl "https://api.lumenfall.ai/openai/v1/images/generations?dryRun=true" \
  -H "Authorization: Bearer $LUMENFALL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3-pro-image",
    "prompt": "A capybara relaxing in a hot spring",
    "size": "1024x1024",
    "n": 2
  }'
Dry run mode works with both image generation and image editing endpoints.

Response format

Dry run requests return a cost estimate instead of generated images:
{
  "estimated": true,
  "model": "gemini-3-pro-image",
  "provider": "vertex",
  "total_cost_micros": 80000,
  "currency": "USD",
  "components": [
    {
      "type": "output",
      "metric": "image",
      "quantity": 2,
      "billable_quantity": 2,
      "unit_price": 0.04,
      "total_cost": 80000
    }
  ]
}

Response fields

FieldTypeDescription
estimatedbooleanAlways true for dry run responses
modelstringThe model that would be used
providerstringThe provider that would handle the request (may differ on actual request as routing is re-evaluated)
total_cost_microsintegerTotal estimated cost in micros (1/1,000,000 USD)
currencystringCurrency code (always USD)
componentsarrayBreakdown of cost components

Cost components

Each component in the components array contains:
FieldTypeDescription
typestringComponent type (e.g., output, input)
metricstringWhat is being measured (e.g., image, token)
quantityintegerNumber of units requested
billable_quantityintegerNumber of units that will be billed
unit_pricenumberPrice per unit in USD
total_costintegerComponent cost in micros

Converting micros to dollars

Costs are returned in micros (millionths of a dollar) for precision. To convert to dollars:
cost_dollars = total_cost_micros / 1_000_000
For example, 80000 micros equals $0.08.

Notes

Cost estimates are approximate. Effective pricing is calculated after the request runs, because final costs may depend on outputs (such as the number of tokens in a revised prompt).
Dry run requests:
  • Validate your request parameters
  • Do not generate images
  • Do not affect your account balance
  • Return quickly since no generation occurs