Where this fits
Text-to-video lets your application turn a prompt into a video-generation request. Knightvision provides the model endpoint and job lifecycle; your application determines who may submit, how settings are selected and how results are shown. Keep generation separate from the browser request lifecycle so a page refresh does not lose progress.
Plan the approach
Use a validated settings form rather than accepting arbitrary model fields from a client. Save the user’s prompt and chosen parameters with the job. The HTTP submission response does not mean the video has finished: wait for the documented complete state before exposing a playable result.
A practical workflow
- Select a supported text-to-video model and validate the requested settings.
- Send the JSON request from your server and save the job_id.
- Use bounded status checks, render progress in your app and handle complete and error explicitly.
WORKED EXAMPLE / ILLUSTRATIVE BRIEF
Put the idea into practice
Example JSON: {"model":"kling-v3-text-to-video","prompt":"A slow view across a quiet coastal road at sunrise","duration":5,"quality":"720p"}. The request is paid when submitted successfully.
What to check
Disable duplicate form submissions in your app and store the accepted job before starting the polling loop. Keep a timeout recoverable: the user should be able to return to the same job later.
Can the API key be placed in frontend JavaScript?
No. Keep it in a server-side environment variable or secret store. Your frontend should communicate with your own authenticated backend.
Tools and documentation
Use these product references for current settings and availability.