This endpoint generates high-quality AI images using various models with different capabilities and price points. It supports multiple models with customizable parameters for each.
{ "model": "FLUX.1-kontext-pro", "input": { "prompt": "string", // Required. Text description of what you want to generate, or instruction on how to edit the given image "input_image": "string", // Optional. Image URL to use as reference. Must be jpeg, png, gif, or webp "aspect_ratio": "string", // Optional. One of: "match_input_image", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "4:5", "5:4", "21:9", "9:21", "2:1", "1:2". Default: "match_input_image" "seed": "number" // Optional. Random seed for reproducible generation }}
{ "model": "recraft-v3", "input": { "prompt": "string", // Required. Text prompt for image generation "size": "string", // Optional. One of the size options below. Default: "1024x1024" "style": "string" // Optional. One of the style options below. Default: "any" }}
Returns the generated image URLs and usage information.
Copy
{ "images": [ { "url": "string" // URL to the generated image } ], "prompt": "string", // The prompt used for generation "creditUsage": "number" // Total credits used for this request}
Content-Type: application/json
X-RateLimit-Limit: The rate limit for the user.
X-RateLimit-Remaining: The remaining number of requests for the user.
curl -X POST https://app.dumplingai.com/api/v1/generate-ai-image \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_KEY" \-d '{ "model": "FLUX.1-kontext-pro", "input": { "prompt": "Change the background to a tropical beach while keeping the person in the exact same position", "input_image": "https://example.com/portrait.jpg", "aspect_ratio": "match_input_image" }}'