# Generate Images

Generate images from text prompts, with typed video generation available separately

## Navigation

**Getting Started:** [Introduction](/index.md) | [Install Agent Studio](/agent-studio/install.md) | [Build your first agent](/agents/quick-start.md) | [Connect your coding agent](/guides/connect-claude-code-with-mcp.md)  
**Concepts:** [Agents and agent projects](/concepts/agents-and-agent-projects.md) | [Workspaces and sessions](/concepts/workspaces-and-sessions.md) | [Local and cloud](/concepts/local-and-cloud.md) | [Ways to use Sapiom](/concepts/studio-mcp-sdk-and-dashboard.md)  
**Guides:** [Create from a template](/guides/create-from-a-template.md) | [Build](/guides/build.md) | [Test locally](/guides/test-locally.md) | [Deploy](/guides/deploy.md) | [Run in production](/guides/run-in-production.md) | [Inspect](/guides/inspect.md) | [Schedule](/guides/schedule.md) | [Use signals](/guides/use-signals.md) | [Configure authentication and runtime inputs](/guides/configure-authentication-and-runtime-inputs.md)  
**Agent Studio:** [Overview](/agent-studio/overview.md) | [Workspaces and projects](/agent-studio/workspaces-and-projects.md) | [Sessions](/agent-studio/sessions.md) | [Canvas, Steps, and Code](/agent-studio/canvas-steps-and-code.md) | [Account and privacy](/agent-studio/account-and-privacy.md)  
**Capabilities:** [Overview](/capabilities.md) | [Verify Users](/capabilities/verify.md) | [Search the Web](/capabilities/search.md) | [Web Scraping](/capabilities/scraping.md) | [AI Model Access](/capabilities/ai-models.md) | [Compute](/capabilities/compute.md) | [Data](/capabilities/data.md) | [Messaging](/capabilities/messaging.md) | **Generate Images** | [Audio Services](/capabilities/audio.md) | [Browser Automation](/capabilities/browser.md) | [File Storage](/capabilities/file-storage.md) | [Repositories](/capabilities/repositories.md) | [GitHub Export](/capabilities/github-export.md) | [Email & Enrichment](/capabilities/email-enrichment.md) | [Domains & DNS](/capabilities/domains.md)  
**Cloud capabilities:** [Sapiom Cloud MCP](/integration/mcp-servers/remote.md) | [@sapiom/tools package](/integration/sdk.md)  
**Reference:** [Agent authoring](/agents/authoring.md) | [Agent Studio CLI, files, and shortcuts](/reference/agent-studio.md) | [Credentials and configuration](/reference/credentials-and-configuration.md)  
**Troubleshooting:** [Agent Studio](/troubleshooting/agent-studio.md) | [Build, deploy, and run](/troubleshooting/build-deploy-run.md)  
**Legal:** [Privacy Policy](/privacy-policy.md) | [Terms of Use](/terms-of-use.md)

---

Generate one or more images from a text prompt. The typed client also has a separate asynchronous video-generation namespace; the hosted direct tool documented here is text-to-image only.

## 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:

```typescript
const { images } = await ctx.sapiom.contentGeneration.images.create({
  prompt: "a serene mountain lake at dawn",
  numImages: 1,
  storage: { visibility: "private" },
});

const image = images?.[0];
console.log(image?.fileId ?? image?.url);
```

When `storage` succeeds, keep `fileId` and mint a fresh short-lived download URL with `fileStorage.getDownloadUrl(fileId)`. `ctx.sapiom.contentGeneration.video.create` and `.launch` are separate typed operations. Autocomplete the installed package for their model and result types.

## Call it directly from your coding agent

[Sapiom Cloud MCP](/integration/mcp-servers/remote.md) lets Claude Code or Codex generate an image from a text prompt. This direct surface has no source-image input. Ask your coding agent to inspect the current contract rather than assuming Cloud MCP has the same video surface as the code package.

## Call it from TypeScript

Use the same typed namespace through `createClient()`—see the [`@sapiom/tools` package](/integration/sdk.md):

```typescript
const { images } = await sapiom.contentGeneration.images.create({
  prompt: "a paper-cut illustration of an agent graph",
});
```

> Generation is metered per runtime output. Check the signed-in capability
  catalog for current price availability.