---
title: "Product Material Change"
method: POST
path: "/v2/tool/material-swap"
tags: ["edit-workflow"]
---

# Product Material Change

`POST /v2/tool/material-swap`

Re-renders the masked region of the product photo in the material shown
by the reference image — matching its color, texture, pattern scale,
and orientation — while preserving the product's silhouette,
construction, seams, and shading, and keeping every region outside the
mask unchanged.

The request is processed asynchronously. Poll
`GET /v1/generations/{generation_id}` with the returned `generation_id`
until the generation is completed or failed.

Supply the product photo, the mask marking the region to re-material,
and the material reference image as raw bytes (`image`, `mask`, and
`material`) via `multipart/form-data`. The mask must have the same
pixel dimensions as the product photo. White pixels mark the region to
change; black pixels are preserved. Alpha-only masks are also
supported: opaque pixels mark the region to change and transparent
pixels are preserved.

## Headers

- `Api-Key` string, required

## Response `200`

Material swap accepted for asynchronous processing.

- MaterialSwapResponse — Acknowledgement that the material swap was accepted. Poll `GET /v1/generations/{generation_id}` for status and results.
  - `generation_id` string, required — URL-safe base64 ID accepted by the generation polling endpoint.

## Other responses

- `400` — Invalid input provided.
- `401` — Unauthorized.
- `402` — Insufficient credits or quota.
- `403` — Not authorized to create a material swap.
- `429` — Too many requests.

---

[API](https://skmtc.dev/ideogram/apis/api-reference.md) · [All operations](https://skmtc.dev/ideogram/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ideogram/api-reference/revisions/d4cec35f719f/schema)
