OpenAI's video API is very specific about the 'seconds' parameter:
- Must be a STRING (not integer)
- Must be one of: "4", "8", or "12"
Changes:
- Convert duration to nearest valid value (4, 8, or 12 seconds)
- Send as string to match OpenAI's requirements
- Added info message when duration is auto-converted
- Updated default model to 'sora-2'
- Updated default duration to 4 (valid value)
- Updated documentation with OpenAI's duration constraints
- Keep flexible duration for non-OpenAI APIs
This fixes the 'invalid_type' error for the seconds parameter.