# Content Agent

Source: https://docs.recoupable.dev/content-agent

Use hosted creative presets and current image, video and composition primitives.

## Release Packs

For a song-centered content pack, use [Release Packs](https://docs.recoupable.dev/release-packs): collect
essential context inline, preserve one job, quote the complete scope and produce
reviewed media. New releases, catalog rediscovery, anniversaries, reissues and
remixes use the same brief-driven path. These pack operations do not require an
existing artist or repository; availability depends on deployed host tools.

## Hosted workflows

`POST /api/content/create` retains the hosted preset workflow. Supply the authorized
`artist_account_id`, optional `template`, `images`, `songs`, `batch` (defaults to 1; range 1–30), `lipsync`, `upscale`
and `caption_length`. Discover templates through `/api/content/templates` and its
detail route. The response contains `runIds`; poll `/api/tasks/runs?runId=...` until
terminal. Report failures and inspect the final artifact before delivery.

Hosted lipsync is a supported preset intent. The coordinated API/worker repair
restores the selected song window to the fixed audio-to-video path; that repaired
journey is release-pending until deployment and actual output verification.

## Direct primitives

For images use `POST /api/content/image` with `prompt` and up to 10 unique
`image_urls`. The house model is Muse Image, switching to its edit path when
references are present. New clients must use `image_urls`; compatibility aliases
are translated by the reconciliation release.

For video use `POST /api/content/video` with `prompt`, optional `image_url` and
`end_image_url`, integer `duration` 5–15, and `resolution` `480P` or `768P`.
The house model is MiniMax H3 Max. It has no six-mode selector, arbitrary model,
reference-only, extend, `video_url` or `audio_url` request control. Unsupported
semantic inputs return 400 in the reconciliation release, before paid generation.

The dedicated `/api/content/lipsync` primitive restores the existing fixed LTX
model for the worker; it is not assumed available on an older deployment.
Caption, transcribe, analyze, upscale and edit have their own endpoint contracts.
Local ffmpeg composition can crop, trim, overlay or mux a song; it does not create
mouth synchronization or prove a hosted generation succeeded.

## Cost and evidence

Each generation/inference stage can consume credits. `/api/content/estimate`
returns an advisory estimate, not a guaranteed price or complete final ledger.
A later failed composition does not imply that completed upstream work was free.
On insufficient credits, surface `billingUrl` and stop. Consult [Credits](https://docs.recoupable.dev/credits).

Record image inspection, motion review and audio playback. The worker checks for
an audio stream on lipsync output before composition; perceptual mouth alignment
still requires inspection. Automated checks do not replace human QA.

## Slack integration

The separate [Slack webhook](https://docs.recoupable.dev/api-reference/content-agent/webhook) handles
Content Agent mentions. Its request/event contract and the [completion callback](https://docs.recoupable.dev/api-reference/content-agent/callback) are distinct from direct primitives.
Workspace operators must configure the Slack application and service credentials;
installing a creative skill does not install that integration.

### Set up the Slack app

Create a Slack app, enable the `chat:write` and `app_mentions:read` bot scopes,
and subscribe to `app_mention` events at
`https://api.recoupable.dev/api/content-agent/slack`. Install it in the intended
workspace and invite it to the channel.

Configure `SLACK_CONTENT_BOT_TOKEN`, `SLACK_CONTENT_SIGNING_SECRET`,
`CODING_AGENT_CALLBACK_SECRET` and `REDIS_URL` in the Recoup API service.
The existing Tasks worker uses the same `CODING_AGENT_CALLBACK_SECRET` for
completion callbacks and its authorized Recoup credential and API base URL.
Keep these values in service secret settings. The current callback secret name
is `CODING_AGENT_CALLBACK_SECRET`; `CONTENT_AGENT_CALLBACK_SECRET` is obsolete.

Slack sends the signed-request headers listed in the [webhook reference](https://docs.recoupable.dev/api-reference/content-agent/webhook).
Keep `SLACK_CONTENT_SIGNING_SECRET` matched to that Slack app. Setup requests
with missing or invalid signatures, a timestamp outside the five-minute window,
or an unavailable signing secret return `401` with plain-text `Unauthorized`.
A verified setup request returns its JSON challenge. If setup fails, check the
app secret and service clock against [Slack request verification](https://docs.slack.dev/authentication/verifying-requests-from-slack/).
Ordinary event acknowledgements come from the Slack adapter; they acknowledge
receipt while generation completes separately.

Mention the installed bot with the authorized artist account UUID:

```text
@RecoupContentAgent ARTIST_ACCOUNT_UUID artist-caption-bedroom batch=1
```

The template, `batch=N` (1–30) and `lipsync` flags are optional. Check the
acknowledgment, then inspect the completed result or reported failure in the
thread. Generated output still requires the inspection described above.
