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

# Generate AI Template

> Generate a private template with AI Engine



## OpenAPI

````yaml post /v1/template/ai
openapi: 3.1.0
info:
  title: PDCP API
  version: '1.0'
  summary: ProjectDiscovery Cloud Platform
  description: >-
    For more details, checkout
    https://docs.projectdiscovery.io/api-reference/editor/scan
servers:
  - url: https://api.projectdiscovery.io
    description: Production
  - url: https://api.dev.projectdiscovery.io
    description: Development
  - url: http://localhost:8085
    description: Localhost
security:
  - X-API-Key: []
paths:
  /v1/template/ai:
    post:
      tags:
        - templates
      summary: Generate AI Template
      description: Generate a private template with AI Engine
      operationId: post-v1-template-ai
      parameters:
        - schema:
            type: string
          in: header
          description: >-
            Retrieve the Team ID from:
            https://cloud.projectdiscovery.io/settings/team
          name: X-Team-Id
      requestBody:
        $ref: '#/components/requestBodies/GenerateTemplateRequest'
      responses:
        '200':
          $ref: '#/components/responses/GenerateTemplateResponse'
        '400':
          $ref: '#/components/responses/MessageResponse'
        '401':
          $ref: '#/components/responses/MessageResponse'
        '403':
          $ref: '#/components/responses/MessageResponse'
        '500':
          $ref: '#/components/responses/MessageResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
      security:
        - X-API-Key: []
components:
  requestBodies:
    GenerateTemplateRequest:
      content:
        application/json:
          schema:
            type: object
            required:
              - prompt
            properties:
              prompt:
                type: string
              retest:
                type: boolean
              disableAutoSave:
                type: boolean
                default: false
              images:
                type: array
                items:
                  type: string
  responses:
    GenerateTemplateResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            required:
              - message
            properties:
              template_id:
                type: string
              message:
                type: string
              completion:
                type: string
              name:
                type: string
              canRun:
                type: boolean
              comment:
                type: string
              is_valid:
                type: boolean
              retry_count:
                type: integer
              feedback:
                type: string
              targets:
                type: array
                items:
                  type: string
              retest:
                type: array
                items:
                  type: object
                  properties:
                    target:
                      type: string
                    matched:
                      type: boolean
                    vuln_id:
                      type: string
    MessageResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            required:
              - message
    ErrorResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            required:
              - message
            properties:
              message:
                type: string
              kind:
                type: string
              code:
                type: string
              error:
                type: string
              error_id:
                type: string
              param:
                type: string
              status:
                type: integer
  securitySchemes:
    X-API-Key:
      name: X-API-Key
      type: apiKey
      in: header

````