curl --request POST \
--url https://app.uselamina.ai/v1/compose/video \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "How Lamina composes video",
"script": "Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.",
"direction": "Confident, fast-paced; open on the product, end on the logo.",
"aspectRatio": "9:16",
"idempotencyKey": "demo-2026-07-26-001"
}
'import requests
url = "https://app.uselamina.ai/v1/compose/video"
payload = {
"title": "How Lamina composes video",
"script": "Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.",
"direction": "Confident, fast-paced; open on the product, end on the logo.",
"aspectRatio": "9:16",
"idempotencyKey": "demo-2026-07-26-001"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'How Lamina composes video',
script: 'Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.',
direction: 'Confident, fast-paced; open on the product, end on the logo.',
aspectRatio: '9:16',
idempotencyKey: 'demo-2026-07-26-001'
})
};
fetch('https://app.uselamina.ai/v1/compose/video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.uselamina.ai/v1/compose/video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'How Lamina composes video',
'script' => 'Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.',
'direction' => 'Confident, fast-paced; open on the product, end on the logo.',
'aspectRatio' => '9:16',
'idempotencyKey' => 'demo-2026-07-26-001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.uselamina.ai/v1/compose/video"
payload := strings.NewReader("{\n \"title\": \"How Lamina composes video\",\n \"script\": \"Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.\",\n \"direction\": \"Confident, fast-paced; open on the product, end on the logo.\",\n \"aspectRatio\": \"9:16\",\n \"idempotencyKey\": \"demo-2026-07-26-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.uselamina.ai/v1/compose/video")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"How Lamina composes video\",\n \"script\": \"Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.\",\n \"direction\": \"Confident, fast-paced; open on the product, end on the logo.\",\n \"aspectRatio\": \"9:16\",\n \"idempotencyKey\": \"demo-2026-07-26-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.uselamina.ai/v1/compose/video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"How Lamina composes video\",\n \"script\": \"Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.\",\n \"direction\": \"Confident, fast-paced; open on the product, end on the logo.\",\n \"aspectRatio\": \"9:16\",\n \"idempotencyKey\": \"demo-2026-07-26-001\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"runId": "cmp-lz9x2k-a1b2c3",
"status": "running"
}
}{
"error": "format \"talking_head\" requires input(s): presenterImage",
"code": "VALIDATION_ERROR",
"retryable": false,
"details": {
"reason": "MISSING_REQUIRED_INPUT",
"formatId": "talking_head",
"missingInputs": [
"presenterImage"
]
}
}{
"error": "Invalid API key"
}"Too many requests from this IP, please try again in a minute"Compose Narrated Video
Compose a narrated, multi-shot video from a script — not a single ~5s clip. Synthesizes the narration, storyboards it into beats, generates a continuity-chained shot per beat, and renders with transitions + Ken-Burns + captions.
Asynchronous — composition takes minutes. You get a runId
immediately; poll GET /v1/compose/video/{runId} (the snapshot carries
stage progress) or use it after POST /v1/compose/plan to confirm cost.
Steer the render via the script, never models: optional direction
(free text) and sections (per-span hints). Pass idempotencyKey to make
retries safe (a repeated key returns the same run — no double charge).
curl --request POST \
--url https://app.uselamina.ai/v1/compose/video \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "How Lamina composes video",
"script": "Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.",
"direction": "Confident, fast-paced; open on the product, end on the logo.",
"aspectRatio": "9:16",
"idempotencyKey": "demo-2026-07-26-001"
}
'import requests
url = "https://app.uselamina.ai/v1/compose/video"
payload = {
"title": "How Lamina composes video",
"script": "Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.",
"direction": "Confident, fast-paced; open on the product, end on the logo.",
"aspectRatio": "9:16",
"idempotencyKey": "demo-2026-07-26-001"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'How Lamina composes video',
script: 'Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.',
direction: 'Confident, fast-paced; open on the product, end on the logo.',
aspectRatio: '9:16',
idempotencyKey: 'demo-2026-07-26-001'
})
};
fetch('https://app.uselamina.ai/v1/compose/video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.uselamina.ai/v1/compose/video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'How Lamina composes video',
'script' => 'Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.',
'direction' => 'Confident, fast-paced; open on the product, end on the logo.',
'aspectRatio' => '9:16',
'idempotencyKey' => 'demo-2026-07-26-001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.uselamina.ai/v1/compose/video"
payload := strings.NewReader("{\n \"title\": \"How Lamina composes video\",\n \"script\": \"Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.\",\n \"direction\": \"Confident, fast-paced; open on the product, end on the logo.\",\n \"aspectRatio\": \"9:16\",\n \"idempotencyKey\": \"demo-2026-07-26-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.uselamina.ai/v1/compose/video")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"How Lamina composes video\",\n \"script\": \"Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.\",\n \"direction\": \"Confident, fast-paced; open on the product, end on the logo.\",\n \"aspectRatio\": \"9:16\",\n \"idempotencyKey\": \"demo-2026-07-26-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.uselamina.ai/v1/compose/video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"How Lamina composes video\",\n \"script\": \"Most tools hand you a 5-second clip. Lamina scripts the whole story, then films it shot by shot — narration, captions, and all.\",\n \"direction\": \"Confident, fast-paced; open on the product, end on the logo.\",\n \"aspectRatio\": \"9:16\",\n \"idempotencyKey\": \"demo-2026-07-26-001\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"runId": "cmp-lz9x2k-a1b2c3",
"status": "running"
}
}{
"error": "format \"talking_head\" requires input(s): presenterImage",
"code": "VALIDATION_ERROR",
"retryable": false,
"details": {
"reason": "MISSING_REQUIRED_INPUT",
"formatId": "talking_head",
"missingInputs": [
"presenterImage"
]
}
}{
"error": "Invalid API key"
}"Too many requests from this IP, please try again in a minute"runId immediately; poll Get Compose Run for stage progress and the final video URL.
Steer the render through the script, never models: optional direction (free text) and sections (per-span hints). Pass an idempotencyKey to make retries safe — a repeated key returns the same run, so you never double-charge. Invalid input returns a 400 whose details.reason is machine-readable (SCRIPT_TOO_LONG, MISSING_REQUIRED_INPUT, …) so an agent can self-correct.Authorizations
Workspace API key. Prefix: lma_. Example: lma_abc123...
Body
Shared input for POST /v1/compose/plan and POST /v1/compose/video. The user picks a format (never a model) and steers the render via the script — direction + sections — not by naming models.
The narration to speak (a hook + one insight + a CTA). Its spoken length must be ≤ the maxScriptDurationSec capability (~90s).
4000Video title.
One-paragraph visual brief for the shots.
A format id from GET /v1/compose/formats. Omit to auto-route the script to the best available format.
Free-text creative direction ("open on the product, fast cuts, end on the logo") — steers the render without naming models.
Structured per-span storyboard hints, for a prescriptive caller.
Show child attributes
Show child attributes
A format's required inputs, keyed by input key (e.g. a presenterImage key mapping to an https URL). See each format's inputs in GET /v1/compose/formats.
16:9, 9:16, 1:1, 4:5, 4:3 ElevenLabs voice id for the narration. Omit and the narration director picks a voice whose tone fits the script. (compose/video only.)
Add ElevenLabs v3 audio tags for stronger, more human inflection. Prosody/pacing is always applied; this adds emotional tags. Default false. (compose/video only.)
Condition the render on-brand — the brand DNA steers the style bible, the narration voice (Brand Kit), and the caption color/font. On compose/plan it conditions the previewed storyboard too (response includes brand.applied). Omit for a generic look. Fail-soft; a brand miss never blocks the render.
Target per-clip length within the capability window.
Dedupe retries — a repeated key returns the same run (no double charge). (compose/video only.)
Response
Composition started. Poll the run for progress + results.