The Aigena team integrated the Kling 4.0 video model via API in late October 2026. During testing, they discovered a billing discrepancy where the model automatically rendered 1080p video and charged for it, even when users requested 720p. This occurred because the model defaulted to maximum quality when image dimensions were not explicitly provided.
To resolve the issue, the developers implemented a new model flag, dimensions_with_frames, which forces the system to pass specific width and height parameters from a database table during the generation process. This ensures that the requested resolution matches the output and the associated cost, preventing unauthorized upscaling and unexpected expenses.
The team also identified that actual generation costs are 15% lower than the official price list, with 720p costing $0.1335 per second instead of the listed $0.157. They now verify costs using the cost field returned by the API rather than relying on static pricing. Kling 4.0 supports resolutions up to 1080p and durations from 3 to 30 seconds.
For quality assurance, the team uses automated scripts to validate video output. Tools like ffprobe verify file dimensions and audio channels, while ffmpeg generates frame strips to check scene transitions and peak volume levels to synchronize audio with visual events. Additionally, OpenAI's Whisper model is used to verify speech accuracy for supported languages.






