Skip to Content
Create a 'generate-contextual-text' job
post
Deprecated

Deprecated: use POST /robots/v1/jobs/generate-contextual-text instead. Generates customizable text, such as social posts, blog posts, and newsletter entries, from a Mux video or audio asset. Describe each piece of text you want as an artifact, and request named variants to get several versions of the whole set. Optional output steering limits the time range used and guides audience, voice, call to action, and brand terminology.

Request body params
passthrough
string

Arbitrary string stored with the job and returned in responses. Useful for correlating jobs with your own systems.

parameters.asset_id
string

The Mux asset ID whose transcript grounds the generated text.

parameters.use_shots
boolean

When true for a video asset, generate or reuse Mux shots and attach a bounded sample of shot frames as additional visual evidence. Video assets always include a storyboard; the transcript remains authoritative. Not supported for audio-only assets.

Curated controls that apply to every generated artifact in every variant. Scope bounds execution; the other fields are best-effort writing guidance. To vary voice or audience between variants, use variant instructions.

parameters.output_steering.scope
parameters.output_steering.audience
string

The intended reader, used as best-effort guidance for framing, vocabulary, and assumed context.

parameters.output_steering.voice
string
Possible values: "conversational""editorial""playful""professional"

Best-effort writing voice for every generated artifact in every variant. To give variants different voices, describe the voice in each variant's instructions instead.

parameters.output_steering.call_to_action
string
Possible values: "none""soft""direct"

Best-effort guidance for whether and how the text should invite the reader to engage further.

parameters.output_steering.brand_terms

Named versions of the complete artifact set. Every variant produces every artifact. Supports 1-5 variants with unique keys.

parameters.variants[].key
string

Customer-chosen lowercase snake_case identifier used to correlate requested and returned content.

parameters.variants[].instructions
string

Optional bounded guidance that gives this variant a deliberate angle, such as a voice, audience, or focus (for example, "Playful voice for a Gen Z audience"). Applies to every artifact in the variant. Omit it to request another independent take on the same brief.

The deliverables to create. Every variant produces each artifact. Supports 1-5 artifacts with unique keys.

parameters.artifacts[].key
string

Customer-chosen lowercase snake_case identifier used to correlate requested and returned content.

parameters.artifacts[].instructions
string

Optional guidance specific to this artifact, such as the deliverable to write. Applies in every variant.

parameters.artifacts[].channel
string
(default: generic)
Possible values: "generic""x""linkedin""facebook""instagram""tiktok""youtube"

Publishing channel whose conventions guide the result and set its default length: 300 words for generic and linkedin, 250 words for facebook and youtube, 100 words for tiktok, 1,500 characters for instagram, and 280 characters for x. generic has no platform conventions; its style follows the length cap, and a max_length above 600 words produces article-style writing such as a blog post or newsletter entry.

Hard output cap in characters or words. Defaults to the channel's cap. Text aims for about 90% of the cap regardless of the source's length, so set the length you want rather than relying on the default. x is always capped at 280 characters, even with a word cap.

parameters.artifacts[].format
string
(default: plain)
Possible values: "plain""markdown"

Whether the text may use Markdown syntax. plain contains no Markdown.

parameters.language_code
string

BCP 47 language code of the caption track to analyze. When omitted, the first ready text track is used.

parameters.output_language_code
string

BCP 47 language code for generated text. Defaults to the selected transcript track's language when available.

post
202
https://api.mux.com/robots/v0/jobs/generate-contextual-text
Request
(application/json)
{
  "parameters": {
    "asset_id": "mux_asset_123abc",
    "output_steering": {
      "audience": "Video developers",
      "voice": "conversational"
    },
    "variants": [
      {
        "key": "product_led",
        "instructions": "Use a promotional, product-led angle."
      },
      {
        "key": "insight_led",
        "instructions": "Use an educational, insight-led angle."
      }
    ],
    "artifacts": [
      {
        "key": "x_post",
        "channel": "x",
        "max_length": {
          "unit": "characters",
          "value": 280
        }
      },
      {
        "key": "blog_post",
        "max_length": {
          "unit": "words",
          "value": 1200
        },
        "format": "markdown"
      }
    ]
  }
}
Response
(application/json)
{
  "data": {
    "id": "rjob_example123",
    "workflow": "generate-contextual-text",
    "status": "pending",
    "units_consumed": 0,
    "created_at": 1700000000,
    "updated_at": 1700000060,
    "parameters": {
      "asset_id": "mux_asset_123abc",
      "output_steering": {
        "audience": "Video developers",
        "voice": "conversational"
      },
      "variants": [
        {
          "key": "product_led",
          "instructions": "Use a promotional, product-led angle."
        },
        {
          "key": "insight_led",
          "instructions": "Use an educational, insight-led angle."
        }
      ],
      "artifacts": [
        {
          "key": "x_post",
          "channel": "x",
          "max_length": {
            "unit": "characters",
            "value": 280
          }
        },
        {
          "key": "blog_post",
          "max_length": {
            "unit": "words",
            "value": 1200
          },
          "format": "markdown"
        }
      ]
    }
  }
}