Build a slideshow
This guide builds a TikTok photo carousel end to end: generate captions with AI, bake them onto your images, then create the post. Each API step depends on the one before it, so the flow always ends on creating the post.
The flow
Section titled “The flow”auth → (configure workspace AI settings) → generate captions → composite captions onto media → upload / pick media → create post- Auth — every call uses your
loomta_sk_…key. - Workspace AI settings — the active system prompt + knowledge base (configured once in the Loomta app) steer caption tone and facts. You don’t send these per request; the API applies them for you.
- Generate captions — turn a brief into a hook + per-slide captions.
- Composite — bake those captions onto your images, producing new media.
- Create post — the final step; schedule or publish the composited images.
-
Generate captions. Give the model a brief and a slide count. The response is a post
captionplus one caption per slide —slides[0]is the hook.Terminal window curl https://api.loomta.com/public/v1/slides/caption \-H "Authorization: Bearer $LOOMTA_API_KEY" \-H "Content-Type: application/json" \-d '{ "topic": "Why indie devs love our app", "slideCount": 4 }'Terminal window loomta slides:caption -r "Why indie devs love our app" -n 4That’s the whole request —
topicis the only required field (slideCountdefaults to 6). -
Composite captions onto your images. Pass each slide as
{ index, mediaId, caption }, wheremediaIdis aREADYimage you’ve uploaded (see Quickstart step 3). The response gives you new compositedmediaIds, in order.Terminal window curl https://api.loomta.com/public/v1/slides/composite \-H "Authorization: Bearer $LOOMTA_API_KEY" \-H "Content-Type: application/json" \-d '{"slides": [{ "index": 0, "mediaId": "<IMG_0>", "caption": "The tool that ships with you" },{ "index": 1, "mediaId": "<IMG_1>", "caption": "Zero-config setup" }]}'Terminal window loomta slides:composite --slides ./slides.jsonCompositing is free (no AI credit).
textStyleIdandcaptionSizefollow the same rule as the caption step — optional overrides that default to your workspace settings when omitted. Since there’s no UI picker over the API, the allowed values are fixed sets:textStyleIdis one oftiktok-sans,anton,montserrat,poppins,league-spartan;captionSizeissmall,medium, orlarge. See the Slides API reference for the full list. -
Create the post (last). Use the composited
mediaIds, in order, as the carousel.mode: scheduleneeds ascheduledFor;mode: nowpublishes immediately.Terminal window curl https://api.loomta.com/public/v1/posts \-H "Authorization: Bearer $LOOMTA_API_KEY" \-H "Content-Type: application/json" \-d '{"platformIds": ["<PLATFORM_ID>"],"content": "4 reasons indie devs keep coming back 👇","mode": "schedule","scheduledFor": "2026-07-01T15:00:00Z","mediaIds": ["<COMPOSITED_0>", "<COMPOSITED_1>"],"settings": { "privacy_level": "PUBLIC_TO_EVERYONE" }}'Terminal window loomta posts:create \-c "4 reasons indie devs keep coming back 👇" \-i "<PLATFORM_ID>" \-m "<COMPOSITED_0>" -m "<COMPOSITED_1>" \-s 2026-07-01T15:00:00Z
A — Captions only (bring your own images). The default flow above:
slides:caption → slides:composite → posts.
B — Steered output. Configure a system prompt and knowledge base in the
Loomta app and mark them active. Every slides:caption call then reflects that
voice and those facts automatically — no extra request fields. This is how the
API matches what the web app produces.
C — Captions + image prompts. Pass "imagePrompt": true to also get a
per-slide imagePrompt in the response. Each one is a self-contained prompt used
to generate that slide’s image for the slideshow — feed them into AI image
generation to produce the carousel’s visuals instead of supplying your own.
{ "topic": "Why indie devs love our app", "slideCount": 4 }{ "topic": "Why indie devs love our app", "slideCount": 4, "imagePrompt": true }{ "caption": "4 reasons indie devs keep coming back 👇", "slides": [ { "index": 0, "caption": "The tool that ships with you", "imagePrompt": "A cluttered indie developer desk at night, laptop glowing, moody cinematic lighting" } ]}Hands-off: generate the whole slideshow (async)
Section titled “Hands-off: generate the whole slideshow (async)”The fastest path skips all of the above. Give POST /slides/generate a
topic and it does everything server-side: writes the captions + image
prompts, generates an AI image per slide, composites the captions, and creates
the post (draft / scheduled / now, per mode). One call, fire-and-forget.
It’s asynchronous — the request returns a jobId immediately, then you poll
until it’s done. It spends one caption credit plus one image credit per slide.
-
Submit the job with a topic.
mode: draft(recommended) creates a reviewable draft when ready.slideCountdefaults to 6.Terminal window curl https://api.loomta.com/public/v1/slides/generate \-H "Authorization: Bearer $LOOMTA_API_KEY" \-H "Content-Type: application/json" \-d '{"platformIds": ["<PLATFORM_ID>"],"topic": "Why indie devs love our app","slideCount": 4,"mode": "draft"}'Response { "jobId": "…", "status": "WAITING" } -
Poll the job until
statusisDONE(orFAILED).Terminal window curl https://api.loomta.com/public/v1/slides/generate/<JOB_ID> \-H "Authorization: Bearer $LOOMTA_API_KEY"Response { "id": "…", "status": "DONE", "total": 4, "completed": 4, "postGroupId": "…", "error": null } -
The post now exists at
postGroupId— a draft (publish it when you’re happy) or a scheduled/published post, permode.
Where to go next
Section titled “Where to go next”- Slides API reference — every field, constraint, and response shape.
- AI credits — what each call costs.
- Errors — branch on stable error codes.