API Reference
POST /generate
Generate an AI photo from an input image — MakePhotos API reference.
POST /api/v1/generate
Generate a studio-quality photo from an input image.
Request
curl -X POST "https://makephotos.ai/api/v1/generate?key=mk_live_..." \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/product.jpg",
"type": "product",
"style": "studio"
}'Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image_url | string | Yes | Public URL of the input image |
type | string | Yes | Generation type (product) |
style | string | Yes | Style preset (studio, amazon, luxury, lifestyle) |
prompt | string | No | Custom prompt (overrides the style's default prompt) |
aspect_ratio | string | No | Output ratio: 1:1, 4:3, 3:4, 16:9, 9:16 (default: 1:1) |
resolution | string | No | Output resolution: 1K, 2K, 4K (default: 1K) |
Response
{
"result_url": "https://res.cloudinary.com/.../makephotos/outputs/.../abc123.jpg",
"credits_used": 1,
"credits_remaining": {
"monthly": 49,
"topup": 10,
"total": 59
}
}| Field | Type | Description |
|---|---|---|
result_url | string | Permanent Cloudinary URL of the generated image |
credits_used | number | Credits consumed (base cost × resolution multiplier) |
credits_remaining | object | Updated credit balances |
Errors
| Code | HTTP Status | Description |
|---|---|---|
missing_api_key | 401 | No API key provided |
invalid_api_key | 401 | API key is invalid or revoked |
no_active_subscription | 403 | No active subscription |
insufficient_credits | 402 | Not enough credits |
invalid_params | 400 | Missing or invalid parameters |
generation_failed | 502 | AI generation failed (credits refunded) |
internal_error | 500 | Unexpected server error |
Example: 4K lifestyle shot
curl -X POST "https://makephotos.ai/api/v1/generate?key=mk_live_..." \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://res.cloudinary.com/.../sneaker.jpg",
"type": "product",
"style": "lifestyle",
"aspect_ratio": "16:9",
"resolution": "4K",
"prompt": "Outdoor patio with warm afternoon light"
}'This costs 4 credits (1 base × 4K multiplier). The generation takes 10–20 seconds. The endpoint has a 60-second timeout.