Skip to main content

Use this pre-built prompt to get an agent writing SudoMock HTTP calls correctly.

Open in Cursor

Prerequisites

Before you start, you’ll need:

Guide

1

Set your API key

Keep the key in the environment so it never reaches source control.
Shell
2

Upload the PSD once

Both calls post JSON to the same host, so they share one helper. The timeout matters: a render holds the connection until the image is ready, and PHP’s default cuts it off first.
sudomock.php
Run the upload from the command line, never from a route, and put the two UUIDs it prints in the environment the route will run in.
upload.php
3

Render from a route

The route takes an artwork URL and answers with the finished image, passing a failure’s error_code through instead of swallowing it.
render.php
Serve it with php -S localhost:8000 from the shell holding the key and the two UUIDs.

Examples

Create a mockup from a PSD

The call behind upload.php

Render a PSD mockup

Every field of the render body

Fit and blend modes

What fit does to the artwork

Retrieve a single job

Collect an async render

Create a webhook endpoint

Get called back instead of polling

Create a mockup from a product photo

Start from a photo, not a PSD

Render a photo mockup

The second call of that flow

Error codes

Every code and which to retry