The 4o Image API, powered by the advanced GPT-4o model, provides high-quality AI image generation services. Whether you need text-to-image generation, image editing, or image variants, our API meets all your creative needs.
{ "filesUrl": ["https://example.com/original-image.jpg"], "maskUrl": "https://example.com/mask-image.png", "prompt": "Replace the sky with a starry night sky", "size": "3:2"}
const editTaskId = await api.generateImage({ filesUrl: ['https://example.com/original.jpg'], maskUrl: 'https://example.com/mask.png', prompt: 'Replace the masked area with a beautiful garden', size: '3:2'});
Black areas in the mask image will be edited, white areas remain unchanged. The mask must match the original image dimensions.