Generate an image
Make one image from a prompt, optionally steered by reference images from the media library, on the frontier image models our studio agent uses, and get it back as a media key with a URL.
Pick the aspect ratio for the platform it is going to. The key goes straight into a post's mediaKeys or a carousel. The credit is held for the call's budget and settled at what it really cost; a refusal or failure is never charged.
Ask in plain words
- "make an image of a founder desk at dusk for LinkedIn"
- "image generation API for social posts"
- "generate a 4:5 cover image for this Instagram post"
From an agent host (MCP)
Server: https://shapelessai.com/mcp (add it to your host).
tools_runwith{ "name": "generate_image", "input": { ... } }: the input is the REST body below;tools_listprints its JSON Schema.
From code (REST)
Bearer API key with the scope each call names (auth, OpenAPI).
POST /api/images(write scope): Generate an image (tool generate_image): {name, prompt, aspectRatio, size?, quality?, reference_keys?, budgetUsd?}.
From a terminal (CLI)
shapeless tools run generate_image --input '<json>'(tools show generate_imageprints the schema)
Example
Refusals
| Status | Meaning |
|---|---|
| 400 | The input does not match the tool's schema; the message names the field. |
| 402 | Not enough credit to hold budgetUsd, or the call costs more than budgetUsd. |
| 404 | No such tool on this deployment. |
| 422 | The tool refused this input; nothing was charged. |
| 502 | The tool failed; nothing was charged. |
