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

Creates a new job that uses AI to answer questions about a Mux Video asset.

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.

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.

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)

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

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
  }
}
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
    }
  }
}