Sample Projects
Sample Project 1
Generate AI images programmatically using the AI Media Maker API.
Sample Project 1
Generate AI images programmatically using the AI Media Maker Cloud API.
Overview
This sample demonstrates how to use the AI Media Maker API to generate images from text prompts in a Node.js application.
Demo
See the live demo at maker.cappuai.com/playground.
How It Works
- Authenticate - Use your API key to authenticate requests
- Submit Prompts - Send an array of text prompts to the API
- Poll for Results - Check the job status until images are ready
Code Example
const API_KEY = process.env.AI_MEDIA_MAKER_API_KEY;
// Submit prompts for image generation
const response = await fetch('https://maker.cappuai.com/api/playground/images', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompts: ['A sunset over the ocean', 'A futuristic cityscape']
}),
});
const { jobId } = await response.json();
console.log('Job started:', jobId);