File tree Expand file tree Collapse file tree
shared/snippets/video/lip-sync-video Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "title" : " Generate a video" ,
3+ "docs" : " https://docs.aimlapi.com/api-references/video-models" ,
4+ "payload" : {
5+ "baseUrl" : " https://api.aimlapi.com/v2" ,
6+ "apiKey" : " <YOUR_API_KEY>"
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ const main = async () => {
2+ const response = await fetch('{{ baseUrl }} /video/generations', {
3+ method: 'POST',
4+ headers: {
5+ Authorization: 'Bearer {{ apiKey }} ',
6+ 'Content-Type': 'application/json',
7+ },
8+ body: JSON.stringify({
9+ model: '{{ model }} ',
10+ video_url: 'https://storage.googleapis.com/falserverless/model_tests/kling/kling-v2.5-turbo-pro-text-to-video-output.mp4',
11+ lip_sync_tts_content: 'Hello World!',
12+ lip_sync_tts_speaker: 'Harper',
13+ }),
14+ }).then((res) => res.json());
15+
16+ console.log('Generation:', response);
17+ };
18+
19+ main()
Original file line number Diff line number Diff line change 1+ import requests
2+
3+
4+ def main():
5+ url = "{{ baseUrl }} /video/generations"
6+ payload = {
7+ "model": "{{ model }} ",
8+ "video_url": "https://storage.googleapis.com/falserverless/model_tests/kling/kling-v2.5-turbo-pro-text-to-video-output.mp4",
9+ "lip_sync_tts_content": "Hello World",
10+ "lip_sync_tts_speaker": "Harper",
11+ }
12+ headers = {"Authorization": "Bearer {{ apiKey }} ", "Content-Type": "application/json"}
13+
14+ response = requests.post(url, json=payload, headers=headers)
15+ print("Generation:", response.json())
16+
17+
18+ if __name__ == "__main__":
19+ main()
You can’t perform that action at this time.
0 commit comments