newbeta

MockAnything AI API

Create MockAnything AI Mockup

post

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.

Authorizations
x-api-keystringRequired

API key required for authentication.

Header parameters
Acceptstring · enumRequired

The request must accept JSON responses.

Possible values:
x-api-keystringRequired

API key required for authentication.

Example: YOUR_API_KEY_HERE
Body
promptstringOptional

Text prompt used to AI-generate the mockup image. Required unless image_url or image_file is provided.

image_urlstring · uriOptional

URL of an existing image to use as the mockup image. Required unless prompt or image_file is provided.

enhance_promptbooleanOptional

Whether to run prompt enhancement before generation. Only applies to the prompt flow.

modelstring · enumOptional

AI model used for generation. Defaults to the standard model when omitted. Only applies to the prompt flow.

Possible values:
namestring · max: 255Optional

Optional mockup name shown in the dashboard and returned in the mockup.name field.

catalog_uuidstring · uuidOptional

Optional UUID of the catalog the mockup belongs to. Defaults to the workspace's default catalog.

Responses
chevron-right
200

Template creation started.

application/json
successbooleanOptionalExample: true
messagestringOptionalExample: Template creation started
post
/mock-anything/create

Get MockAnything AI Mockup Status

get

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.

Authorizations
x-api-keystringRequired

API key required for authentication.

Path parameters
taskIdstring · uuidRequired

The task_id returned from POST /mock-anything/create.

Example: f6d7fb41-d32c-4fc3-8db9-37843d3476cf
Header parameters
Acceptstring · enumRequired

The request must accept JSON responses.

Possible values:
x-api-keystringRequired

API key required for authentication.

Example: YOUR_API_KEY_HERE
Responses
chevron-right
200

Task status retrieved successfully. Response shape depends on task state.

application/json
or
get
/mock-anything/status/{taskId}

Search POD Products

get

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).

Authorizations
x-api-keystringRequired

API key required for authentication.

Query parameters
querystring · min: 1Required

Search term matched against POD product names.

Example: gildan
Header parameters
Acceptstring · enumRequired

The request must accept JSON responses.

Possible values:
x-api-keystringRequired

API key required for authentication.

Example: YOUR_API_KEY_HERE
Responses
chevron-right
200

POD products matching the query.

application/json
successbooleanOptionalExample: true
messagestringOptional
get
/mock-anything/products

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 - you pass its uuid to the Render Mockup API 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. Call Create MockAnything AI Mockup. You get back a task_id.

  3. 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.

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.

circle-info

product.uuid, model, and enhance_prompt only apply to the prompt flow. They're ignored when you send image_url or image_file.

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.

  • FAILURE - the task terminated without producing a mockup.

circle-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.

Using your new mockup

Once state is SUCCESS, the mockup field looks identical to an entry from the Get Mockups API, with type: "mockanything". Two fields matter for rendering:

  • mockup.uuid - pass as mockup_uuid in the Render Mockup API.

  • mockup.smart_objects[].uuid - each print area detected on the image. Reference these as smart_objects[].uuid in the Render Mockup API payload to place your artwork on each area.

From here everything works exactly like rendering a classic mockup. The Render Mockup API 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.

circle-info

Grounding is optional. Skip it if you just want the model to pick a natural composition based on the prompt alone.

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 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 to manage collections.

circle-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.

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.

Model
Credits
Speed
Quality
Best for

seedream_4_0

5

~20s

Medium

Quick iterations and early exploration

seedream_4_5

6

~40s

Good

Higher fidelity without the pro price

nano_banana_2

14

~30s

High

Production-quality, final mockups

circle-info

Credits are charged when the task reaches SUCCESS. Failed generations (FAILURE state) don't cost anything.

circle-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.

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.

Last updated