CodingMantra LogoCodingMantra
GalleryProductsPortfolioServicesGamesPricingContact
CodingMantra LogoCodingMantra

Providing business solutions for small and medium-sized businesses and helping them to grow.

WhatsApp ChannelX / TwitterLinkedInInstagramFacebookGitHubYouTube

Company

  • About Us
  • Services
  • Products
  • Portfolio
  • Pricing
  • Blog
  • API Docs
  • Contact Us

Top Tools

  • All Tools
  • Image Gallery
  • Image Tools
  • Digital Marketing
  • Financial Tools
  • Games
  • SEO Tools

Legal

  • Privacy Policy
  • Terms & Conditions
  • Return Policy
  • Deals
  • Sitemap

© 2026 CodingMantra. All Rights Reserved.

    1. Home
    2. API Documentation
    3. Image Tools
    4. Product Photography

    Product Photography API

    Generate studio-quality product photos by placing your product in custom scenes. Perfect for ecommerce, Amazon listings, Shopify stores, and brand marketing. Remove backgrounds, add professional backgrounds, and create consistent product imagery at scale via REST API.

    Background RemovalCustom ScenesBatch GenerationLogo OverlayMulti-ProductResolution up to 4K

    GET
    /api/image/product-photography-prompts

    Get list of pre-defined professional scene templates for product photography. Includes studio setups, lifestyle scenes, holiday themes, and ecommerce-ready backgrounds.

    Example Request

    curl -X GET 'https://codingmantra.com/api/image/product-photography-prompts'

    Example Response

    {
      "data": [
        {
          "id": "minimalist-white",
          "title": "E-commerce White Background",
          "categoryId": "studio-minimalist",
          "categoryTitle": "Studio & Minimalist",
          "demoImageUrl": "https://..."
        },
        // ... more prompts
      ]
    }

    GET
    /api/image/image-model-options

    Get all available AI image generation models with capabilities, supported resolutions, pricing per resolution, and estimated credit costs. Use this to dynamically check model availability and costs before generating images.

    Example Request

    curl -X GET 'https://codingmantra.com/api/image/image-model-options'

    Example Response

    {
      "data": [
        {
          "model": "standard",
          "modelId": "googleai/gemini-2.5-flash-image",
          "name": "Gemini 2.5 Flash",
          "provider": "Google AI",
          "description": "Fast and affordable...",
          "badge": "Cost-Effective",
          "supportedResolutions": ["1K"],
          "supportsVariableResolution": false,
          "supportsBatchGeneration": true,
          "maxBatchSize": 10,
          "defaultResolution": "1K",
          "estimatedCost": { "credits": 10, "usd": 0.09, "inr": 5 },
          "pricingPerResolution": {
            "1K": { "credits": 10, "usd": 0.09, "inr": 5 }
          }
        },
        // ... more models
      ]
    }

    POST
    /api/image/product-photography

    Generate a professional product photograph with AI. Send product images and scene descriptions to create studio-quality ecommerce-ready product photos with automatic background removal, custom backgrounds, logo overlay, and text marketing. Supports batch generation for multiple products at once.

    Request Body

    Note: Either `promptId` or `scenePrompt` is required.

    ParameterTypeDescription
    productImagesArray of ObjectsRequired. Array of product images to place in the scene. Each object must contain either a dataUrl (Base64 data URI) or a url (public HTTPS URL). Supports JPEG, PNG, WebP. Optional label for product identification and prompt for individual product instructions. Maximum batch size varies by model (up to 10 images with standard model).
    promptIdstringOptional. Pre-defined scene template ID for professional product photography. Use /api/image/product-photography-prompts to get available scene IDs. Examples: minimalist-white, rustic-wood-table, luxury-box.
    scenePromptstringOptional. Custom scene description for the product background. Can describe lighting, setting, props, colors, or mood. Examples: in a cozy coffee shop with warm lighting, on marble countertop with fresh flowers. Use alone or with promptId to customize.
    logoImagestringOptional. Brand logo to overlay on the product image. Provide as data URI (Base64) or public HTTPS URL. Supports PNG with transparency. Use with logoPlacement and logoSize for positioning.
    logoPlacementstringOptional. Logo position on the image. Options: top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right. Default: bottom-right.
    logoSizenumberOptional. Logo size as percentage of image (0.1 to 0.8). Default: 0.15 (15% of image width).
    referenceImagestringOptional. Reference image URL or data URI to guide the style, lighting, color palette, and composition of the generated product photo.
    overlayTextstringOptional. Short text overlay on the product image. Great for promotional banners, sale badges, or brand taglines. Positioned prominently on the generated image.
    marketingTextstringOptional. Longer marketing text or slogan to integrate into the product scene. More detailed than overlayText for storytelling.
    modelstringOptional. AI model slug for image generation. Use pro for highest quality (Gemini 3 Pro), standard for fast bulk generation (Gemini 2.5 Flash), or flash for balanced speed/quality (Gemini 3.1 Flash). Default: pro. Call /api/image/image-model-options for latest models.
    resolutionstringOptional. Output image resolution. Options: 1K (1024px), 2K (1536px), 4K (2048px). Not all models support all resolutions. Default: Maximum supported resolution for selected model (e.g., 4K for pro, 1K for standard).
    aspectRatiostringOptional. Desired output aspect ratio. Options: 1:1 (Square - Instagram posts), 4:3, 3:4, 16:9 (Landscape - YouTube thumbnails), 9:16 (Story/Reel), 4:5 (Portrait), 3:2, 2:3, 21:9 (Ultrawide). Default: 1:1.
    outputResultstringOptional. Output format. base64 returns Base64 data URI (default for quick integration). url returns hosted image URLs from Google Cloud Storage (better for production use and CDN delivery).

    Example Request (with promptId)

    curl -X POST 'https://codingmantra.com/api/image/product-photography' \
         -H 'Content-Type: application/json' \
         -H 'Authorization: Bearer YOUR_API_KEY' \
         -d '{
              "productImages": [
                { "url": "https://example.com/my-product.png", "label": "bottle" }
              ],
              "promptId": "rustic-wood-table",
              "scenePrompt": "with grapes and cheese",
              "logoImage": "https://example.com/my-logo.png",
              "logoPlacement": "bottom-right",
              "logoSize": 0.15,
              "aspectRatio": "16:9",
              "outputResult": "url"
            }'

    Example Response (outputResult: 'url')

    {
      "data": {
        "imageUrl": "https://storage.googleapis.com/...",
        "thumbnailUrl": "https://storage.googleapis.com/..."
      }
    }

    Example Response (outputResult: 'base64')

    {
      "data": {
        "photoDataUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
      }
    }

    On This Page

    GET PromptsGET Model OptionsPOST Generate ImageFAQ

    Frequently Asked Questions