Skip to main content
POST
/
v1
/
images
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "wan2.7-image-pro",
    "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
  }'
{
  "code": "success",
  "message": "",
  "data": [
    {
      "task_id": "task_01HX...",
      "status": "processing"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "wan2.7-image-pro",
    "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
  }'
{
  "code": "success",
  "message": "",
  "data": [
    {
      "task_id": "task_01HX...",
      "status": "processing"
    }
  ]
}

Authorizations

Authorization
string
required
All requests require Bearer Token authentication.Visit the API Key Management page to obtain your API Key, then add it to the request header:
Authorization: Bearer YOUR_API_KEY

Available Models

ModelDescriptionMax Resolution (Text-to-Image)Max Resolution (Edit / Sequential)Price
wan2.7-image-proProfessional edition, better details, supports 4K4K2K¥0.50 / image
wan2.7-imageStandard edition, faster generation2K2K¥0.20 / image
Billing is based on successfully generated images × unit price. Input is not billed. Resolution and aspect ratio do not affect pricing. Failed requests are not charged.

Body

model
string
required
Image generation model name.
  • wan2.7-image-pro — Professional edition, up to 4K for text-to-image
  • wan2.7-image — Standard edition, faster, up to 2K
prompt
string
Text description for image generation, up to 5000 characters.
  • Text-to-image (no image_urls): required
  • Image editing (with image_urls): optional but recommended
Example: "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
image_urls
array<string>
Input image URL array for editing and multi-image reference scenarios.Providing this field switches the request to image editing mode.Supported formats: HTTP/HTTPS URLs; data:image/...;base64,... Base64Constraints: Up to 9 images; JPEG / PNG / WEBP / BMP; 240–8000 px, aspect ratio 1:8 ~ 8:1; ≤ 20MB per image
Output aspect ratio automatically matches the last input image. Editing mode supports up to 2K only — 4K is not available.
n
integer
default:"1"
Number of images to generate.
  • Standard mode: 1–4 (default 1)
  • Sequential mode (enable_sequential: true): 1–12 (default 1)
Billed per successfully generated image. Pre-charged based on n.
size
string
Output resolution or aspect ratio. Supports three formats:① Resolution keyword (recommended): 1K / 2K (default) / 4K (wan2.7-image-pro text-to-image only)② Aspect ratio: 1:1 / 16:9 / 9:16 / 4:3 / 3:4 / 3:2 / 2:3 (defaults to 2K tier)③ Pixel dimensions: 1024x1024 or 1024*1024
resolution
string
Resolution tier keyword: 1K / 2K / 4K. Can be combined with size (aspect ratio).
ModelScenarioSupported TiersPixel Range
wan2.7-image-proText-to-image (non-sequential)1K / 2K / 4K768×768 ~ 4096×4096
wan2.7-image-proEditing / sequential1K / 2K768×768 ~ 2048×2048
wan2.7-imageAll scenarios1K / 2K768×768 ~ 2048×2048
negative_prompt
string
Negative prompt describing elements to avoid. Example: "blurry, distorted, low quality"
watermark
boolean
default:"false"
Whether to add an “AI Generated” watermark to the bottom-right corner.
seed
integer
Random seed, range 0–2147483647. Same seed with identical parameters produces visually consistent results.
thinking_mode
boolean
default:"true"
Enable enhanced reasoning mode to improve image quality at the cost of longer generation time.
Only effective when sequential mode is disabled and no image input is provided.
enable_sequential
boolean
default:"false"
Enable sequential image generation mode — generates multiple thematically coherent images in one request. Ideal for storyboards and series.
  • Maximum n is 12 when enabled
  • thinking_mode and color_palette are ignored in sequential mode
  • wan2.7-image-pro supports up to 2K in sequential mode (4K not supported)
bbox_list
array
Bounding boxes for interactive editing — specifies exact regions to edit or insert content.Structure: [[[x1, y1, x2, y2], ...], ...]
  • Outer array length must equal the length of image_urls
  • Pass [] for images with no bounding box
  • Max 2 boxes per image; coordinates are absolute pixel values, origin (0,0) at top-left
Example: [[], [[989, 515, 1138, 681]]]
color_palette
array<object>
Custom color theme. Standard mode only (not sequential mode).
  • 3–10 entries (8 recommended); each entry requires hex and ratio
  • All ratio values must sum to exactly 100.00%
[
  { "hex": "#C2D1E6", "ratio": "23.51%" },
  { "hex": "#636574", "ratio": "76.49%" }
]

Response

code
string
Response status. Returns "success" on success.
data
array

Examples

Text-to-Image (minimal)

{
  "model": "wan2.7-image-pro",
  "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
}

Text-to-Image (with resolution)

{
  "model": "wan2.7-image-pro",
  "prompt": "Summer beach, blue sky and white clouds, 4K ultra HD",
  "size": "4K",
  "thinking_mode": true
}

Text-to-Image (custom color palette)

{
  "model": "wan2.7-image-pro",
  "prompt": "Minimalist modern living room",
  "size": "2K",
  "color_palette": [
    { "hex": "#C2D1E6", "ratio": "23.51%" },
    { "hex": "#CDD8E9", "ratio": "20.13%" },
    { "hex": "#B5C8DB", "ratio": "15.88%" },
    { "hex": "#C0B5B4", "ratio": "13.27%" },
    { "hex": "#DAE0EC", "ratio": "10.11%" },
    { "hex": "#636574", "ratio": "8.93%" },
    { "hex": "#CACAD2", "ratio": "5.55%" },
    { "hex": "#CBD4E4", "ratio": "2.62%" }
  ]
}

Sequential Image Generation

{
  "model": "wan2.7-image-pro",
  "prompt": "Cinematic series: the same stray orange cat, consistent features. First: under cherry blossoms in spring. Second: old street shade in summer. Third: fallen leaves in autumn. Fourth: snow footprints in winter.",
  "enable_sequential": true,
  "n": 4,
  "size": "2K"
}

Single Image Editing

{
  "model": "wan2.7-image",
  "prompt": "Replace the background with a sunset scene, warm color tones",
  "image_urls": ["https://example.com/portrait.jpg"],
  "size": "2K"
}

Multi-Image Reference / Element Fusion

{
  "model": "wan2.7-image-pro",
  "prompt": "Apply the graffiti from image 2 onto the car in image 1",
  "image_urls": [
    "https://example.com/car.webp",
    "https://example.com/paint.webp"
  ],
  "size": "2K"
}

Interactive Editing (Bounding Box)

bbox_list corresponds 1-to-1 with image_urls. Pass [] for images with no selection.
{
  "model": "wan2.7-image-pro",
  "prompt": "Place the alarm clock from image 1 into the selected area of image 2, blending naturally",
  "image_urls": [
    "https://example.com/clock.webp",
    "https://example.com/desk.webp"
  ],
  "bbox_list": [
    [],
    [[989, 515, 1138, 681]]
  ],
  "size": "2K"
}
Querying ResultsImage generation is asynchronous. Poll the Task Status endpoint using the returned task_id until status == completed.