Draw in the browser, send to Sume: a canvas Sketch pad in 20 lines
ChatGPT Sketch lives inside ChatGPT. For your own app, export a canvas as PNG, upload it to a public HTTPS URL and pass it to Sume as a reference.

OpenAI's thread says Sketch opens when you type @Sketch in ChatGPT and lets you draw a visual guide (OpenAI Developer Community, read 2026-10-04). To give your own users the same move, you need a drawing surface, a place to host the PNG and one API call. Sume covers the last part: reference images go in input_references and must be public HTTPS URLs (Sume Image API).
Three pieces
Keep the Sume API key on your server, never in the browser. The browser only uploads the PNG to your storage and tells your server the URL.
| Piece | Who builds it | Notes |
|---|---|---|
| Canvas | Your front end | An HTML canvas with pointer events |
| Hosting | Your storage | Presigned PUT to a bucket that serves a public HTTPS URL |
| Edit call | Your server | POST /v1/images with the URL in input_references |
Export and upload
signedPutUrl and publicUrl come from your own server, which creates a short-lived upload URL and the matching public address. Make the public URL live long enough for the job to run.
async function uploadSketch(canvas, signedPutUrl, publicUrl) {
const blob = await new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
const put = await fetch(signedPutUrl, {
method: "PUT",
headers: { "Content-Type": "image/png" },
body: blob,
});
if (!put.ok) throw new Error(`upload failed: ${put.status}`);
return publicUrl;
}
Server call and prompt
Your server sends the URL with a prompt that says what the drawing is for: "Image 1 is a rough layout sketch. Follow its composition and proportions, not its line quality. Render it as a photo of a living room." The model gets guidance from the sketch and the words, the same two inputs that Sketch combines in ChatGPT.
- Fill the canvas with a white background before export; a transparent PNG can read as an empty drawing.
- Check the URL from the outside before you send it, as in the public HTTPS checklist.
- Sume also has an assets upload flow; its docs say to prefer public HTTPS media URLs in generation requests.
Sources
Related posts
More in Developers
- Dropped connection mid-render: what happens to the Sume job
A dropped connection never cancels a Sume job. Wait again with jobs_wait on the same ids, or read the job status; never resubmit the paid create.
- "Each input_references entry needs image_url.url": the fix
A bare URL string or a missing url in input_references returns 400 invalid_request on Sume. The exact entry shape, reference ceilings per row, a helper.
- Mcp-Name header rules: rate-limit paid render tools at the gateway
MCP 2026-07-28 requires Mcp-Method and Mcp-Name headers on Streamable HTTP POSTs. A gateway can rate-limit paid render tools by name without reading the body.
- GPT Image 2.5 on ElevenLabs: 14 ratios plus auto. Sume lists 17
ElevenLabs offers 14 fixed ratios plus auto for GPT Image 2.5. Sume's normalized list has 17 plus auto. Read what each model accepts before sending one.
Written by Sume