Ask questions about a video and get structured answers with the Mux Robots API, and limit the answers to part of the video. Use this workflow to extract information, classify videos, or build decision logic on video content.
Ask one or more questions about a video and get structured answers. This is a flexible workflow that lets you extract specific information from video content, classify videos, or build decision-making logic around video analysis. See the Ask Questions API referenceAPI for the full endpoint specification. See Mux Robots pricing for unit costs.
Check the shared workflow prerequisites before creating a job.
ask-questions jobcurl https://api.mux.com/robots/v1/jobs/ask-questions \
-H "Content-Type: application/json" \
-X POST \
-d '{
"parameters": {
"asset_id": "YOUR_ASSET_ID",
"questions": [
{ "question": "Does this video contain a product demonstration?", "answer_options": ["yes", "no"] },
{ "question": "Is the speaker using a presentation?", "answer_options": ["yes", "no"] },
{ "question": "What programming language is shown?", "answer_options": ["python", "javascript", "go", "other"] }
]
}
}' \
-u ${MUX_TOKEN_ID}:${MUX_TOKEN_SECRET}This request is asynchronous. The POST returns immediately with the job in pending status and does not include results. We strongly recommend listening for the robots.v1.job.ask_questions.completed webhook — the payload contains the full completed job, so no follow-up API call is needed. If webhooks aren't an option, you can poll GET /robots/v1/jobs/ask-questions/{JOB_ID} with the id from the response until the status is completed.
| Parameter | Type | Description |
|---|---|---|
asset_id | string | Required. The Mux asset ID of the video to analyze. |
questions | array of object | Required. One or more questions to ask about the video, up to 50. 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. |
language_code | string | BCP 47 language code of the caption source. An explicit language must match a ready source exactly, including case; for example, en does not match en-US. Translation target exclusion and track replacement instead compare base languages case-insensitively. When omitted, automatic selection applies. Uses the first ready subtitle in asset track order without English preference. Audio-only assets with one ready text track lacking subtitle metadata can use that legacy transcript. |
max_free_form_answer_length | integer | Max character length for free-form answers, between 1 and 1000. Ignored unless at least one question sets free_form_reply: true. Defaults to 500. |
output_steering | object | Curated controls that optionally restrict question answering to an asset time range. |
questions[]
| Field | Type | Description |
|---|---|---|
question | string | Required. The question to ask about the video content. Maximum 600 characters. |
answer_options | array of string | 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. |
free_form_reply | boolean | 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. |
output_steering
| Field | Type | Description |
|---|---|---|
scope | object | Optional execution window in seconds on the original asset timeline. Omit start_time to begin at the asset start and omit end_time to continue through the asset end. Answers are generated only from media within this window, while returned timestamps remain absolute asset timestamps. At least one of start_time and end_time is required, and start_time must be less than end_time. An end_time past the end of the media is clamped to it, and a window that starts at or after the end of the media is rejected. |
output_steering.scope
| Field | Type | Description |
|---|---|---|
start_time | number | Start of the execution window in seconds from the beginning of the media. When omitted, the window starts at the beginning. |
end_time | number | End of the execution window in seconds from the beginning of the media. When omitted, the window extends to the end. Greater than 0. |
All questions are evaluated in a single model call.
The outputs object is included in the job once its status is completed. You'll receive it on the robots.v1.job.ask_questions.completed webhook (recommended), or you can fetch it with GET /robots/v1/jobs/ask-questions/{JOB_ID}. It contains:
| Field | Type | Description |
|---|---|---|
answers | array of object | Required. One answer per question, in the same order as the input questions. |
answers[]
| Field | Type | Description |
|---|---|---|
question | string | Required. The original question that was asked. |
answer | string or null | Required. For enum questions, constrained to one of the provided answer_options. For free-form questions, responds with prose up to max_free_form_answer_length characters - treat as untrusted model output. Null when the question was skipped. |
confidence | number | Required. Confidence score from 0.0 to 1.0. Values above 0.9 indicate clear, unambiguous evidence; 0.7-0.9 strong evidence with minor ambiguity; 0.5-0.7 moderate evidence; below 0.5 weak or uncertain evidence. Always 0 when skipped. |
reasoning | string | Required. Explanation citing specific visual or audio evidence from the video, or why the question was skipped. |
skipped | boolean | Required. Whether the question was skipped due to irrelevance to the video content. |
Confidence scores give you a signal for how certain the AI is: values above 0.9 indicate clear, unambiguous evidence; 0.7-0.9 strong evidence with minor ambiguity; 0.5-0.7 moderate evidence; below 0.5 weak or uncertain evidence.
Questions can be skipped if the AI determines the question is not relevant to the video content. When a question is skipped, answer is null, skipped is true, and confidence is 0. Your code should handle skipped answers — see the example response below.
This example uses a five-minute asset and three questions, consuming 1,050 units. It is the job delivered in the robots.v1.job.ask_questions.completed webhook's data field and returned by GET /robots/v1/jobs/ask-questions/{JOB_ID}:
{
"data": {
"id": "rjob_jkl012",
"workflow": "ask-questions",
"status": "completed",
"units_consumed": 1050,
"created_at": 1746403200,
"updated_at": 1746403260,
"parameters": {
"asset_id": "YOUR_ASSET_ID",
"questions": [
{ "question": "Does this video contain a product demonstration?", "answer_options": ["yes", "no"] },
{ "question": "Is the speaker using a presentation?", "answer_options": ["yes", "no"] },
{ "question": "What programming language is shown?", "answer_options": ["python", "javascript", "go", "other"] }
]
},
"outputs": {
"answers": [
{
"question": "Does this video contain a product demonstration?",
"answer": "yes",
"skipped": false,
"confidence": 0.95,
"reasoning": "The video shows a screen recording of a product interface with the speaker walking through features and clicking through different screens."
},
{
"question": "Is the speaker using a presentation?",
"answer": "no",
"skipped": false,
"confidence": 0.88,
"reasoning": "The video shows a live product demo and code editor rather than a slide deck."
},
{
"question": "What programming language is shown?",
"answer": null,
"skipped": true,
"confidence": 0,
"reasoning": "No code or programming language is visible in the video."
}
]
}
}
}The answer_options field lets you constrain answers to any set of values, making it easy to build classification and routing logic. The default is ["yes", "no"], but you can use any set of strings. Since answer_options is specified per question, you can use different options for different questions in the same job.
Classify production quality:
{
"parameters": {
"asset_id": "YOUR_ASSET_ID",
"questions": [
{ "question": "What is the production quality of this video?", "answer_options": ["professional", "semi-professional", "amateur"] }
]
}
}Auto-categorize uploads for a video library:
{
"parameters": {
"asset_id": "YOUR_ASSET_ID",
"questions": [
{ "question": "What type of content is this video?", "answer_options": ["tutorial", "interview", "product-demo", "vlog", "other"] }
]
}
}