> ## Documentation Index
> Fetch the complete documentation index at: https://heygen-1fa696a7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Decision from text

> Classify messages, transcripts, records, and JSON with HeyGen Decision 1: put the evidence in state and ask named questions about it.

Text is the base of every decision. Put the material to judge in `state` and the judgment you want in each question's `instructions`. A text-only request omits `assets`.

`state` accepts a string, a JSON object, or a JSON array. Objects and arrays are serialized as text and read as one shared state, not as a batch of separate requests.

## Label related material with an object

A string is enough for a single message. Use an object when the decision depends on several pieces, such as a customer message and the policy it is checked against:

```bash theme={null}
curl -X POST https://api.heygen.com/v3/models/decisions \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "heygen-decision-1",
    "state": {
      "message": "Please cancel the extra seat added yesterday.",
      "policy": "Unused seats added within the last seven days can be refunded.",
      "seat_used": false,
      "days_since_purchase": 1
    },
    "questions": {
      "refund_eligible": {
        "type": "noul",
        "instructions": "Does the request meet the refund policy?",
        "criteria": {
          "true": "All requirements for a refund are met by the supplied evidence.",
          "false": "At least one requirement is not met or lacks supporting evidence."
        }
      },
      "intent": {
        "type": "choice",
        "instructions": "What does the customer want?",
        "criteria": {
          "cancel_seat": "Remove a seat or license",
          "cancel_plan": "End the whole subscription",
          "other": "Anything else"
        }
      }
    }
  }'
```

Answers come back in `data.answers` under the same names. [Question types](https://heygen-1fa696a7.mintlify.site/docs/models/heygen-decision.md#question-types) covers each answer's shape.

## Write a state the model can judge

* **Include the content, not a link.** URLs in `state` are read as text; paste the document, page, or transcript you want evaluated.
* **Name the parts.** Keys such as `message`, `policy`, and `history` tell the model what each piece is.
* **Keep one decision per request.** Questions in a request share the same state and run independently. When a question depends on an earlier answer, ask it in a later request.
* **Watch the context budget.** `heygen-decision-1` reads up to 128k tokens per model read, and `heygen-decision-1-turbo` (preview) up to 256k. See [Context limits](https://heygen-1fa696a7.mintlify.site/docs/models/heygen-decision.md#context-limits).

For spoken content, put the transcript in `state`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.