Learn how to integrate our API
Learn how to use our API to generate animated videos.
The PopVid API uses an API key to authenticate requests. You must include an api-key header in all of your requests with your key provided as a Bearer token.
Example Header: X-API-Key: Bearer YOUR_API_KEY
/api/v1/gen_videoThis endpoint initiates the asynchronous generation of a video. You provide an image and a prompt, and you'll get back a request ID to track the status.
💡 Note: Each video generation consumes 30 credits and produces a 4-5 second video.
| Field | Type | Description | Required |
|---|---|---|---|
image | string | The URL of the source image or the base64 of the source image. | Yes |
prompt | string | A text prompt describing the desired animation (max 1000 characters). | Yes |
The API will respond with the request ID, which you can use to check the generation status.
/api/v1/gen_video/{id}Retrieves the status of a video generation request using the request ID.
| Parameter | Type | Description |
|---|---|---|
id | string | The requestId returned from the generate endpoint. |
The status field will indicate the current state of the generation process.
When processing:
The response will indicate the request is being processed.
When completed:
The response will include an outputUrl with a link to the generated video.
curl -X POST "https://api.popvid.ai/api/v1/gen_video" \
-H "X-API-Key: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"image\":\"https://picsum.photos/200/300\",\"prompt\":\"add a monkey in the picture, the monkey smile to you\"}"curl -X POST "https://api.popvid.ai/api/v1/gen_video" \
-H "X-API-Key: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"image\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==\",\"prompt\":\"add a monkey in the picture, the monkey smile to you\"}"{
"requestId":"2774489d-103a-4353-a0b2-8d7ba5ca8642"
}curl -X GET "https://api.popvid.ai/api/v1/gen_video/YOUR_REQUEST_ID" \
-H "Content-Type: application/json" \
-H "X-API-Key: Bearer YOUR_API_KEY"{
"requestId": "YOUR_REQUEST_ID",
"status": "processing"
}{
"requestId": "YOUR_REQUEST_ID",
"status": "completed",
"outputUrl": ""
}scheduledThe request has been received and is waiting to be processed.
processingThe video is currently being generated.
completedThe video has been successfully generated.
failedAn error occurred during generation.