### Video Generation API Workflow Source: https://docs.pollo.ai/quick-start This section outlines the steps to generate video using the Pollo AI API, including initiating the generation, checking status, and downloading the final video. Videos are stored for two weeks. ```APIDOC API Workflow: 1. Generate Video: - Endpoint: (Not specified in text, assumed to be a POST request) - Action: Initiate video generation. - Success Response: Returns a status and a task_id. 2. Get Video Generation Status: - Endpoint: (Not specified in text, assumed to be a GET request) - Parameter: task_id - Possible Statuses: - processing: The video is still being generated. - succeed: The video generation is complete. 3. Poll Video Generation Status: - Action: Continuously poll the status endpoint until the status changes to 'succeed'. - Download: Once 'succeed' is returned, download the video using the provided URL. Limitations: - Videos are stored for two weeks. Download promptly. ``` -------------------------------- ### Configure HTTP Request Header Source: https://docs.pollo.ai/quick-start To authenticate your requests, you need to include your API key in the HTTP request header. This is done using the X-API-KEY parameter. ```APIDOC HTTP Request Header: X-API-KEY: Description: The X-API-KEY parameter is used to pass your unique API key generated from the Pollo AI platform. This key authenticates your requests to the API. ``` -------------------------------- ### Kling 2.0 Video Generation Response Example Source: https://docs.pollo.ai/m/kling-ai/kling-v2-0 Example of a successful response from the Kling 2.0 video generation API. It includes a unique task ID and the initial status of the generation process. ```json { "taskId": "", "status": "waiting" } ``` -------------------------------- ### Pollo 1.6 Video Generation cURL Example Source: https://docs.pollo.ai/m/pollo/pollo-v1-6 Example of how to call the Pollo 1.6 API using cURL to generate a video from an image and prompt. ```curl curl --request POST \ --url https://pollo.ai/api/platform/generation/pollo/pollo-v1-6 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "imageTail": "", \ "prompt": "", \ "resolution": "480p", \ "length": 5, \ "seed": 123 \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### Install Pollo MCP CLI Source: https://docs.pollo.ai/mcp Installs the Pollo MCP command-line interface globally using npm. This tool is required to run the Pollo MCP server. ```bash npm install -g pollo-mcp ``` -------------------------------- ### Pixverse 3.5 API Response Example Source: https://docs.pollo.ai/m/pixverse/pixverse-v3-5 Example of a successful response from the Pixverse 3.5 API after submitting a video creation request. It contains a task ID and its initial status. ```json { "taskId": "", "status": "waiting" } ``` -------------------------------- ### Kling 2.0 Video Generation cURL Example Source: https://docs.pollo.ai/m/kling-ai/kling-v2-0 Example of how to call the Kling 2.0 video generation API using cURL. This snippet demonstrates the POST request structure, headers, and JSON payload required to initiate video creation. ```curl curl --request POST \ --url https://pollo.ai/api/platform/generation/kling-ai/kling-v2 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "prompt": "", \ "negativePrompt": "", \ "strength": 50, \ "length": 5 \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### Full Webhook Integration Example (JavaScript) Source: https://docs.pollo.ai/webhooks A complete Node.js HTTP server example that listens for webhook events, extracts headers, verifies signatures, and processes task status updates. ```javascript const http = require('http'); const crypto = require('crypto'); http.createServer((req, res) => { const webhookId = req.headers['x-webhook-id']; const webhookTimestamp = req.headers['x-webhook-timestamp']; const signature = req.headers['x-webhook-signature']; let body = ''; req.on('data', chunk => { body += chunk; }); req.on('end', () => { // Obtain Secret const secret = "xxx"; // Obtain from https://pollo.ai/api-platform const signedContent = `${webhookId}.${webhookTimestamp}.${body}`; // Calculate the signature const secretBytes = Buffer.from(secret, 'base64'); const computedSigBase64 = crypto .createHmac('sha256', secretBytes) .update(signedContent) .digest('base64'); // Verify the signature if (crypto.timingSafeEqual(Buffer.from(signature, 'base64'), Buffer.from(computedSigBase64, 'base64'))) { // Signature is valid, process the message const event = JSON.parse(body); if (event.status === 'succeed') { // Handle success event console.log('Task succeeded:', event.taskId); } else { // Handle success event console.log('Task failed:', event.taskId); } } else { // Signature verification failed, reject processing console.log('Invalid signature'); } res.end('OK'); }); }).listen(8080); ``` -------------------------------- ### Veo 3 Fast Video Generation (cURL Example) Source: https://docs.pollo.ai/m/google/veo3 Example cURL command to interact with the Veo 3 Fast API endpoint for video generation. It demonstrates how to set headers, specify the request body with input parameters, and send the request. ```curl curl --request POST \ --url https://pollo.ai/api/platform/generation/google/veo3 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "prompt": "", \ "negativePrompt": "", \ "length": 8, \ "aspectRatio": "16:9", \ "resolution": "720p", \ "seed": 123, \ "generateAudio": true \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### JavaScript Webhook Integration Example Source: https://docs.pollo.ai/webhooks Example code demonstrating how to integrate Pollo AI's Webhook service using JavaScript. This snippet shows how to set up a listener for task completion notifications and verify the signature. ```javascript const express = require('express'); const crypto = require('crypto'); const app = express(); const PORT = process.env.PORT || 3000; const WEBHOOK_SECRET = 'YOUR_SECRET_KEY'; // Replace with your actual secret key // Middleware to parse JSON bodies and verify signature app.use(express.json({ verify: (req, res, buf) => { req.rawBody = buf.toString(); } })); app.post('/webhook', (req, res) => { const signature = req.headers['x-pollo-signature']; const payload = req.rawBody; if (!signature) { return res.status(400).send('Missing signature header'); } // Verify the signature const hmac = crypto.createHmac('sha256', WEBHOOK_SECRET); hmac.update(payload); const calculatedSignature = hmac.digest('hex'); if (!crypto.timingSafeEqual(Buffer.from(signature, 'hex'), Buffer.from(calculatedSignature, 'hex'))) { return res.status(401).send('Invalid signature'); } // Process the webhook payload const event = JSON.parse(payload); console.log('Received webhook event:', event); // Handle different event types, e.g., video generation completion if (event.type === 'video_generation.completed') { console.log('Video generation completed for task:', event.data.taskId); // Your logic here to process the completed video task } res.status(200).send('Webhook received successfully'); }); app.listen(PORT, () => { console.log(`Server listening on port ${PORT}`); }); ``` -------------------------------- ### Kling 2.1 Video Generation Response Example Source: https://docs.pollo.ai/m/kling-ai/kling-v2-1 Example JSON response received after successfully submitting a video generation request to the Kling 2.1 API. It contains a task ID and the initial status of the operation. ```json { "taskId": "", "status": "waiting" } ``` -------------------------------- ### Kling 2.1 Video Generation Request Example Source: https://docs.pollo.ai/m/kling-ai/kling-v2-1 Example cURL command to send a POST request to the Kling 2.1 API for video generation. It includes the endpoint URL, content type, API key, and a sample JSON payload. ```curl curl --request POST \ --url https://pollo.ai/api/platform/generation/kling-ai/kling-v2-1 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "prompt": "", \ "negativePrompt": "", \ "strength": 50, \ "length": 5, \ "mode": "std" \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### API Response Example (Success) Source: https://docs.pollo.ai/m/kling-ai/kling-v1-6 An example of a successful response from the Kling 1.6 API after submitting a video generation request. It contains a unique task ID and the initial status of the task. ```json { "taskId": "", "status": "waiting" } ``` -------------------------------- ### Veo 2 API Response Example (200 OK) Source: https://docs.pollo.ai/m/google/veo2 Shows a typical successful response from the Veo 2 API after initiating a video generation task. The response includes a task ID and its initial status. ```json { "taskId": "", "status": "waiting" } ``` -------------------------------- ### cURL Example for Kling 1.5 Video Generation Source: https://docs.pollo.ai/m/kling-ai/kling-v1-5 This snippet demonstrates how to make a POST request to the Kling 1.5 API using cURL to generate a video. It includes setting the API key, content type, and the JSON payload for video creation. ```cURL curl --request POST \ --url https://pollo.ai/api/platform/generation/kling-ai/kling-v1-5 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "imageTail": "", \ "prompt": "", \ "negativePrompt": "", \ "length": 5, \ "strength": 50, \ "mode": "std" \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### cURL Example for Kling 1.6 API Source: https://docs.pollo.ai/m/kling-ai/kling-v1-6 A cURL command demonstrating how to make a POST request to the Kling 1.6 API for video generation. It includes setting the content type, API key, and the JSON payload. ```curl curl --request POST \ --url https://pollo.ai/api/platform/generation/kling-ai/kling-v1-6 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "imageTail": "", \ "prompt": "", \ "negativePrompt": "", \ "length": 5, \ "strength": 50, \ "mode": "std" \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### Python Webhook Integration Example Source: https://docs.pollo.ai/webhooks Example code demonstrating how to integrate Pollo AI's Webhook service using Python with Flask. This snippet shows how to set up an endpoint to receive notifications and verify the signature. ```python from flask import Flask, request, abort import hmac import hashlib app = Flask(__name__) WEBHOOK_SECRET = 'YOUR_SECRET_KEY' # Replace with your actual secret key @app.route('/webhook', methods=['POST']) def webhook(): signature = request.headers.get('X-Pollo-Signature') payload = request.data if not signature: abort(400, 'Missing X-Pollo-Signature header') # Verify the signature calculated_signature = hmac.new(WEBHOOK_SECRET.encode('utf-8'), payload, hashlib.sha256).hexdigest() if not hmac.compare_digest(signature, calculated_signature): abort(401, 'Invalid signature') # Process the webhook payload event = request.get_json() print(f'Received webhook event: {event}') # Handle different event types, e.g., video generation completion if event.get('type') == 'video_generation.completed': task_id = event.get('data', {}).get('taskId') print(f'Video generation completed for task: {task_id}') # Your logic here to process the completed video task return 'Webhook received successfully', 200 if __name__ == '__main__': app.run(port=5000, debug=True) ``` -------------------------------- ### Veo 2 API POST Request Example (cURL) Source: https://docs.pollo.ai/m/google/veo2 Demonstrates how to make a POST request to the Veo 2 API for video generation using cURL. Includes sample input data, headers, and the API endpoint. ```curl curl --request POST \ --url https://pollo.ai/api/platform/generation/google/veo2 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "prompt": "", \ "length": 5, \ "aspectRatio": "9:16", \ "resolution": "720p", \ "seed": 123 \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### Create Video with Pixverse 3.5 API (cURL) Source: https://docs.pollo.ai/m/pixverse/pixverse-v3-5 Example demonstrating how to call the Pixverse 3.5 API using cURL to create a video from an image and prompt. It includes setting the API key and request payload. ```curl curl --request POST \ --url https://pollo.ai/api/platform/generation/pixverse/pixverse-v3-5 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "imageTail": "", \ "prompt": "", \ "length": 5, \ "negativePrompt": "", \ "seed": 123, \ "resolution": "360p", \ "style": "auto", \ "mode": "normal" \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### Example cURL Request for Luma Ray 2.0 Source: https://docs.pollo.ai/m/luma/luma-ray-2-0 Demonstrates how to make a POST request to the Luma Ray 2.0 API endpoint using cURL to generate a video from a text prompt. ```curl curl --request POST \ --url https://pollo.ai/api/platform/generation/luma/luma-ray-2-0 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "prompt": "A futuristic city skyline at sunset", \ "resolution": "1080p", \ "length": 10, \ "aspectRatio": "16:9" \ }, \ "webhookUrl": "https://example.com/webhook" \ }' ``` -------------------------------- ### Create Video Response Source: https://docs.pollo.ai/m/runway/runway-gen-4 Example of a successful response from the Runway Gen 4 API after submitting a video generation request. ```JSON { "taskId": "", "status": "waiting" } ``` -------------------------------- ### Example Success Response for Luma Ray 2.0 Source: https://docs.pollo.ai/m/luma/luma-ray-2-0 Illustrates a typical successful response from the Luma Ray 2.0 API after submitting a video generation request. ```json { "taskId": "task_abc123xyz789", "status": "waiting" } ``` -------------------------------- ### Hailuo 02 API Response Example (JSON) Source: https://docs.pollo.ai/m/hailuo/hailuo-02 This JSON object represents a successful response from the Hailuo 02 API when initiating a video generation task. It includes a unique `taskId` to track the progress of the video creation and the initial `status` of the task, which is typically 'waiting' upon submission. ```json { "taskId": "", "status": "waiting" } ``` -------------------------------- ### Example cURL Request for Task Status Source: https://docs.pollo.ai/task/get-task-status A practical example demonstrating how to call the Pollo AI API to get the status of a specific generation task using cURL. ```cURL curl --request GET \ --url https://pollo.ai/api/platform/generation/{taskId}/status \ --header 'x-api-key: ' ``` -------------------------------- ### Get Task Status API Endpoint Source: https://docs.pollo.ai/task/get-task-status Retrieve the current status of a generation task submitted to the Pollo AI API. This endpoint requires an API key for authorization and the task ID as a path parameter. ```APIDOC GET /api/platform/generation/{taskId}/status Description: Query task generation status. Authorizations: x-api-key: string (header, required) - API key to authorize requests Path Parameters: taskId: string (required) - The ID of the task to query. Responses: 200 OK: description: Successful response content: application/json: schema: type: object properties: taskId: { type: string, description: "The ID of the task." } generations: type: array items: type: object properties: id: { type: string, description: "Unique identifier for the generation." } createdDate: { type: string, format: "date-time", description: "Timestamp when the generation was created." } updatedDate: { type: string, format: "date-time", description: "Timestamp when the generation was last updated." } status: { type: string, description: "Current status of the generation (e.g., 'waiting', 'processing', 'completed', 'failed')." } failMsg: { type: string, description: "Error message if the generation failed." } url: { type: string, description: "URL to the generated media if available." } mediaType: { type: string, description: "Type of media generated (e.g., 'image', 'video')." } default: description: Unexpected error Example Request: curl --request GET \ --url https://pollo.ai/api/platform/generation/{taskId}/status \ --header 'x-api-key: ' ``` -------------------------------- ### Vidu Q1 Video Generation API Source: https://docs.pollo.ai/m/vidu/vidu-q1 This API endpoint allows users to create videos using text prompts or images with the Vidu Q1 model. It supports various parameters for customization, including prompt, image input, movement amplitude, length, resolution, and seed. Authorization is handled via an 'x-api-key' header. The response includes a taskId and status. ```APIDOC POST /generation/vidu/vidu-q1 Description: Creates video by text or image using Vidu Q1. Request: Method: POST URL: https://pollo.ai/api/platform/generation/vidu/vidu-q1 Headers: Content-Type: application/json x-api-key: (required, string) - API key to authorize requests Body (application/json): { "input": { "prompt": "", "image": "", "imageTail": "", "movementAmplitude": "auto" | "", "length": , "resolution": "1080p" | "", "seed": }, "webhookUrl": "" } Response (200 OK): Content-Type: application/json Body: { "taskId": "", "status": "waiting" | "" } Example Request (cURL): curl --request POST \ --url https://pollo.ai/api/platform/generation/vidu/vidu-q1 \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "prompt": "", \ "image": "", \ "imageTail": "", \ "movementAmplitude": "auto", \ "length": 5, \ "resolution": "1080p", \ "seed": 123 \ }, \ "webhookUrl": "" \ }' Related Endpoints: - Vidu 2.0 API: /generation/vidu/vidu-v2-0 - Vidu 1.5 API: /generation/vidu/vidu-v1-5 ``` -------------------------------- ### Create Video Request (cURL) Source: https://docs.pollo.ai/m/runway/runway-gen-4 Example of how to make a POST request to the Runway Gen 4 API using cURL to generate a video from an image and prompt. ```cURL curl --request POST \ --url https://pollo.ai/api/platform/generation/runway/runway-gen-4-turbo \ --header 'Content-Type: application/json' \ --header 'x-api-key: ' \ --data '{ \ "input": { \ "image": "", \ "prompt": "", \ "length": 5, \ "aspectRatio": "16:9", \ "seed": 123 \ }, \ "webhookUrl": "" \ }' ``` -------------------------------- ### Configure Webhook URL in API Request Source: https://docs.pollo.ai/webhooks Example JSON payload demonstrating how to include the `webhookUrl` in your video generation API request. This URL will receive asynchronous notifications about task status. ```json { "input": {}, "webhookUrl": "https://url.to.your.app/api/pollo/webhook" } ``` -------------------------------- ### Veo 3 Fast API Endpoint Documentation Source: https://docs.pollo.ai/m/google/veo3-fast This section details the POST endpoint for generating videos with Google's Veo 3 Fast model on the Pollo AI platform. It outlines the request structure, including authorization via an x-api-key header, the JSON request body with input parameters for video creation, and the successful 200 OK response format containing a taskId and status. ```APIDOC POST /generation/google/veo3-fast Description: Create video by text or image using Google Veo 3 Fast model. Authorization: x-api-key: string (header, required) - API key to authorize requests. Request Body: Content-Type: application/json Body Schema: { "input": { "image": "string", "prompt": "string", "negativePrompt": "string", "length": "integer", "aspectRatio": "string", "resolution": "string", "seed": "integer", "generateAudio": "boolean" }, "webhookUrl": "string" } Response (200 OK): Content-Type: application/json Response Schema: { "taskId": "string", "status": "string" } Notes: Veo 3 Fast is an accelerated mode of Google Veo 3, producing high-quality videos with synchronized audio faster than the standard model. ```