Skip to content

Generate slideshow captions

POST
/public/v1/slides/caption
curl --request POST \
--url https://api.loomta.com/public/v1/slides/caption \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "topic": "Why indie devs love our app" }'

Generates an overall caption plus per-slide text for a photo carousel. Spends one caption credit from the account’s monthly allowance.

Only topic is required. Everything that shapes the writing — the system prompt, knowledge base, language, and slide length — is taken from the workspace’s saved settings (configured in the Loomta app), so a minimal request already produces on-brand output. slideCount (default 6), language, and slideLength are optional per-call overrides; the system prompt and knowledge base are workspace-only and cannot be passed here.

Media typeapplication/json

Only topic is required. Tone and facts come from the workspace’s active system prompt and knowledge base (set in the Loomta app) automatically — you don’t pass those here. slideCount, language, and slideLength are optional (they default to a sensible value / the workspace defaults).

object
topic
required

Required. The topic or brief the slideshow is about — turned into a hook + per-slide captions.

string
>= 1 characters <= 500 characters
slideCount

Optional. How many slides to write captions for (3–10). Defaults to 6.

integer
default: 6 >= 3 <= 10
language

Optional override. ISO code for the language of the generated text. First-class support: en (English), vi (Vietnamese), ja (Japanese), ko (Korean), zh (Chinese), es (Spanish), fr (French), de (German), pt (Portuguese), id (Indonesian). Other codes are passed through and usually work. Omit to use the workspace’s configured default.

string
slideLength

Optional override. How much text per slide. Omit to use the workspace’s configured default (which falls back to medium).

string
Allowed values: short medium long
imagePrompt

Whether the response includes per-slide image prompts. Omitted or false — captions only (the default). true — every slide additionally gets an imagePrompt: a vivid, self-contained prompt for generating that slide’s background image (the input for AI image generation).

boolean
Examples

Minimal — just a topic (6 slides, workspace defaults)

{
"topic": "Why indie devs love our app"
}

The generated caption and slides.

Media typeapplication/json
object
caption
required

The overall post caption.

string
slides
required

One entry per slide, in order. index 0 is the hook (first slide). imagePrompt appears only when the request’s imagePrompt was true.

Array<object>
object
index

0-based slide position; 0 is the hook.

integer
caption
string
imagePrompt

Only present when requested — a prompt to generate this slide’s background image.

string
Example
{
"caption": "4 reasons indie devs keep coming back 👇",
"slides": [
{
"index": 0,
"caption": "The tool that ships with you"
},
{
"index": 1,
"caption": "Zero-config setup"
},
{
"index": 2,
"caption": "Fair, usage-based pricing"
},
{
"index": 3,
"caption": "Built for automation"
}
]
}

The request body failed validation.

Media typeapplication/json
object
code
required

A stable, machine-readable error code to branch on.

string
message
required

A human-readable description.

string
details

Optional structured detail (for example Zod validation issues).

Example
{
"code": "invalid_request",
"message": "The request payload is invalid.",
"details": [
{
"path": [
"slideCount"
],
"message": "Number must be greater than or equal to 3"
}
]
}

The API key is missing or invalid.

Media typeapplication/json
object
code
required

A stable, machine-readable error code to branch on.

string
message
required

A human-readable description.

string
details

Optional structured detail (for example Zod validation issues).

Examples
{
"code": "missing_api_key",
"message": "A Bearer API key is required."
}

The account’s monthly caption credit allowance is exhausted.

Media typeapplication/json
object
code
required

A stable, machine-readable error code to branch on.

string
message
required

A human-readable description.

string
details

Optional structured detail (for example Zod validation issues).

Example
{
"code": "ai_credit_limit_reached",
"message": "Your plan includes 50 AI credits per month. Upgrade your plan for more."
}