Skip to Content
Create an 'ask-questions' job
post

Creates a new job that uses AI to answer questions about a Mux Video asset. Optional output steering can restrict execution to a time scope in seconds.

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 of the video to analyze.

One or more questions to ask about the video. Each question can either select from answer_options (defaults to yes/no) or, by setting free_form_reply: true, receive a free-form prose answer.

parameters.questions[].question
string

The question to ask about the video content. Maximum 600 characters.

parameters.questions[].answer_options
array

Allowed answer values for this question. Defaults to ["yes", "no"] when omitted and free_form_reply is not true. Mutually exclusive with free_form_reply. Each option is a short label of at most 150 characters.

parameters.questions[].free_form_reply
boolean

Experimental. When true, the model replies with free-form prose instead of selecting from answer_options. Mutually exclusive with answer_options. Treat the answer as untrusted model output.

parameters.language_code
string

BCP 47 language code of the caption track to analyze (e.g. "en", "fr"). When omitted, the SDK uses the default track.

parameters.max_free_form_answer_length
integer
(default: 500, min: 1, max: 1000)

Experimental. Max character length for free-form answers, between 1 and 1000. Ignored unless at least one question sets free_form_reply: true.

Curated controls that optionally restrict question answering to an asset time range.

parameters.output_steering.scope
post
202
https://api.mux.com/robots/v0/jobs/ask-questions
Request
(application/json)
{
  "parameters": {
    "asset_id": "mux_asset_123abc",
    "questions": [
      {
        "question": "Is this video about glasses?"
      },
      {
        "question": "What is the primary subject?",
        "answer_options": [
          "glasses",
          "watches",
          "shoes",
          "hats"
        ]
      },
      {
        "question": "Describe the primary subject in one sentence.",
        "free_form_reply": true
      }
    ],
    "max_free_form_answer_length": 300,
    "output_steering": {
      "scope": {
        "start_time": 30,
        "end_time": 180
      }
    }
  }
}
Response
(application/json)
{
  "data": {
    "id": "rjob_example123",
    "workflow": "ask-questions",
    "status": "pending",
    "units_consumed": 0,
    "created_at": 1700000000,
    "updated_at": 1700000060,
    "parameters": {
      "asset_id": "mux_asset_123abc",
      "questions": [
        {
          "question": "Is this video about glasses?"
        },
        {
          "question": "What is the primary subject?",
          "answer_options": [
            "glasses",
            "watches",
            "shoes",
            "hats"
          ]
        },
        {
          "question": "Describe the primary subject in one sentence.",
          "free_form_reply": true
        }
      ],
      "max_free_form_answer_length": 300,
      "output_steering": {
        "scope": {
          "start_time": 30,
          "end_time": 180
        }
      }
    }
  }
}