> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# [YT2] Generate YouTube Script

> Generates a production-ready YouTube script for a given topic.



## OpenAPI

````yaml /api-reference/v1/v1.1.0_openapi.json post /action/youtube_script_writer_generate_youtube_script_action
openapi: 3.0.0
info:
  version: 1.1.0
  title: AI Actions - Get Data
  description: API specifications for 'Get Data' category AI actions.
  license:
    name: MIT
servers:
  - url: https://api-lr.agent.ai/v1
security:
  - bearerAuth: []
paths:
  /action/youtube_script_writer_generate_youtube_script_action:
    post:
      tags:
        - YouTube Creator Team
      summary: '[YT2] Generate YouTube Script'
      description: Generates a production-ready YouTube script for a given topic.
      operationId: youtubeScriptWriterGenerateYoutubeScriptAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                topic:
                  type: string
                video_format:
                  type: string
                  enum:
                    - tutorial
                    - listicle
                    - opinion
                    - case_study
                    - product_demo
                  default: tutorial
                target_length:
                  type: string
                  enum:
                    - short
                    - medium
                    - long
                  default: medium
                script_detail_level:
                  type: string
                  enum:
                    - full_script
                    - talking_points
                  default: full_script
                angle_hook:
                  type: string
                target_audience:
                  type: string
                key_points:
                  type: string
                  x-ui: textarea
                tone_of_voice:
                  type: string
                  enum:
                    - conversational
                    - professional
                    - energetic
                    - friendly
                  default: conversational
                output_variable_name:
                  type: string
                  description: Variable name for the result.
                  default: youtube_script
                  pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
              required:
                - topic
                - video_format
                - target_length
                - script_detail_level
                - output_variable_name
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '401':
          description: Unauthorized - invalid or missing bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
components:
  schemas:
    ActionResponse:
      type: object
      properties:
        status:
          type: integer
          format: int32
          description: HTTP status code of the action response
        response:
          type: object
          description: Response data from the action
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from your account
        ([https://agent.ai/user/integrations#api](https://agent.ai/user/integrations#api))

````