---
title: "Auto-direct a script"
method: POST
path: "/v1/cast/direct"
tags: ["Cast"]
---

# Auto-direct a script

`POST /v1/cast/direct`

## Request

- Base URL: `https://api.pyai.com`
- URL: `https://api.pyai.com/v1/cast/direct`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Preserves non-empty newline-delimited performance units, or splits plain text by sentence, then assigns emotion and intensity to every unit. Requires `cast:render`.

## Request body

- object
  - `text` string, required

## Response `200`

Directed lines.

- CastLine[]
  - `text` string, required
  - `emotion` string, required
  - `intensity` union, required
    - string
    - number

## Other responses

- `400`: Invalid request (bad field, unsupported value)
- `401`: Missing or invalid API key (`code: unauthorized`)
- `403`: Key lacks the required scope or the origin is not allow-listed (`code: forbidden | origin_not_allowed`)

---

[API](https://skmtc.dev/pyai/apis/pyai-api.md) · [All operations](https://skmtc.dev/pyai/apis/pyai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pyai/apis/pyai-api/revisions/271a1539185b?raw)
