HeyGen Decision 1 turns text, images, and video into decisions your application can use. Supply text or JSON in state, add optional media in assets, and ask named questions about them. The API returns an answer for each question, with probabilities you can use to route a request, rank a result, or decide when a person should review it.
Choose the question type that matches the answer you need. You can combine all three in one request.
Every request starts from text. Add media in
assets when the decision depends on what something looks like:
Text
Messages, transcripts, records, and JSON.
Image
Up to 4 images with your text.
Video
One video, read from sampled frames.
URLs inside
state are text; the model reads the URL, and fetches media only from assets.The API
Set
model to heygen-decision-1 on every request. heygen-decision-1-turbo is in preview and opens to all API keys soon.
Make a decision
This example classifies a support request, checks whether work is blocked, and rates its impact in one call.Response
data.answers.team.choice to select a support queue. Use the other answers in your own application logic. One question’s answer does not become input to another question in the same request; use a later request when a question depends on an earlier answer.
Parameters
Unknown request and question fields are rejected. There is no top-level
instructions, prompt, temperature, or max_tokens parameter.
For how to shape state, see Text.
Media inputs
Add media underassets.images or assets.videos. Each is an object keyed by names you choose, 1–1,024 characters long. All questions share all supplied media, and any question type works with any input.
The model reads images first, then videos, then state; within each group, inputs follow your request order. Names organize your request and are not shown to the model, so describe each input’s role in state by its order.
Each input page has a worked example: Image and Video.
Choose an asset source
Each named input accepts one of these source objects. You can mix source types in one request.- Uploaded asset: use an
asset_idfrom the asset upload API in the calling workspace. The asset must still exist, match the media group, and be readable by the caller. A generated output’simage_idorvideo_idis not anasset_id. - URL: use a public HTTPS URL that serves the media directly, without authentication or redirects, with a matching
image/*orvideo/*Content-Type. Local file paths and web page URLs are not media inputs. - Base64: provide only the base64-encoded bytes in
data, without adata:prefix. Setmedia_typeto match the file and group, for exampleimage/pngunderimagesorvideo/mp4undervideos.
Media limits
The entire JSON request body must fit within 16 MiB, including state, questions, and encoded media. Base64 adds roughly one third to the file size, so use an uploaded asset or a URL for larger files. Media also consumes the model’s context budget and contributes to
usage.input_tokens.
Question types
Noul: evaluate a yes/no question
Usenoul to test a condition. The answer’s noul value is the model’s estimated probability of true: near 1 favors yes, near 0 favors no, and near 0.5 is uncertain. It does not include a separate confidence field.
You can optionally define what each outcome means:
Noul question
criteria accepts only the keys true and false. Either can be omitted or null to keep its default meaning. A description can be text, a JSON object, or an array. Choose your decision threshold using examples from your application; 0.5 is not a guarantee that an answer is reliable.
Choice: pick a category
criteria is an object containing 1–255 options. Its keys are nonempty option names, and its values describe when to select each option. A description can be text, a JSON object, an array, or null. With null or an empty string, only the option name is shown.
The answer includes:
Make categories distinguishable. If none of your categories may fit, add an explicit option such as
other and describe when it applies. The model chooses among the options you supply; it does not invent another category.
A choice with one option returns that option with probability 1 and confidence 1, without running the model for that question. This is a fixed answer, not a prediction.
Score: rate against ordered levels
criteria is an array of 1–10 level descriptions, ordered from low to high. Each level can be a nonempty string, a JSON object, or an array. Describe an observable condition at each level rather than using labels such as “bad,” “okay,” and “good” without context.
Levels are numbered from zero. Three levels give a score from 0 to 2; five levels give a score from 0 to 4. The answer includes:
In the response above,
0 × 0.05 + 1 × 0.15 + 2 × 0.8 = 1.75. This places the result near the highest-impact level. It does not mean that 87.5% of users are affected. Check the distribution as well as the average: different distributions can produce the same score.
A score with one level returns score: 0, probabilities: {"0": 1}, and confidence: 1, without running the model for that question. Its legend contains that one level.
Read probabilities and confidence
Confidence is derived from the returned distribution. It is not a calibrated probability that the answer is correct, and it is not interchangeable between question types. For a choice with at least two options, letN be the option count and p the highest probability. Confidence is (p - 1/N) / (1 - 1/N), limited to 0–1. Three equal probabilities give confidence 0; a highest probability of 0.8 gives confidence 0.7.
Score confidence also considers how far probability lies from the most likely level. Probability on a neighboring level counts less against confidence than probability far away. Use both the score and its distribution when deciding whether to accept or review a result.
Test thresholds on labeled examples from your own use case. A high value can still be wrong, especially when the state lacks necessary evidence or the criteria overlap. An answer may include a warning; treat it as diagnostic information and review the result before relying on it.
Response fields
All success fields are insidedata.
Context limits
The context budget includes the formatted state, images, sampled video frames, question, criteria, any repeated context or other prompt content, and one reserved answer token. It is not a limit on the raw
state alone. A lower serving-engine limit still applies. Requests that exceed the applicable budget return HTTP 400 with context_length_exceeded; reduce the text or media input rather than retrying the same payload.
The context limit applies to each model read. usage.input_tokens is the total across reads and can exceed that limit. Shared state can be counted more than once when several questions or repeated reads use it, so use the returned count rather than the length of state.
Questions with a single choice option or a single score level are resolved without a model read. A request containing only those fixed questions reports zero input and output tokens, and its media is not fetched or evaluated. API access checks still apply.
Errors and retries
Errors use the standard HeyGen error format, separate from the successdata object.
The default request limit is 50 requests per second, shared by API keys owned by the same user in the same workspace. Keep concurrency bounded and increase it gradually. There is no supported idempotency key for this endpoint: retrying a request may run it again.
Build it with an agent
Paste this into your coding agent to build a small integration:Prompt for your agent

