Application Process
To use the API, you need to first apply for the corresponding service on the Midjourney Videos API page. After entering the page, click the “Acquire” button, as shown in the image below:
If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in. After logging in or registering, you will automatically return to the current page.
Upon your first application, there will be a free quota available for you to use the API for free.
Basic Usage
First, understand the basic usage method, which involves inputting the promptprompt, the action action, and the array of reference images for the first and last frames image_url to obtain the processed result. You first need to simply pass a field action with the value generate, which mainly includes two actions: generate video (generate), extend video (extend), as detailed below:

accept: the format of the response you want to receive, filled in asapplication/json, which means JSON format.authorization: the key to call the API, which can be directly selected after application.
image_url: the link to the reference image for the first frame of the generated video.end_image_url: optional, specifies the reference image for the last frame of the generated video.video_id: the video ID that needs to be specified when extending the video.video_index: specifies which specific video of thevideo_idto extend, with the index starting from 0, defaulting to 0.action: the action of this video generation task, mainly including two actions: generate video (generate), extend video (extend).prompt: the prompt.mode: the speed mode for video generation, defaulting to fast.resolution: the video clarity, defaulting to 720p.loop: whether to generate a looping video, defaulting to false.callback_url: the URL to receive the callback result.

success: the status of the video generation task at this time.task_id: the ID of the video generation task at this time.image_url: the cover image of the video generation task at this time.image_width: the width of the cover image of the video generation task at this time.image_height: the height of the cover image of the video generation task at this time.video_id: the video ID of the video generation task at this time.video_urls: the array of video links of the video generation task at this time.
video_urls.
Additionally, if you want to generate the corresponding integration code, you can directly copy the generated code, for example, the CURL code is as follows:
Extend Video Functionality
If you want to continue generating an already created Kling video, you can set the parameteraction to extend and input the ID of the video you want to continue generating. The video ID can be obtained based on the basic usage.
At this point, you can see that the ID of the video from the previous text is:
Note that the video_id here is the ID of the video generated after creation. If you do not know how to generate a video, you can refer to the basic usage above to generate a video.
Next, you must fill in the prompt for the next step to customize the video generation, specifying the following content:
video_index: select the index of the video to extend, which is the index from thevideo_urlsgenerated above, starting from 0, with a default value of 0.video_id: the specified video ID for extending the video.action: the action of this video extension, which isextend.prompt: the prompt.


Asynchronous Callback
Since the generation time of the Midjourney Videos API is relatively long, approximately 1-2 minutes, if the API does not respond for a long time, the HTTP request will keep the connection open, leading to additional system resource consumption. Therefore, this API also provides support for asynchronous callbacks. The overall process is: when the client initiates a request, an additionalcallback_url field is specified. After the client initiates the API request, the API will immediately return a result containing a task_id field, representing the current task ID. When the task is completed, the generated video result will be sent to the client-specified callback_url in the form of a POST JSON, which also includes the task_id field, allowing the task result to be associated by ID.
Let’s understand how to operate specifically through an example.
First, the Webhook callback is a service that can receive HTTP requests, and developers should replace it with the URL of their own HTTP server. For demonstration purposes, a public Webhook sample site https://webhook.site/ is used, and opening this site will provide a Webhook URL, as shown in the image:

https://webhook.site/556e6971-b41f-4fa8-9151-6e91acd0399f.
Next, we can set the callback_url field to the above Webhook URL and fill in the corresponding parameters, as shown in the image:

https://webhook.site/556e6971-b41f-4fa8-9151-6e91acd0399f, as shown in the image:

task_id field, and the other fields are similar to the above text, allowing the task to be associated through this field.
Error Handling
When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.

