This is the canonical recipe used internally by Recoup’sDocumentation Index
Fetch the complete documentation index at: https://developers.recoupable.com/llms.txt
Use this file to discover all available pages before exploring further.
create-content background task. Two paths are documented below: the async pipeline that an LLM agent should use, and the manual recipe for humans (or for cases where you want to swap a single step).
Hand it to your LLM
The fastest way to use this guide is to point an LLM at it directly — every page on this site is also served as raw markdown at the same path with a.md suffix, so models can fetch and follow it without parsing HTML:
Running as an agent? Use the async pipeline
POST /api/content/video is synchronous and routinely takes 60–180s. Most agent shells (Claude Cowork, OpenAI tool calls, etc.) cap a single command at 30–60s and kill background processes when the shell exits — the manual recipe below is effectively un-runnable from those environments.
Use the async path instead — same five steps, run server-side:
QUEUED, EXECUTING, COMPLETED, FAILED, CANCELED, CRASHED, etc.) and the CreateContentRunOutput schema.
Resolving $ARTIST_ACCOUNT_ID
POST /api/content/create needs the artist’s account_id. Three calls:
id and account_id (both UUIDs). Use account_id — id is the artist row’s primary key, account_id is the underlying account that owns it. The two are easy to swap; you’ll get a 404 from /api/content/create if you pass the wrong one.
Where the song lives
Step 5 (and the async pipeline’s lipsync mode) need asong.mp3. Don’t assume one exists, and don’t assume the user has one locally. Walk the agent through this fallback chain:
-
Check the artist’s sandbox repo first. Each Recoup account has a backing GitHub repo. If the user has imported songs through Recoup, they live at predictable paths:
Discover the repo with
GET /api/sandboxes(returnsgithub_repoand afiletree); fetch a file withGET /api/sandboxes/file?path=…. Binary files (.mp3,.png,.mp4) come back base64-encoded in thecontentfield — decode before writing to disk. -
If no song is in the sandbox, ask the user how to proceed. Two options to offer:
- “Want me to fetch the audio from YouTube?” — agent downloads via
yt-dlp(or equivalent), saves locally; user is responsible for any rights / DSP-licensing implications. - “Want to supply the song yourself?” — user uploads / drops a path; agent reads from there.
- “Want me to fetch the audio from YouTube?” — agent downloads via
- Don’t fall back to “use a placeholder track.” A music video without the song is not a deliverable.
Manual recipe (humans + targeted overrides)
The rest of this page walks the same steps you can run by hand or call individually if you want to swap a single stage (different prompt for image, different motion, different caption length).Prerequisites
- An auth credential for
api.recoupable.com. Two options — pick one and use it for every call below:- API key (
recoup_sk_…, recommended for sandbox / agent use): pass as-H "x-api-key: $RECOUP_API_KEY".- One-shot agent:
POST /api/agents/signupwith anagent+{unique}@recoupable.comemail returns the key immediately. - Real-email signup: same endpoint with a real email mails a 6-digit code; complete with
POST /api/agents/verify. See Agents.
- One-shot agent:
- Privy access token (for end-user flows in chat/UI): pass as
-H "Authorization: Bearer $RECOUP_ACCESS_TOKEN". - The examples below use
x-api-key. SubstituteAuthorization: Bearer …if you’re using a Privy token.
- API key (
$ARTIST_NAME,$SONG_TITLE,$SONG_LYRICS_CLIP(a 1–2 sentence mood snippet)$REFERENCE_IMAGE_URL(optional) — an artist photo or album cover to seed the image; if your template’s purpose is “show this exact image” (e.g.album-record-store), set this and skip image generation in step 2- A
song.mp3for step 5. Don’t ask the user for a local file — fetch from the artist’s repo via/api/sandboxes/file. ffmpeginstalled locally for step 5
Step 0: Scaffold the workspace BEFORE any API call
TheVIDEO.md checklist is the workflow state — tick boxes and persist values back to the frontmatter as you go. To resume later, find the first unchecked box.
Step 1: Pick a template (required: list and detail)
Templates carry the prompt, reference images, and styling that drive the rest of the chain — you can’t write a good Step 2 prompt without them. List, pick, then fetch detail:artist-caption-bedroom) will fall back to their bundled reference images and produce a generic-likeness subject if you don’t supply one — they don’t 400. Pass $REFERENCE_IMAGE_URL if you want the model to preserve a specific artist’s likeness, or omit it for a stock-feeling result.
See List Templates and Template Detail.
After: write template into frontmatter, tick the box.
Step 2: Generate the base image
Use the template’s own prompt and reference images — don’t write your own from scratch. The template encodes the visual style; freeform prompts almost always drift off-brand.$REFERENCE_IMAGE_URL is the exact image you want (e.g. an album cover for album-record-store, or a final editorial photo), set IMAGE_URL=$REFERENCE_IMAGE_URL and skip this call entirely.
Avoid: prompts that aim for a real artist’s likeness. Veo (used in step 3) rejects celebrity-likeness images with a 422. Use the template’s prompt as-is and let the reference images carry the style.
See Generate Image.
After: write imageUrl, tick the box.
Optional: Upscale (image or video)
Same endpoint for both, swaptype. Skip if you don’t need the resolution bump.
Step 3: Generate the video
Pass the image and a short motion prompt. For lipsync, also pass a presignedaudio_url to a song clip — the model will animate the artist’s mouth.
videoUrl, tick the box.
Step 4: Generate the caption
length accepts "short" (default), "medium", "long", or "none" to skip. The four styling fields (font, color, borderColor, maxFontSize) are template-driven hints — Step 5 wires them into ffmpeg’s drawtext so the burned-in caption matches the template’s brand.
See Generate Caption.
After: write captionText, tick the box.
Step 5: Compose the final 9:16 video (local)
The API returns a 16:9 motion clip. Compose locally: crop to 9:16, overlay the song audio for the full duration, and burn in the caption with the styling from step 4.finalVideoPath, tick the box. With every box ticked, the music video is complete.
Step 6: Publish (optional)
Once the MP4 is rendered, push it to the artist’s socials with the Connectors API. One heads-up worth knowing:- TikTok URL ownership.
TIKTOK_PUBLISH_VIDEO(pull-from-URL mode) requires the source domain be verified in the TikTok dev portal.fal.mediaURLs will fail withurl_ownership_unverified— useTIKTOK_UPLOAD_VIDEOinstead, which accepts the same URL and uploads server-side.
The checklist is the source of truth — if a box isn’t ticked, treat the step as not run.
