You can force trim a video to end at a specified time by adding the {"trim_to_length_in_seconds": SECONDS} parameter to your API request.
You can also use the trim_start_time and trim_end_time parameters to trim your clip to a specific time using HH:MM:SS notation.
Check out the API Reference ↗ page for more parameters