const API_KEY = process.env.SLIDEVID_API_KEY;const BASE_URL = 'https://api.slidevid.ai/v1';async function createClassVideo() { // 1. Get a professional-looking avatar const avatarsRes = await fetch(`${BASE_URL}/avatar/list?type=library`, { headers: { 'x-api-key': API_KEY } }); const avatars = await avatarsRes.json(); const professionalAvatar = avatars.data.avatars.find( a => a.situation.includes('Professional') && !a.isPro ); // 2. Get a clear, articulate voice const voicesRes = await fetch(`${BASE_URL}/voice/list?language=English`, { headers: { 'x-api-key': API_KEY } }); const voices = await voicesRes.json(); const clearVoice = voices.data.voices[0]; // 3. Create the project const project = await fetch(`${BASE_URL}/project/create`, { method: 'POST', headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ type: 'class', name: 'Product Tutorial - Getting Started', script: ` Hello and welcome to this tutorial! Today, I'm going to walk you through the key features of our product. First, let's talk about setup. The setup process is incredibly simple. Just follow these three steps, and you'll be up and running in minutes. Next, I'll show you the main dashboard. This is where you'll spend most of your time. Notice how everything is organized intuitively. Finally, let's look at some advanced features that will help you work more efficiently. Thanks for watching! If you have any questions, don't hesitate to reach out. `.trim(), avatarId: professionalAvatar.id, voiceId: clearVoice.voiceId, aspectRatio: 'ratio_16_9', // Horizontal for tutorials captions: true, webhook: 'https://yoursite.com/api/webhook' }) }); const result = await project.json(); console.log('Project created:', result.data.projectId); return result;}createClassVideo();