Here is a single, fully functioning HTML code that serves as a frontend interface for both AI Image Generation and AI Video Generation using the OpenRouter API. [1, 2]
Because video generation is an asynchronous operation (meaning it takes 30 seconds to a few minutes to build), the code contains an automatic polling loop that checks the status of your video job every 5 seconds until it is ready for download. [1, 3]
## Single HTML File (index.html)
Save the code below as an .html file (e.g., app.html) and open it directly in any web browser.
OpenRouter Image & Video Generator