Developers API

Welcome to the Mimi Panda API documentation. Our API allows you to programmatically access our AI-powered image transformation services including coloring page generation, paint-by-numbers creation, AI image generation, image upscaling, and AI filter application.

Base URL

https://mimi-panda.com/api

Authentication

All API requests require authentication using a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN

To obtain an API token, please login here https://mimi-panda.com/login to your personal account and go to the My profile page. Then click on the "Generate Token" button in the API Token section.

Response Format

Most endpoints return JSON. Successful requests return HTTP 200 with JSON bodies; errors use appropriate status codes with a JSON payload such as {"error": "..."}.

For paint-by-numbers file downloads (GET /service/item/{uuid}/pbn/download/{type} and GET /service/item/{uuid}/pbn/colors/{type}), the server returns a file attachment (SVG, PNG, PDF, JPEG, CSV, palette files, etc.) instead of JSON. Save the response body directly (for example use curl with -o).

Important for binary formats (PDF, PNG, JPEG, palette files): The response body is raw binary data. Do not attempt to decode it as UTF-8 or any other text encoding — doing so will corrupt the file. Read the response as bytes and write it to disk without any re-encoding. Text-based formats (csv, gpl, kpl, SVG) are safe to handle as UTF-8 text. For PBN color export type=swatches, the server may return either .swatches (30 colors or fewer) or .zip (more than 30 colors, containing multiple .swatches files).

Endpoints

Create Coloring Page from Image

POST /service/coloring

Convert an uploaded image into a coloring page using AI technology.

Request Parameters

Parameter Type Required Description
image file Yes Image file to convert. Accepted formats: jpg, png, webp, jpeg, heic, heif. Max size: 20MB
version string No API version to use. Options: v1, v2. Default: v2
type string No For v2: v2_general, v2_detailed, v2_anime, v2_simplified, v2_comic
For v1: image, photo
Default: v2_general (v2) or photo (v1)
smart_subject_focus boolean No When enabled, automatically detects and focuses on the main subject of the image for better coloring results. Default: false

Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "in_queue",
  "created": "2025-10-14 12:34:56"
}

Example Request

curl -X POST https://mimi-panda.com/api/coloring \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "image=@/path/to/image.jpg" \
  -F "version=v2" \
  -F "type=v2_detailed"

Create Paint-by-Numbers

POST /service/pbn

Create a paint-by-numbers template from an uploaded image or AI-generated image from a text prompt.

Request Parameters

Parameter Type Required Description
image file No* Image file to convert. Accepted formats: jpg, png, webp, jpeg, heic, heif. Max size: 20MB
prompt string No* Text description for AI image generation (3-600 characters). *Either image or prompt must be provided
numberOfColors integer No Number of colors to be used for generating your paint by numbers (7-100). Default: 30
segmentsComplexity string No Controls the size and detail level of paint segments. Options: none, level1, level2, level3, simplest. Default: none
canvasSize string No Canvas size in inches (e.g., "12x16"). Max dimensions: 45x45 inches. Min dimensions: 4x4 inches. Default: none
crop boolean No Whether to crop the image to fully cover chosen canvas size. Default: false
cropCoordinates string (JSON) No Crop region as a JSON string with keys x1, y1, x2, y2 — each a normalized float between 0 and 1 relative to the image dimensions (0,0 = top-left, 1,1 = bottom-right). x2 must be greater than x1 and y2 must be greater than y1. Only applied when crop is true. Example: {"x1":0.1,"y1":0.1,"x2":0.9,"y2":0.9}
palette integer No Palette ID that should be used for generating your paint by numbers. Must be from your saved palettes
paletteColors string No Comma-separated list of color codes from the chosenpalette (minimum 7 colors)
aiFilterType string No AI art style to apply. Options: none, painting-general, painting-oil-painting, painting-palette-knife, painting-acrylic, painting-watercolor, painting-gouache, painting-digital, painting-graffiti, painting-grimdark, painting-impasto, painting-impressionism-painting-style, painting-magic-realism, painting-pointillism, painting-renaissance, painting-retrofuturism. Default: none
minArea number|string No The minimum size (as a percentage of the shortest side of your image) that a color region must be to remain separate. Increasing this value will combine smaller color regions into larger ones. Accepts a number from 0 to 100 in 0.1 increments (e.g. 0, 1.5, 2.3) or the string "auto" to automatically detect the minimum size based on canvas dimensions. Default: "auto". Non-commercial accounts are clamped to a minimum of 1.5 server-side.
mode string No Options: polygon, pixel. Default: polygon. Selecting this option creates a PBN SVG file that precisely mirrors the pixel pattern of your processed image.
enhancement boolean No Enabling enhancement will clean up the processed image by removing small details and make zones easier to color, resulting in a smoother and simpler appearance but with reduced fine detail. Default: true
fixedNumbersSize boolean No When enabled, ensures that all number labels in the generated PBN have a consistent, uniform size. Default: false
thinLineWidth integer No Absorbs hairline ridges into surrounding zones. Increase when the source has many fine outlines or the canvas is large. Value in pixels (at 96 DPI). Range: 1–30. Default: 1
colorMergeThreshold integer No Merges adjacent zones with similar colors. Higher values reduce nearly-identical shades more aggressively and may lower the final color count. 0 disables merging. Range: 0–100. Default: 0
thinZoneMerge integer No Zones too narrow to hold a painted number are merged into their neighbor. Increase to eliminate slivers. Value in pixels (at 96 DPI). Range: 3–50. Default: 3

Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "in_queue",
  "created": "2025-10-14 12:34:56"
}

Example Request (with Image)

curl -X POST https://mimi-panda.com/api/pbn \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "image=@/path/to/image.jpg" \
  -F "numberOfColors=40" \
  -F "segmentsComplexity=level2"

Example Request (with Prompt)

curl -X POST https://mimi-panda.com/api/pbn \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "prompt=Beautiful sunset over mountains" \
  -F "numberOfColors=30" \

Generate AI Coloring Page from Prompt

POST /service/ai/coloring

Generate a coloring page using AI from a text prompt, optionally guided by a reference image. Without image, this is text-to-image. With image, the request is image-to-image: the model keeps the main subject recognizable and preserves framing, crop, pose, and placement unless the prompt asks otherwise, then applies the instruction as a black-and-white coloring page in the chosen style.

Request Parameters

Parameter Type Required Description
prompt string Yes Text description of the desired coloring page (3-600 characters). Always required, including when a reference image is provided.
style string Yes Art style preset for the coloring page. Available styles: kids_coloring_page (bold simple outlines), teenagers_coloring_page (moderate detail), adults_coloring_page (thin precise intricate outlines)
aspectRatio string No Image aspect ratio. Options: 1x1, 2x3, 3x2, 4x3, 3x4, 9x16, 16x9. Default: 1x1. Ignored when a reference image is provided (output size follows the reference).
image file / URL No Optional reference image (multipart file or publicly accessible URL). When provided, generation is image-to-image. Output dimensions follow the reference aspect ratio, scaled so the longest side fits within 2048px (sides multiple of 8, min 256). Accepted formats: jpg, png, webp, jpeg, heic, heif. Maximum size: 20MB. HEIC is converted to JPG server-side. Content moderation runs on both the prompt and the reference image. Send as multipart/form-data when uploading a file; a URL string may be sent as the image field.

Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "in_queue",
  "created": "2025-10-14 12:34:56"
}

Example Request

curl -X POST https://mimi-panda.com/api/service/ai/coloring \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A magical unicorn in an enchanted forest",
    "style": "kids_coloring_page",
    "aspectRatio": "3x4"
  }'

Example Request (with Reference Image)

curl -X POST https://mimi-panda.com/api/service/ai/coloring \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "prompt=Turn this into a coloring page of a cat sitting in a garden" \
  -F "style=kids_coloring_page" \
  -F "image=@/path/to/reference.jpg"

Generate AI Image from Prompt

POST /service/ai/image

Generate a high-quality AI image from a text prompt, optionally guided by a reference image. Without image, this is text-to-image. With image, the request is image-to-image: the model keeps the main subject recognizable and preserves framing, crop, pose, and placement unless the prompt asks otherwise, then produces a polished full-color image following the prompt.

Request Parameters

Parameter Type Required Description
prompt string Yes Text description of the desired image (3-600 characters). Always required, including when a reference image is provided.
aspectRatio string Yes Image aspect ratio. Options: 1x1, 2x3, 3x2, 4x5, 5x4, 4x3, 3x4, 9x16, 16x9. Still required when a reference image is provided, but output dimensions follow the reference rather than this value.
image file / URL No Optional reference image (multipart file or publicly accessible URL). When provided, generation is image-to-image. Output dimensions follow the reference aspect ratio, scaled so the longest side fits within 2048px (sides multiple of 8, min 256). Accepted formats: jpg, png, webp, jpeg, heic, heif. Maximum size: 20MB. HEIC is converted to JPG server-side. Content moderation runs on both the prompt and the reference image. Send as multipart/form-data when uploading a file; a URL string may be sent as the image field.

Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "in_queue",
  "created": "2025-10-14 12:34:56"
}

Example Request

curl -X POST https://mimi-panda.com/api/service/ai/image \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic cityscape at night with neon lights",
    "aspectRatio": "16x9"
  }'

Example Request (with Reference Image)

curl -X POST https://mimi-panda.com/api/service/ai/image \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "prompt=Paint this scene as a watercolor sunset" \
  -F "aspectRatio=1x1" \
  -F "image=@/path/to/reference.jpg"

Upscale and Enhance Image

POST /service/image/upscale

Enhance and upscale an image using AI technology to improve quality and resolution.

Request Parameters

Parameter Type Required Description
image file Yes Image file to upscale. Accepted formats: jpg, png, webp, jpeg, heic, heif. Max size: 20MB. Max dimensions: 4000x4000px
upscale integer Yes Upscale factor. Options: 2, 4. Note: Images larger than 1000px will be automatically limited to 2x upscale

Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "in_queue",
  "created": "2025-10-14 12:34:56"
}

Example Request

curl -X POST https://mimi-panda.com/api/image/upscale \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "image=@/path/to/image.jpg" \
  -F "upscale=4"

Apply AI Filter to Image

POST /service/image/filter

Transform an image by applying AI-powered artistic filters and effects.

Request Parameters

Parameter Type Required Description
image file Yes Image file to apply filter to. Accepted formats: jpg, png, webp, jpeg, heic, heif. Max size: 20MB
filterType string Yes Type of AI filter to apply. Contact support for available filter types
strength number Yes Filter strength. Options: 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "in_queue",
  "created": "2025-10-14 12:34:56"
}

Example Request

curl -X POST https://mimi-panda.com/api/image/filter \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "image=@/path/to/image.jpg" \
  -F "filterType=artistic" \
  -F "strength=0.7"

Generate Name Coloring Page

POST /service/ai/name-coloring

Generate a coloring page featuring a stylized name using AI, with optional decorative elements inside and around the text and background decorations.

Request Parameters

Parameter Type Required Description
name string Yes The name to render as a coloring page (max 70 characters). HTML tags are stripped automatically.
fontStyle string Yes Font style for the name. Options: angular, rounded, graffiti, bubble
aspectRatio string Yes Image aspect ratio. Options: 1x1, 2x3, 3x2
elementInText string No Decorative element to place inside the text letters (max 80 characters, e.g. "flowers", "stars"). HTML tags are stripped automatically.
elementAroundText string No Decorative element to place around the text (max 80 characters, e.g. "butterflies", "hearts"). HTML tags are stripped automatically.
backgroundDecoration string No Background decoration style (max 80 characters, e.g. "forest", "underwater scene"). HTML tags are stripped automatically.

Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "in_queue",
  "created": "2025-10-14 12:34:56"
}

Example Request

curl -X POST https://mimi-panda.com/api/ai/name-coloring \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Emma",
    "fontStyle": "bubble",
    "aspectRatio": "3x2",
    "elementInText": "flowers",
    "elementAroundText": "butterflies",
    "backgroundDecoration": "garden"
  }'

List Generated Items

GET /service/items

List the authenticated user's generated items from api_model_keys with optional filters and pagination. Returns a slim payload suitable for mobile galleries and dashboards — use Get Generated Item by UUID for full detail (colors, prompts, image URLs).

Query Parameters

Parameter Type Required Description
type string No Filter by item type. Options: coloring, pbn, ai_coloring, ai_image, name_coloring, upscale, ai_filter. The ai_coloring filter matches both legacy catalog coloring task variants.
status string No Filter by processing status. Options: in_queue, processing, ready, failed. When omitted, only those four statuses are returned. Banned items are excluded from the list and cannot be filtered via ?status=banned — use Get Generated Item by UUID to inspect a banned item by its key.
page integer No Page number for pagination (default 1)
per_page integer No Items per page (default 24, minimum 1, maximum 100)

Response

{
  "data": [
    {
      "key": "550e8400-e29b-41d4-a716-446655440000",
      "type": "pbn",
      "status": "ready",
      "created": "2026-08-28 10:00:00",
      "title": null,
      "thumbnail": "https://mimi-panda.com/storage/pbn/picture.jpg"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 5,
    "per_page": 24,
    "total": 112
  }
}

thumbnail is null until status is ready.

Example Request

curl -X GET "https://mimi-panda.com/api/service/items?type=pbn&status=ready&page=1&per_page=24" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Generated Item by UUID

GET /service/item/{uuid}

Retrieve the status and results of a previously created item using its unique identifier. Every response includes a top-level type field with a public API name: coloring, pbn, ai_coloring, ai_image, name_coloring, upscale, or ai_filter (internal DB types such as catalog_coloring are never exposed).

For PBN items that are ready, JSON includes three asset URLs (pbn, picture, source) plus structured color data. For the same downloads available in the web app (PNG/PDF outlines, grayscale, custom-colored SVGs, palette PDFs/CSV/software palettes, etc.), use the dedicated download PBN image and download PBN colors endpoints below.

URL Parameters

Parameter Type Required Description
uuid string Yes The unique identifier (key) returned when creating the item

Response

The response structure varies depending on the item type:

Coloring Page Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "type": "coloring",
  "status": "ready",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:35:23",
  "images": [
    "https://mimi-panda.com/storage/coloring/image.jpg"
  ]
}

Paint-by-Numbers Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "type": "pbn",
  "status": "ready",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:37:12",
  "images": {
    "pbn": "https://mimi-panda.com/storage/pbn/pbn-image.jpg",
    "picture": "https://mimi-panda.com/storage/pbn/picture.jpg",
    "source": "https://mimi-panda.com/storage/pbn/source.jpg"
  },
  "colors": [
    {
      "number": 1,
      "hex": "#FF5733",
      "name": "Red Orange"
    },
    {
      "number": 2,
      "hex": "#3498DB",
      "name": "Sky Blue"
    }
  ],
  "parameters": {
    "prompt": "Beautiful sunset",
    "numberOfColors": 30,
    "segmentsComplexity": "level2",
    "canvasSize": "16x16",
    "crop": false,
    "palette": null,
    "paletteColors": null,
    "aiFilterType": "none",
    "minArea": 0,
    "thinLineWidth": 1,
    "colorMergeThreshold": 0,
    "thinZoneMerge": 3
  }
}

AI Coloring/Image Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "type": "ai_coloring",
  "status": "ready",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:36:45",
  "images": [
    "https://mimi-panda.com/storage/catalog/image1.jpg",
    "https://mimi-panda.com/storage/catalog/image2.jpg"
  ],
  "parameters": {
    "prompt": "Magical unicorn in forest",
    "style": "fantasy",
    "aspectRatio": "3x4",
    "width": 1024,
    "height": 1365
  }
}

Image Upscale Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "type": "upscale",
  "status": "ready",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:36:12",
  "images": [
    "https://mimi-panda.com/storage/catalog/upscaled-image.jpg"
  ],
  "parameters": {
    "upscale": 4,
    "width": 4096,
    "height": 4096
  }
}

AI Filter Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "type": "ai_filter",
  "status": "ready",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:35:45",
  "images": [
    "https://mimi-panda.com/storage/catalog/filtered-image.jpg"
  ],
  "parameters": {
    "filterType": "artistic",
    "strength": 0.7
  }
}

Name Coloring Page Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "type": "name_coloring",
  "status": "ready",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:36:30",
  "images": "https://mimi-panda.com/storage/catalog/name-coloring.jpg",
  "parameters": {
    "name": "Emma",
    "fontStyle": "bubble",
    "aspectRatio": "3x2",
    "elementInText": "flowers",
    "elementAroundText": "butterflies",
    "backgroundDecoration": "garden",
    "width": 1536,
    "height": 1024
  }
}

Status Values

  • in_queue - Task is waiting to be processed
  • processing - Task is currently being processed
  • ready - Task completed successfully, results are available
  • failed - Task failed to complete
  • banned - Generated content was rejected by content moderation. This is a terminal status visible only via this endpoint (banned items are excluded from List Generated Items). The response includes a localized error message. Credits are not refunded.

Banned Item Response

{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "type": "ai_image",
  "status": "banned",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:35:10",
  "error": "The generated image was blocked by content moderation. Please try a different prompt or image."
}

Example Request

curl -X GET https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Download PBN Image File

GET /service/item/{uuid}/pbn/download/{type}

Download the paint-by-numbers or related rasterized assets in any format offered in the Profile app once the job status is ready. The UUID must belong to your account.

URL Parameters

Parameter Type Required Description
uuid string Yes The API key UUID returned when the PBN was created (same as used for GET /service/item/{uuid})
type string Yes SVG / raster source: origin (picture), pbn (numbered template), source (original upload), outlines, grayscale, originwithnumbers, custom
PNG (server uses Inkscape when exporting): outlinespng, grayscalepng, pbnpng, originpng
PDF (Inkscape): pbnpdf, outlinespdf, grayscalepdf, originpdf

Query Parameters (optional unless noted)

Parameter Type Required Description
width integer No Export width in pixels (1–15000). For PNG-export type values.
height integer No Export height in pixels (1–15000). For PNG-export type values.
download-type string Yes if type=custom pbn, outlines, or hybrid
download-strokes-color string Yes if type=custom Stroke color as a CSS color (e.g. #222222)
download-numbers-color string Yes if type=custom Number label color as a CSS color
download-hybrid-opacity decimal No When download-type=hybrid, opacity of filled regions (01). Default roughly 0.05.
download-frame string No yes or no — add a printable border frame (matches app behavior)

Responses

  • 200 — File body (Content-Disposition includes a filename)
  • 400 — Invalid type, missing parameters for custom, or invalid query validation
  • 401 — Missing or invalid token
  • 403 — UUID belongs to another user
  • 404 — UUID not found, missing files on storage, or not a PBN item
  • 409 — Item exists but status is not ready yet
  • 500 — Export failed (e.g. PDF generation)

Example: download outlines as SVG

curl -L -o pbn-outlines.svg \
  "https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000/pbn/download/outlines" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example: download full PBN as PNG with width

curl -L -o pbn.png \
  "https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000/pbn/download/pbnpng?width=3000" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example: download full PBN as PDF

curl -L -o pbn.pdf \
  "https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000/pbn/download/pbnpdf" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example: download grayscale as PDF

curl -L -o pbn-grayscale.pdf \
  "https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000/pbn/download/grayscalepdf" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example: custom SVG (numbered template, colored strokes)

curl -L -o pbn-custom.svg \
  "https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000/pbn/download/custom?download-type=pbn&download-strokes-color=%23000000&download-numbers-color=%23ffffff&download-frame=no" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Download PBN Colors File

GET /service/item/{uuid}/pbn/colors/{type}

Download the palette / color legend for a ready paint-by-numbers item in spreadsheet, PDF/image chart, or third-party palette formats (aligned with downloads in the Profile app).

URL Parameters

Parameter Type Required Description
uuid string Yes The API key UUID for the PBN item
type string Yes pdf — full color chart PDF
pdfshort — compact PDF chart
png — full chart as JPEG image
pngshort — compact chart as JPEG image
csv — CSV (codes, names, hex, RGB, HSL)
swatches — Procreate swatches export (.swatches if colors ≤ 30; .zip with multiple .swatches files if colors > 30)
gpl — GIMP palette
kpl — Krita palette

When using type=swatches, detect the exact returned format from the response metadata: check Content-Disposition for filename extension and X-Mimi-Colors-Format for swatches or zip.

Responses

  • 200 — File attachment (format depends on type)
  • 400 — Invalid color export type
  • 401, 403, 404, 409 — Same semantics as the PBN image download endpoint

Example Request

curl -L -o colors.csv \
  "https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000/pbn/colors/csv" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Color Tools

Unmix Color

POST /service/color/unmix

Decompose a color into the paint pigments that make it up. Returns two breakdowns: a secondary breakdown (primary + secondary pigments) and a primary breakdown (pure primary pigments only). Each breakdown is a map of pigment name → proportion (values sum to 1).

Request Parameters

Parameter Type Required Description
hex string Yes 6-digit hex color, with or without leading #. Example: a3c2f0

Response

{
  "hex": "a3c2f0",
  "rgb": [163, 194, 240],
  "hsl": [213.5, 0.71, 0.79],
  "unmix": {
    "blue": 0.42,
    "white": 0.38,
    "red": 0.12,
    "black": 0.08
  },
  "unmix_primary": {
    "blue": 0.38,
    "white": 0.45,
    "red": 0.1,
    "yellow": 0.04,
    "black": 0.03
  }
}

Example Request

curl -X POST https://mimi-panda.com/api/service/color/unmix \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hex": "a3c2f0"}'

Mix Colors

POST /service/color/mix

Blend 2–4 colors into a single resulting color using a physically-based paint-mixing model (Kubelka-Munk / Spectral). Unlike simple RGB averaging, this model simulates how real paints mix — for example, red + blue produces a realistic purple rather than a flat average.

Request Parameters

Parameter Type Required Description
colors array Yes Array of 2–4 color objects to blend (see fields below)
colors[].hex string Yes 6-digit hex of this color, with or without #
colors[].amount number No Relative weight of this color in the mix. Does not need to sum to 1 — weights are normalised automatically. Default: 1.0 (equal weight)
colors[].tintingStrength number No How strongly this pigment tints others (analogous to real paint opacity/dominance). Default: 1.0. Most callers can omit this.

Response

{
  "hex": "7d4a2e",
  "rgb": [125, 74, 46],
  "hsl": [22.5, 0.46, 0.34]
}

Example Request

curl -X POST https://mimi-panda.com/api/service/color/mix \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "colors": [
      { "hex": "FF0000", "amount": 2 },
      { "hex": "FFFF00", "amount": 1 },
      { "hex": "0000FF", "amount": 1 }
    ]
  }'

Virtual Artist Lab (VAL)

VAL Service API endpoints require a Commercial plan. Only the authenticated user's private palettes are accessible — brand and public palettes are never exposed. Private palette routes that take an {id} additionally require ownership of that palette.

List Private Palettes

GET /service/val/palettes

Return a summary list of the authenticated user's private Virtual Artist Lab palettes.

Request Parameters

None.

Response

{
  "palettes": [
    {
      "id": 42,
      "name": "my-palette",
      "title": "My Palette",
      "type": "private",
      "colors_number": 12
    }
  ]
}

Example Request

curl -X GET https://mimi-panda.com/api/service/val/palettes \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Create Private Palette

POST /service/val/palettes

Create a new private palette. Optionally seed it with up to 100 colors. Returns HTTP 201 on success. Returns 403 if the account has reached its palette limit, or 400 if a private palette with the same title already exists.

Request Parameters

Parameter Type Required Description
palette_name string Yes Title for the new palette (max 255 characters)
colors array No Optional initial colors (max 100). Each item requires hex; rgb, code, and name are optional
colors[].hex string Yes (with colors) 6-digit hex, with or without #

Response

{
  "message": "Palette created successfully",
  "palette": {
    "id": 42,
    "name": "my-palette",
    "title": "My Palette"
  }
}

Example Request

curl -X POST https://mimi-panda.com/api/service/val/palettes \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "palette_name": "My Palette",
    "colors": [
      { "hex": "ff0000", "name": "Red" },
      { "hex": "0000ff", "code": "B1" }
    ]
  }'

Get Private Palette

GET /service/val/palettes/{id}

Retrieve a private palette by ID, including colors, options, and timestamps. Returns 404 if the palette is not found or not owned by the caller.

Request Parameters

Parameter Type Required Description
id integer Yes Private palette ID (path parameter)

Response

{
  "palette": {
    "id": 42,
    "name": "my-palette",
    "title": "My Palette",
    "colors": {
      "ff0000": {
        "id": 1,
        "hex": "ff0000",
        "rgb": [255, 0, 0],
        "name": "Red",
        "code": "1"
      }
    },
    "type": "private",
    "options": { "printCodes": true },
    "mixedColors": true,
    "created_at": "2026-07-01T12:00:00.000000Z",
    "updated_at": "2026-07-01T12:00:00.000000Z"
  }
}

Example Request

curl -X GET https://mimi-panda.com/api/service/val/palettes/42 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Delete Private Palette

DELETE /service/val/palettes/{id}

Permanently delete a private palette owned by the authenticated user.

Request Parameters

Parameter Type Required Description
id integer Yes Private palette ID (path parameter)

Response

{
  "message": "Palette deleted successfully"
}

Example Request

curl -X DELETE https://mimi-panda.com/api/service/val/palettes/42 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Update Palette Options

PUT /service/val/palettes/{id}/options

Update options for a private palette. Currently supports the printCodes flag used when exporting palette charts.

Request Parameters

Parameter Type Required Description
id integer Yes Private palette ID (path parameter)
printCodes boolean Yes Whether to print color codes on palette exports

Response

{
  "message": "Palette options updated successfully",
  "options": { "printCodes": true }
}

Example Request

curl -X PUT https://mimi-panda.com/api/service/val/palettes/42/options \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"printCodes": true}'

Add Palette Color

POST /service/val/palettes/{id}/colors

Add a color to a private palette. Returns 400 for invalid hex, duplicate code, or when the palette has reached its maximum number of colors.

Request Parameters

Parameter Type Required Description
id integer Yes Private palette ID (path parameter)
hex string Yes 6-digit hex color, with or without #
rgb array|string No Optional RGB as [R,G,B] or rgb(r,g,b). Derived from hex when omitted
code string No Optional color code label (max 255). Must be unique within the palette
name string No Optional display name (max 255). Auto-generated when omitted

Response

{
  "message": "palette.color_added",
  "color": {
    "id": 2,
    "hex": "00ff00",
    "rgb": [0, 255, 0],
    "name": "Lime",
    "code": 2
  }
}

Example Request

curl -X POST https://mimi-panda.com/api/service/val/palettes/42/colors \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hex": "00ff00", "name": "Lime"}'

Edit Palette Color

PUT /service/val/palettes/{id}/colors/{colorId}

Update an existing color in a private palette. Returns 404 if colorId is not found, or 400 if the new code is already used by another color.

Request Parameters

Parameter Type Required Description
id integer Yes Private palette ID (path parameter)
colorId integer Yes Color ID within the palette (path parameter)
hex string Yes New 6-digit hex color, with or without #
rgb array|string No Optional RGB as [R,G,B] or rgb(r,g,b)
code string No Optional new color code label
name string No Optional new display name

Response

{
  "message": "palette.color_updated",
  "color": {
    "id": 2,
    "hex": "00aa00",
    "rgb": [0, 170, 0],
    "name": "Green",
    "code": "G2"
  }
}

Example Request

curl -X PUT https://mimi-panda.com/api/service/val/palettes/42/colors/2 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hex": "00aa00", "name": "Green", "code": "G2"}'

Delete Palette Color

DELETE /service/val/palettes/{id}/colors/{colorId}

Remove a color from a private palette. Remaining colors are re-indexed (IDs renumbered from 1). Returns 404 if the color is not found.

Request Parameters

Parameter Type Required Description
id integer Yes Private palette ID (path parameter)
colorId integer Yes Color ID within the palette (path parameter)

Response

{
  "message": "Color deleted successfully"
}

Example Request

curl -X DELETE https://mimi-panda.com/api/service/val/palettes/42/colors/2 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Download Private Palette

GET /service/val/palettes/{id}/download/{type}

Download a private palette as a file attachment. Without a Premium subscription, only css, tailwind, and json are allowed. Palettes with more than 200 colors cannot be exported as PDF, swatches, or image formats — use CSV (or gpl/kpl/css/tailwind/json) instead. Returns a file download rather than JSON.

Request Parameters

Parameter Type Required Description
id integer Yes Private palette ID (path parameter)
type string Yes Export format: swatches, gpl, kpl, pdf, pdf-short, image, image-short, csv, css, tailwind, json, svg

Response

File attachment. Save the response body directly (for example curl -o palette.json). Binary formats must be written as raw bytes.

Example Request

curl -X GET "https://mimi-panda.com/api/service/val/palettes/42/download/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -o my-palette.json

Color Details

POST /service/val/color/details

Return hex, RGB, HSL, a human-readable name, and primary/secondary unmix breakdowns for a color. Brand/vendor similar colors are intentionally omitted from the Service API.

Request Parameters

Parameter Type Required Description
hex string Yes 6-digit hex color, with or without leading #

Response

{
  "hex": "a3c2f0",
  "rgb": [163, 194, 240],
  "hsl": [213.5, 0.71, 0.79],
  "unmix": {
    "blue": 0.42,
    "white": 0.38,
    "red": 0.12,
    "black": 0.08
  },
  "unmix_primary": {
    "blue": 0.38,
    "white": 0.45,
    "red": 0.1,
    "yellow": 0.04,
    "black": 0.03
  },
  "name": "Light Cornflower Blue"
}

Example Request

curl -X POST https://mimi-panda.com/api/service/val/color/details \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hex": "a3c2f0"}'

Mix Chart

POST /service/val/mix/chart

Build a spectral paint-mixing chart matrix for 2–10 hex colors using the Kubelka-Munk / Spectral model. Each cell matrix[i][j] is the mix of colors[i] with colors[j].

Request Parameters

Parameter Type Required Description
colors array of strings Yes 2–10 hex colors (with or without #)
include_diagonal boolean No Include self-mix diagonal cells. Default: true

Response

{
  "size": 2,
  "hexes": ["ff0000", "ffff00"],
  "matrix": [
    [
      { "hex": "ff0000", "rgb": [255, 0, 0], "hsl": [0, 1, 0.5] },
      { "hex": "ff7f00", "rgb": [255, 127, 0], "hsl": [30, 1, 0.5] }
    ],
    [
      { "hex": "ff7f00", "rgb": [255, 127, 0], "hsl": [30, 1, 0.5] },
      { "hex": "ffff00", "rgb": [255, 255, 0], "hsl": [60, 1, 0.5] }
    ]
  ]
}

Example Request

curl -X POST https://mimi-panda.com/api/service/val/mix/chart \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "colors": ["ff0000", "ffff00"],
    "include_diagonal": true
  }'

Color Match

POST /service/val/color/match

Find paint recipes (single, double, or triple mixes) that best match a target hex against either an owned private palette or an inline list of colors. Provide exactly one of palette_id or colors.

Request Parameters

Parameter Type Required Description
hex string Yes Target 6-digit hex to match
palette_id integer Conditional Own private palette ID. Required if colors is omitted
colors array Conditional Inline palette colors (1–40). Required if palette_id is omitted. Each item needs hex; id, name, code optional
limit integer No Max matches to return (1–50). Default: 20
max_components integer No Max pigments per recipe (1–3). Default: 3

Response

{
  "matches": [
    {
      "type": "single",
      "distance": 0.02,
      "mixed": { "hex": "a3c2f0", "rgb": [163, 194, 240], "hsl": [213.5, 0.71, 0.79] },
      "components": [
        { "hex": "a3c2f0", "amount": 1, "id": 1, "name": "Sky", "code": "1" }
      ]
    }
  ],
  "count": 1
}

Example Request

curl -X POST https://mimi-panda.com/api/service/val/color/match \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "hex": "a3c2f0",
    "palette_id": 42,
    "limit": 10,
    "max_components": 2
  }'

Color Simplifier

POST /service/val/color-simplifier

Quantize an uploaded image to a limited set of colors. Send a multipart form upload (not JSON). On success the response body is a PNG image (Content-Type: image/png).

Request Parameters

Parameter Type Required Description
image file Yes Image upload. Accepted: jpg, jpeg, png, webp. Max 20MB
numberOfColors integer Yes Target palette size (2–100)
minArea number Yes Minimum region area as a percentage (0–50). Smaller regions are merged
segmentsComplexity integer Yes Meanshift preprocessing strength (0 disables; 1–100 increases complexity)

Response

PNG binary image. Save with curl -o result.png.

Example Request

curl -X POST https://mimi-panda.com/api/service/val/color-simplifier \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "[email protected]" \
  -F "numberOfColors=16" \
  -F "minArea=1.5" \
  -F "segmentsComplexity=40" \
  -o color-simplifier-result.png

Apply Grid Overlay

POST /service/val/grid

Overlay a drawing grid on an uploaded image. Send a multipart form upload. On success the response body is the gridded image (JPEG by default).

Request Parameters

Parameter Type Required Description
image file Yes Image upload. Accepted: jpg, jpeg, png, webp. Max 20MB
gridType string Yes Grid layout: 3x3, 4x4, or square
squareCells integer No Cells per side when gridType=square. Allowed: 4, 6, 8, 10, 12. Default: 4
showDiagonals boolean No Draw diagonal guide lines. Default: false
strokeColor string No Grid stroke hex color. Default: #007bff
strokeThickness number No Stroke thickness (1–10). Default: 2
format string No Output format: jpeg, jpg, or png. Default: jpeg
quality integer No JPEG quality (1–100). Default: 90

Response

Binary image. Save with curl -o grid-result.jpg.

Example Request

curl -X POST https://mimi-panda.com/api/service/val/grid \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "[email protected]" \
  -F "gridType=3x3" \
  -F "showDiagonals=true" \
  -F "strokeColor=#333333" \
  -o grid-result.jpg

Outlines

POST /service/val/outlines

Convert an uploaded photo into a black-and-white printable outline (same algorithm as the VAL Outlines UI). Fast is balanced, Detailed keeps more small edges, Clean suppresses more noise. Optional 3×3 or 4×4 red grid overlay. Send a multipart form upload (not JSON). On success the response body is a PNG image (Content-Type: image/png, filename outline.png). Longest side is capped at 1800 px.

Request Parameters

Parameter Type Required Description
image file Yes Image upload. Accepted: jpg, jpeg, png, webp. Max 20MB
mode string Yes Outline algorithm: fast (balanced), detailed (more small edges), or clean (suppresses more noise)
showGrid boolean No Overlay a red grid on the outline. Default: false
gridSize integer No Grid size when showGrid is true: 3 (3×3) or 4 (4×4). Default: 3

Response

PNG binary image. Save with curl -o outline.png.

Example Request

curl -X POST https://mimi-panda.com/api/service/val/outlines \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "[email protected]" \
  -F "mode=fast" \
  -F "showGrid=true" \
  -F "gridSize=3" \
  -o outline.png

Tonal Values

POST /service/val/tonal-values

Convert an uploaded photo into a tonal study: light / midtone / shadow value shapes, or a 17-stop color map. Shadow and light boundaries are fixed at 50% and 67% (same as the VAL Tonal Values UI). Send a multipart form upload (not JSON). On success the response body is a PNG image (Content-Type: image/png, filename tonal-values-{mode}.png). Longest side is capped at 2400 px.

Request Parameters

Parameter Type Required Description
image file Yes Image upload. Accepted: jpg, jpeg, png, webp. Max 20MB
mode string Yes Tonal study type: light, midtone, shadow, or colorMap (17-stop color map). colorMap is camelCase

Response

PNG binary image. Save with curl -o tonal-values-shadow.png.

Example Request

curl -X POST https://mimi-panda.com/api/service/val/tonal-values \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "[email protected]" \
  -F "mode=shadow" \
  -o tonal-values-shadow.png

Mimi Panda Palette — Similar Colors

GET /service/val/mimi-panda-palette/similar

Return the nearest colors from the Mimi Panda palette for a given hex. This endpoint returns at most 10 nearest colors only — the full Mimi Panda palette catalog is not exposed. If an exact match exists it is included with distance: 0.

Request Parameters

Parameter Type Required Description
hex string Yes Query parameter. 6-digit hex color, with or without leading #

Response

{
  "hex": "a3c2f0",
  "colors": [
    {
      "hex": "a4c3f0",
      "name": "Sky Mist",
      "code": "MP-142",
      "rgb": [164, 195, 240],
      "hsl": [212, 0.7, 0.79],
      "distance": 0.012
    }
  ]
}

Example Request

curl -X GET "https://mimi-panda.com/api/service/val/mimi-panda-palette/similar?hex=a3c2f0" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Error Handling

The API uses conventional HTTP response codes to indicate success or failure of requests.

HTTP Status Codes

Code Description
200 Success - Request completed successfully
400 Bad Request - Invalid parameters or validation error
401 Unauthorized - Invalid or missing API token
403 Forbidden - Insufficient permissions or quota exceeded
404 Not Found - Requested resource does not exist
409 Conflict - Resource exists but is not in a usable state yet (for example PBN downloads when status is not ready)
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Something went wrong on our end

Error Response Format

{
  "error": "Detailed error message describing what went wrong"
}

Common Error Messages

  • Validation Errors: Specific field validation failures (e.g., "The image field is required")
  • File Errors: Issues with uploaded files (e.g., "Failed to process HEIC image")
  • Content Policy: "The prompt contains trademarks or other protected content"
  • Not Ready: Download endpoints return HTTP 409 when the underlying item exists but processing is not finished ("Item is not ready yet.")

Workflow Example

Here's a typical workflow for creating and retrieving a paint-by-numbers image:

Step 1: Create a Paint-by-Numbers

curl -X POST https://mimi-panda.com/api/pbn \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "image=@/path/to/photo.jpg" \
  -F "numberOfColors=40" \
  -F "colorPrecision=high"

# Response:
{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "in_queue",
  "created": "2025-10-14 12:34:56"
}

Step 2: Check Status (Poll Periodically)

curl -X GET https://mimi-panda.com/api/item/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Response (while processing):
{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:35:12"
}

Step 3: Retrieve Completed Result

curl -X GET https://mimi-panda.com/api/item/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Response (when ready):
{
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "status": "ready",
  "created": "2025-10-14 12:34:56",
  "updated": "2025-10-14 12:37:12",
  "images": {
    "pbn": "https://mimi-panda.com/storage/pbn/pbn-image.jpg",
    "picture": "https://mimi-panda.com/storage/pbn/picture.jpg",
    "source": "https://mimi-panda.com/storage/pbn/source.jpg"
  },
  "colors": [...],
  "parameters": {...}
}

Step 4 (optional): Download PBN files directly

When status is ready, you can fetch the same exports as in the Profile UI without parsing stored URLs manually:

# Numbered outlines only (SVG)
curl -L -o outlines.svg \
  "https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000/pbn/download/outlines" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Color palette as CSV
curl -L -o colors.csv \
  "https://mimi-panda.com/api/service/item/550e8400-e29b-41d4-a716-446655440000/pbn/colors/csv" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Best Practices

  • Polling: When checking item status, poll every 3-5 seconds. Stop when status is ready, failed, or banned. Most operations complete within 30-60 seconds.
  • Image Optimization: Compress images before uploading to reduce processing time and bandwidth usage.
  • Error Handling: Implement proper error handling and retry logic for failed requests.
  • Rate Limiting: Respect rate limits and implement exponential backoff for retries.
  • Security: Never expose your API token in client-side code. Always make API calls from your backend.
  • Content Policy: Ensure prompts and images comply with our content policy to avoid rejected requests.
  • PBN file downloads: Use GET /service/item/{uuid}/pbn/download/{type} and GET /service/item/{uuid}/pbn/colors/{type} only after GET /service/item/{uuid} reports status: ready. Save the raw response body; treat 409 as "still processing."
  • Binary response handling: PDF, PNG, and JPEG downloads return raw binary data. If you are consuming the API in code (not curl), read the response as bytes — never pass it through a text decoder (e.g. UTF-8) before writing to disk, as this will corrupt the file by replacing invalid byte sequences with replacement characters.

Support

If you have questions or need assistance with the API:

  • Email: [email protected]
  • Documentation Updates: Check this page regularly for updates and new features
  • Status Page: Monitor our service status and planned maintenance
Back to Top
We use cookies
We use essential cookies to make our site work. Analytics cookies help us improve your experience. You can find more information in our cookie policy. Cookie policy
Accept only essential Accept all