---
title: "Generate shorts script"
method: POST
path: "/api/agent/shorts/script"
tags: ["Shorts"]
---

# Generate shorts script

`POST /api/agent/shorts/script`

## Request body

- ShortsScriptRequest
  - `topic` string, required
  - `product_id` string, uuid
  - `article_id` string, uuid — Optional article ID. When provided, shorts_title, shorts_hashtags, and shorts_script are saved to article metadata.
  - `duration` 'short' | 'long'
  - `requested_duration_seconds` 5 | 10 | 15 — Exact target runtime in seconds. When present, this controls the script word budget.
  - `style` 'hook' | 'educational' | 'cta'
  - `language` string

## Response `200`

Script generated

- ShortsScriptResponse
  - `script` string, required — Voiceover script text (also used as post description)
  - `title` string, required — Catchy video title (max 100 chars), used as YouTube/TikTok title
  - `hashtags` string[], required — 2-3 relevant hashtags with # prefix
  - `word_count` integer, required
  - `estimated_duration_sec` integer, required
  - `parts` string[], required
  - `credits_charged` integer, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `402` — Insufficient credits
- `429` — Rate limit exceeded
- `500` — Internal server error

## Changes

> 28 revisions in range; 1 could not be searched.

- **2026-05-02** `1b40d6cae615` — 1 info
  - added the new optional request property `requested_duration_seconds`
- **2026-03-03** `9cd5ce117b1d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/citedy/apis/citedy-agent-api/changes/api/agent/shorts/script/post.md)

---

[API](https://skmtc.dev/citedy/apis/citedy-agent-api.md) · [All operations](https://skmtc.dev/citedy/apis/citedy-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/citedy/citedy-agent-api/revisions/b5785d3fe446/schema)
