Change8
Error2 reports

Fix OpenrouterException

in LiteLLM

Solution

OpenrouterException often arises from OpenRouter's strict validation of `image_generation` API usage, specifically when `imageUsage` fields like `pixels` or `token_charges` are expected to be integers but receive fractional values. To resolve this, ensure any values submitted for `imageUsage` in your code are explicitly converted to integers before sending the request to OpenRouter. Round or truncate the fractional values as appropriate for your application's needs.

Timeline

First reported:8h ago
Last reported:8h ago

Need More Help?

View the full changelog and migration guides for LiteLLM

View LiteLLM Changelog