---
title: "Generate an image from a text prompt"
method: POST
path: "/api/media/generate"
---

# Generate an image from a text prompt

`POST /api/media/generate`

## Request

- Base URL: `https://api.seenpaid.com`
- URL: `https://api.seenpaid.com/api/media/generate`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.seenpaid.com/authorize`, token URL `https://api.seenpaid.com/token`, scopes: `posts:write`)

Generate an image from a prompt (free, no key required) and register it as media in one call. Returns a media id usable directly in POST /api/posts.

## Request body

- object
  - `prompt` string, required

## Response `201`

Created

- object
  - `success` true
  - `data` Media
    - `id` string, uuid
    - `url` string, uri
    - `type` 'image' | 'video'
    - `createdAt` string, date-time

## Other responses

- `400`: Request body failed Zod validation.
- `401`: Missing or invalid credential (API key or OAuth token).

---

[API](https://skmtc.dev/seenpaid/apis/seenpaid-api.md) · [All operations](https://skmtc.dev/seenpaid/apis/seenpaid-api/llms.txt) · [OpenAPI document](https://skmtc.dev/seenpaid/apis/seenpaid-api/revisions/7b3f72ed82e9?raw)
