Generate Images
Generate images from text prompts, transform existing images, upscale, and generate video — paying per output, with no model accounts to manage.
Call it from an agent step
Section titled “Call it from an agent step”Image generation is on the typed ctx.sapiom.* client, so sapiom_dev_agents_check validates the call at author time:
const { images } = await ctx.sapiom.contentGeneration.images.create({ prompt: "a serene mountain lake at dawn", numImages: 1, // storage: { ... } // optional — persist each output to file storage});console.log(images[0].url);Video generation lives alongside it at ctx.sapiom.contentGeneration.video. Autocomplete surfaces the full input and response types. See Using Capabilities.
Call it directly (no agent)
Section titled “Call it directly (no agent)”From any MCP client, reach image generation — plus transforms and upscaling — through the remote MCP as sapiom_* tools. Run tool_discover with your goal to get the exact tool and a call example.
From your own code
Section titled “From your own code”Outside an agent, call the same capability through the typed client — see SDK & API:
const { images } = await sapiom.contentGeneration.images.create({ prompt: "..." });