---
title: "Generate AI Template"
method: POST
path: "/v1/template/ai"
tags: ["templates"]
---

# Generate AI Template

`POST /v1/template/ai`

Generate a private template with AI Engine

## Headers

- `X-Team-Id` string

## Request body

- object
  - `prompt` string, required
  - `retest` boolean
  - `disableAutoSave` boolean
  - `images` string[]

## Response `200`

Example response

- object
  - `template_id` string
  - `message` string, required
  - `completion` string
  - `name` string
  - `canRun` boolean
  - `comment` string
  - `is_valid` boolean
  - `retry_count` integer
  - `feedback` string
  - `targets` string[]
  - `retest` object[]
    - `target` string
    - `matched` boolean
    - `vuln_id` string

## Other responses

- `400` — Example response
- `401` — Example response
- `403` — Example response
- `500` — Example response
- `default` — Example response

## Changes

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

- **2025-08-13** `c41cd7ae7718` — 12 warning, 10 info
  - removed the optional property `completion` from the response with the `400` status
  - removed the optional property `completion` from the response with the `401` status
  - removed the optional property `completion` from the response with the `403` status
  - removed the optional property `completion` from the response with the `500` status
  - …18 more
- **2024-09-22** `407b73d9ce28` — 1 info
  - added the new optional `header` request parameter `X-Team-Id`
- **2024-01-31** `4f557b176ebd` — 2 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `403`
- **2023-12-06** `35be9c1301b7` — 1 info
  - api tag `templates` added
- **2023-12-05** `5c3748c387f7` — 3 breaking, 11 warning, 9 info
  - the response property `completion` became nullable for the status `200`
  - the response property `name` became nullable for the status `200`
  - the response property `template_id` became nullable for the status `200`
  - deleted the `header` request parameter `X-Team-Id`
  - …19 more

[Change history](https://skmtc.dev/projectdiscovery/apis/pdcp-api/changes/v1/template/ai/post.md)

---

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