---
title: "Generate a site with AI from a prompt"
method: POST
path: "/api/async-tasks/v2/generate-site-with-ai"
tags: ["Async API tasks"]
---

# Generate a site with AI from a prompt

`POST /api/async-tasks/v2/generate-site-with-ai`

## Request

- Base URL: `https://api.duda.co`
- URL: `https://api.duda.co/api/async-tasks/v2/generate-site-with-ai`
- Auth: HTTP basic

Runs the AI planner on the supplied prompt (instructions), then creates the site and generates its pages. Requires business_data and instructions.

## Request body

- GenerateSiteV2RDT
  - `business_data` BusinessDataDTO
    - `category` string
    - `data_controller` string
    - `description` string
    - `logo_alt_text` string
    - `logo_url` string
    - `name` string
    - `service_area` string
    - `tone_of_voice` 'CONVERSATIONAL' | 'HUMOROUS' | 'ENTHUSIASTIC' | 'INFORMATIVE' | 'PROFESSIONAL' | 'WITTY' | 'AUTHORITATIVE'
  - `instructions` string

## Response `200`

OK

- AsyncAPIResponseRDT
  - `created_at` string, date-time
  - `error` TaskErrorRDT
    - `message` string
  - `finished_at` string, date-time
  - `id` string
  - `result` TaskResultRDT
    - `type` string, required
  - `status` 'CREATED' | 'IN_PROGRESS' | 'FAILED' | 'COMPLETED'
  - `type` 'GENERATE_SITE_WITH_AI' | 'GENERATE_SITE_FROM_URL' | 'IMPORT_CONTENT_FROM_URL' | 'CLASSIC_TO_FLEX_MIGRATION'

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `405`: Method Not Allowed
- `429`: Too many requests. The rate limit was exceeded.
- `500`: Internal Server Error

---

[API](https://skmtc.dev/duda/apis/duda-partner-api.md) - [All operations](https://skmtc.dev/duda/apis/duda-partner-api/llms.txt) - [OpenAPI document](https://skmtc.dev/duda/apis/duda-partner-api/revisions/52be4d41cb12?raw)
