Generate slideshow captions (AI)
POST
/public/v1/slides/caption
const url = 'https://api.loomta.com/public/v1/slides/caption';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"userRequest":"Why indie devs love our app","slideCount":4,"language":"en","slideLength":"medium"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.loomta.com/public/v1/slides/caption \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "userRequest": "Why indie devs love our app", "slideCount": 4, "language": "en", "slideLength": "medium" }'Generates an overall caption plus per-slide text for a photo carousel. Spends AI credits from the workspace.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
userRequest
required
What the slideshow should be about.
string
slideCount
required
integer
language
Language for the generated text.
string
slideLength
string
Example
{ "userRequest": "Why indie devs love our app", "slideCount": 4, "language": "en", "slideLength": "medium"}Responses
Section titled “Responses”The generated caption and slides.
Media typeapplication/json
object
caption
required
string
slides
required
Array<object>
object
index
integer
caption
string
Examplegenerated
{ "caption": "example", "slides": [ { "index": 1, "caption": "example" } ]}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."}{ "code": "invalid_api_key", "message": "The API key is invalid."}Not enough AI credits remain on the plan.
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": "insufficient_credits", "message": "This workspace has no AI credits remaining."}