# MockAnything AI API

## Create MockAnything AI Mockup

> Create a new MockAnything AI mockup. Exactly one of \`prompt\`, \`image\_url\`, or \`image\_file\` is required.\
> \
> \- \`prompt\`: text prompt used to AI-generate an image. Returns a \`task\_id\` that must be polled via \`/mock-anything/status/{taskId}\`.\
> \- \`image\_url\`: URL of an existing image to use as the mockup image. Completes synchronously.\
> \- \`image\_file\`: uploaded image file (use \`multipart/form-data\`). Completes synchronously.<br>

```json
{"openapi":"3.1.0","info":{"title":"Dynamic Mockups MockAnything AI API","version":"1.0"},"servers":[{"url":"https://app.dynamicmockups.com/api/v1"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key required for authentication."}}},"paths":{"/mock-anything/create":{"post":{"summary":"Create MockAnything AI Mockup","description":"Create a new MockAnything AI mockup. Exactly one of `prompt`, `image_url`, or `image_file` is required.\n\n- `prompt`: text prompt used to AI-generate an image. Returns a `task_id` that must be polled via `/mock-anything/status/{taskId}`.\n- `image_url`: URL of an existing image to use as the mockup image. Completes synchronously.\n- `image_file`: uploaded image file (use `multipart/form-data`). Completes synchronously.\n","operationId":"createMockAnythingMockup","parameters":[{"in":"header","name":"Accept","required":true,"schema":{"type":"string","enum":["application/json"]},"description":"The request must accept JSON responses."},{"in":"header","name":"x-api-key","required":true,"schema":{"type":"string"},"description":"API key required for authentication."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","description":"Text prompt used to AI-generate the mockup image. Required unless `image_url` or `image_file` is provided."},"image_url":{"type":"string","format":"uri","description":"URL of an existing image to use as the mockup image. Required unless `prompt` or `image_file` is provided."},"enhance_prompt":{"type":"boolean","description":"Whether to run prompt enhancement before generation. Only applies to the `prompt` flow."},"product":{"type":"object","description":"Optional product context used to ground the AI generation.","properties":{"uuid":{"type":"string","format":"uuid","description":"UUID of a POD product (obtained via `GET /mock-anything/products`) to anchor the AI generation around a specific product type."}}},"model":{"type":"string","description":"AI model used for generation. Defaults to the standard model when omitted. Only applies to the `prompt` flow. Required when `style` is provided.","enum":["seedream_4_0","seedream_4_5","nano_banana_2"]},"style":{"type":"string","description":"Visual style applied to the AI generation (e.g. `polaroid-etsy`, `ugc`, `fashion`). Use `GET /mock-anything/styles?model={model}` to list the styles available for a given model — not every model supports every style. When `style` is provided, `model` is required."},"name":{"type":"string","maxLength":255,"description":"Optional mockup name shown in the dashboard and returned in the `mockup.name` field."},"collections":{"type":"array","description":"Optional collections to attach the mockup to. Each item is either an existing collection (by `uuid`) or a new collection to create (by `name`). Exactly one of `uuid` or `name` must be provided per item.","items":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"UUID of an existing collection."},"name":{"type":"string","maxLength":255,"description":"Name of a new collection to create and attach."}}}},"catalog_uuid":{"type":"string","format":"uuid","description":"Optional UUID of the catalog the mockup belongs to. Defaults to the workspace's default catalog."}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"image_file":{"type":"string","format":"binary","description":"Image file upload (JPG, JPEG, PNG, GIF, or WebP; max 10 MB). Required unless `prompt` or `image_url` is provided."},"name":{"type":"string","maxLength":255,"description":"Optional mockup name."},"collections":{"type":"array","description":"Collections to attach the mockup to. Send as `collections[0][uuid]` or `collections[0][name]` form fields.","items":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid"},"name":{"type":"string"}}}},"catalog_uuid":{"type":"string","format":"uuid"}},"required":["image_file"]}}}},"responses":{"200":{"description":"Template creation started.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"task_id":{"type":"string","format":"uuid","description":"The task identifier. Poll `GET /mock-anything/status/{taskId}` with this value to track progress. The same value will be used as the `mockup.uuid` once the mockup is created."},"status":{"type":"string","description":"Initial task status."}}},"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request due to invalid input parameters (e.g. missing prompt/image_url/image_file, invalid model, unsupported image type)."},"401":{"description":"Unauthorized request, invalid or missing API key."},"403":{"description":"No credits available, or the authenticated user does not have access to the provided catalog or collection."},"404":{"description":"The provided `catalog_uuid` or a `collections[].uuid` could not be found."},"500":{"description":"Failed to start AI generation or upload the provided image."}}}}}}
```

## Get MockAnything AI Mockup Status

> Poll the status of a MockAnything AI mockup creation task. The response contains a \`state\` field:\
> \
> \- \`PROGRESS\`: the task is still running. \`image\_url\` and \`mockup\` are \`null\`.\
> \- \`SUCCESS\`: the task finished and the mockup has been created. \`image\_url\` is populated and \`mockup\` contains a payload that can be used immediately as \`mockup\_uuid\` in the Render API.\
> \
> Other states (e.g. \`FAILURE\`) indicate the task terminated without producing a mockup.<br>

```json
{"openapi":"3.1.0","info":{"title":"Dynamic Mockups MockAnything AI API","version":"1.0"},"servers":[{"url":"https://app.dynamicmockups.com/api/v1"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key required for authentication."}},"schemas":{"StatusProgressResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"task_id":{"type":"string","format":"uuid"},"state":{"type":"string","description":"Current task state.","enum":["PROGRESS","PENDING","FAILURE"]},"image_url":{"type":["string","null"],"description":"Always `null` while the task is in progress."},"status":{"type":"string","description":"Human-readable status."},"mockup":{"type":["object","null"],"description":"Always `null` while the task is in progress."}}},"success":{"type":"boolean"},"message":{"type":"string"}}},"StatusSuccessResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"task_id":{"type":"string","format":"uuid"},"state":{"type":"string","enum":["SUCCESS"]},"image_url":{"type":"string","format":"uri","description":"URL of the generated or uploaded mockup image."},"status":{"type":"string"},"mockup":{"$ref":"#/components/schemas/Mockup"}}},"success":{"type":"boolean"},"message":{"type":"string"}}},"Mockup":{"type":"object","description":"Mockup payload matching the MockAnything entry of the Get Mockups API. Use `uuid` as `mockup_uuid` in the Render API.","properties":{"type":{"type":"string","description":"Always `mockanything` for mockups created via this API."},"uuid":{"type":"string","format":"uuid","description":"Mockup UUID. Matches the `task_id`."},"name":{"type":"string","description":"Mockup name. Falls back to the prompt or a default if no `name` was provided on creation."},"thumbnail":{"type":"string","format":"uri","description":"URL of the mockup thumbnail."},"smart_objects":{"type":"array","description":"Print areas detected on the mockup. Each item corresponds to a renderable artwork slot and can be referenced by `uuid` in the Render API's `smart_objects` payload.","items":{"$ref":"#/components/schemas/SmartObject"}},"collections":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"thumbnails":{"type":"array","description":"Additional thumbnail sizes. Always empty for MockAnything mockups.","items":{}},"products":{"type":"array","description":"Product context (when a POD product was associated with the mockup). Each item describes the grounding product.","items":{"$ref":"#/components/schemas/Product"}}}},"SmartObject":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"The UUID of the smart object / print area. Use this as `smart_objects[].uuid` in the Render API."},"name":{"type":"string","description":"Name of the print area (e.g. \"Front\", \"All-over\")."},"size":{"type":"object","properties":{"width":{"type":"integer"},"height":{"type":"integer"}}},"position":{"type":"object","properties":{"top":{"type":"integer"},"left":{"type":"integer"}}},"print_area_presets":{"type":"array","description":"Always empty for MockAnything mockups.","items":{}}}},"Collection":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"Product":{"type":"object","properties":{"name":{"type":"string"},"brand":{"type":["string","null"]},"category":{"type":["string","null"]},"subcategory":{"type":["string","null"]},"colors":{"type":"array","items":{"type":"object"}}}}}},"paths":{"/mock-anything/status/{taskId}":{"get":{"summary":"Get MockAnything AI Mockup Status","description":"Poll the status of a MockAnything AI mockup creation task. The response contains a `state` field:\n\n- `PROGRESS`: the task is still running. `image_url` and `mockup` are `null`.\n- `SUCCESS`: the task finished and the mockup has been created. `image_url` is populated and `mockup` contains a payload that can be used immediately as `mockup_uuid` in the Render API.\n\nOther states (e.g. `FAILURE`) indicate the task terminated without producing a mockup.\n","operationId":"getMockAnythingMockupStatus","parameters":[{"in":"header","name":"Accept","required":true,"schema":{"type":"string","enum":["application/json"]},"description":"The request must accept JSON responses."},{"in":"header","name":"x-api-key","required":true,"schema":{"type":"string"},"description":"API key required for authentication."},{"in":"path","name":"taskId","required":true,"schema":{"type":"string","format":"uuid"},"description":"The `task_id` returned from `POST /mock-anything/create`."}],"responses":{"200":{"description":"Task status retrieved successfully. Response shape depends on task `state`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/StatusProgressResponse"},{"$ref":"#/components/schemas/StatusSuccessResponse"}]}}}},"401":{"description":"Unauthorized request, invalid or missing API key."},"500":{"description":"Failed to retrieve task status from the rendering service."}}}}}}
```

## Search POD Products

> Search the Print-on-Demand (POD) product catalog used to ground AI generations. The returned \`uuid\` can be passed as \`product.uuid\` when creating a mockup so the generated image is anchored to that specific product (e.g. a Gildan 5000 t-shirt).<br>

```json
{"openapi":"3.1.0","info":{"title":"Dynamic Mockups MockAnything AI API","version":"1.0"},"servers":[{"url":"https://app.dynamicmockups.com/api/v1"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key required for authentication."}},"schemas":{"PodProduct":{"type":"object","properties":{"name":{"type":"string","description":"Product name."},"uuid":{"type":"string","format":"uuid","description":"Product UUID. Pass as `product.uuid` when creating a mockup."}}}}},"paths":{"/mock-anything/products":{"get":{"summary":"Search POD Products","description":"Search the Print-on-Demand (POD) product catalog used to ground AI generations. The returned `uuid` can be passed as `product.uuid` when creating a mockup so the generated image is anchored to that specific product (e.g. a Gildan 5000 t-shirt).\n","operationId":"searchMockAnythingProducts","parameters":[{"in":"header","name":"Accept","required":true,"schema":{"type":"string","enum":["application/json"]},"description":"The request must accept JSON responses."},{"in":"header","name":"x-api-key","required":true,"schema":{"type":"string"},"description":"API key required for authentication."},{"in":"query","name":"query","required":true,"schema":{"type":"string","minLength":1},"description":"Search term matched against POD product names."}],"responses":{"200":{"description":"POD products matching the query.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PodProduct"}},"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request. `query` is missing or empty."},"401":{"description":"Unauthorized request, invalid or missing API key."},"500":{"description":"Failed to fetch POD products."}}}}}}
```

## List Available Styles

> List the visual styles that can be applied to an AI-generated mockup. The returned \`id\` can be passed as \`style\` when creating a mockup to apply that aesthetic to the generation. Pass a \`model\` query parameter to scope the result to styles supported by that model — not every model supports every style. When \`model\` is omitted the response includes every known style across all models.<br>

```json
{"openapi":"3.1.0","info":{"title":"Dynamic Mockups MockAnything AI API","version":"1.0"},"servers":[{"url":"https://app.dynamicmockups.com/api/v1"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key required for authentication."}},"schemas":{"Style":{"type":"object","properties":{"id":{"type":"string","description":"Style identifier. Pass as `style` when creating a mockup."},"description":{"type":"string","description":"Short description of the aesthetic this style produces."},"available_with":{"type":"array","description":"Models that support this style.","items":{"type":"string"}}}}}},"paths":{"/mock-anything/styles":{"get":{"summary":"List Available Styles","description":"List the visual styles that can be applied to an AI-generated mockup. The returned `id` can be passed as `style` when creating a mockup to apply that aesthetic to the generation. Pass a `model` query parameter to scope the result to styles supported by that model — not every model supports every style. When `model` is omitted the response includes every known style across all models.\n","operationId":"listMockAnythingStyles","parameters":[{"in":"header","name":"Accept","required":true,"schema":{"type":"string","enum":["application/json"]},"description":"The request must accept JSON responses."},{"in":"header","name":"x-api-key","required":true,"schema":{"type":"string"},"description":"API key required for authentication."},{"in":"query","name":"model","required":false,"schema":{"type":"string","enum":["seedream_4_0","seedream_4_5","nano_banana_2"]},"description":"Optional model filter. When provided, only styles available for that model are returned."}],"responses":{"200":{"description":"Available styles.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Style"}},"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Bad request. Invalid `model` value."},"401":{"description":"Unauthorized request, invalid or missing API key."},"500":{"description":"Failed to fetch styles."}}}}}}
```

### Overview

MockAnything AI lets you create a new mockup on the fly, either by generating an image from a text prompt or by bringing an image you already have. Once created, each mockup behaves exactly like one from the [Get Mockups API](/api-reference/get-mockups-api.md) - you pass its `uuid` to the [Render Mockup API](/api-reference/render-api.md) to print artwork on it.

Creation is asynchronous: you submit a task, then poll until the mockup is ready.

### Workflow

1. *(Optional)* Search POD products to find a `product.uuid` for grounding the generation around a specific product.
2. (*Optional*) List available styles to set the visual direction of a mockup using a `style` parameter.
3. Call **Create MockAnything AI Mockup**. You get back a `task_id`.
4. Poll **Get MockAnything AI Mockup Status** until `state` is `SUCCESS`. The response includes a `mockup` object. Use `mockup.uuid` as the `mockup_uuid` in the [Render Mockup API](/api-reference/render-api.md).

### Three ways to create a mockup

`prompt` - Generate a brand-new image with AI. Best when you don't already have reference imagery, or when you want to quickly produce variations of a scene. Runs\
asynchronously.

`image_url` - Turn a publicly-accessible image into a MockAnything mockup. Use this when you already host product photos somewhere. Completes on the first status call.

`image_file` - Upload an image file directly (`multipart/form-data`). Best for private images you don't want to host publicly. Completes on the first status call.

Exactly one of these three must be provided per request. The remaining fields (`name`, `collections`, `catalog_uuid`) work the same for all three modes.

{% hint style="info" %}
`product.uuid`, `model`, and `enhance_prompt` only apply to the `prompt` flow. They're ignored when you send `image_url` or `image_file`.
{% endhint %}

### Polling for completion

After `POST /mock-anything/create`, poll `GET /mock-anything/status/{taskId}` with the returned `task_id`. The response contains a `state` field:

* `PROGRESS` - still running. `image_url` and `mockup` are `null`. Poll again in a moment.
* `SUCCESS` - ready. `image_url` is populated and `mockup` contains everything you need for the [Render Mockup API](/api-reference/render-api.md).
* `FAILURE` - the task terminated without producing a mockup.

{% hint style="info" %}
We recommend polling every 2 seconds. AI generations typically finish in 10–30 seconds; `image_url` and `image_file` flows are usually ready on the very first status call.
{% endhint %}

### Using your new mockup

Once `state` is `SUCCESS`, the `mockup` field looks identical to an entry from the [Get Mockups API](/api-reference/get-mockups-api.md), with `type: "mockanything"`. Two fields matter for rendering:

* `mockup.uuid` - pass as `mockup_uuid` in the [Render Mockup API](/api-reference/render-api.md).
* `mockup.smart_objects[].uuid` - each print area detected on the image. Reference these as `smart_objects[].uuid` in the [Render Mockup API](/api-reference/render-api.md) payload to place your artwork on each area.

From here everything works exactly like rendering a classic mockup. The [Render Mockup API](/api-reference/render-api.md) handles both types through the same endpoint, so you don't need a separate\
integration.

### Grounding the AI with a product

If you want the AI to anchor the generated image around a specific product (say a Gildan 5000 t-shirt rather than a generic tee), first look up a product with **Search POD Products**, then pass the returned `uuid` as `product.uuid` on the create request.

`GET /mock-anything/products?query=gildan`

The response is a simple list of `{ name, uuid }` entries. Pick the one that matches the product you're mocking up.

{% hint style="info" %}
Grounding is optional. Skip it if you just want the model to pick a natural composition based on the prompt alone.
{% endhint %}

### Set visual direction with a style

If you want the AI mockup to land in a specific look (warm Polaroid, editorial flash, casual UGC, etc.) instead of the default photographic style, list the styles available for your chosen model with **List Available Styles**, then pass the returned `id` as `style` on the **create** request.

`GET /mock-anything/styles?model=nano_banana_2`&#x20;

The response is a list of `{ id, description, available_with }` entries. Read the description to pick the look you want, then send its `id` as `style`.

{% hint style="info" %}
Style is optional. Skip it for the default look. When you do pass `style`, `model` is also required - not every model supports every style.

The `style` will be applied only if you create a mockup using a `prompt`
{% endhint %}

### Catalogs and collections

MockAnything mockups live inside your catalogs and collections, the same as any other mockup:

* `catalog_uuid` - places the mockup in a specific catalog. Defaults to your workspace's default catalog. See the [Catalogs API](/api-reference/catalogs-api.md) to list available catalogs.
* `collections` - attaches the mockup to one or more collections. Each entry is either an existing collection referenced by `uuid`, or a new one referenced by `name` (which will find-or-create for you). See the [Collections API](/api-reference/get-collections-api.md) to manage collections.

{% hint style="info" %}
Passing `collections[].name` will create a collection if one with that name doesn't exist in the target catalog - a handy way to organize on the fly. Use `collections[].uuid` when you already know which collection to attach to.
{% endhint %}

### Choosing a model

The `model` parameter controls which AI model generates your image. Different models trade off speed, quality, and credit cost. If you don't set `model`, generation will use `seedream_4_0` as default.

<table><thead><tr><th>Model</th><th data-type="number">Credits</th><th>Speed</th><th>Quality</th><th>Best for</th></tr></thead><tbody><tr><td>seedream_4_0</td><td>5</td><td>~20s</td><td>Medium</td><td>Quick iterations and early exploration</td></tr><tr><td>seedream_4_5</td><td>6</td><td>~40s</td><td>Good</td><td>Higher fidelity without the pro price</td></tr><tr><td>nano_banana_2</td><td>14</td><td>~30s</td><td>High</td><td>Production-quality, final mockups</td></tr></tbody></table>

{% hint style="info" %}
Credits are charged when the task reaches `SUCCESS`. Failed generations (`FAILURE` state) don't cost anything.
{% endhint %}

{% hint style="info" %}
The credits pricing per `model` applies only if you use the `prompt` for mockup generation. If you generate a mockup from `image_url` or `image_file`, 4 credits cost is applied per generation.
{% endhint %}

### Rate Limit

**Create MockAnything AI Mockup** endpoint is limited to 50 requests per minute.

Requests exceeding this limit will receive a `429 Too Many Requests` response. If you expect\
higher throughput, contact support to discuss your use case.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dynamicmockups.com/api-reference/mockanything-ai-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
