API Reference

PRD Studio exposes a small OpenAI-compatible HTTP API. Point any client, script or agent at the base URL and send plain JSON.

All endpoints return JSON. Requests are rate-limited per IP. No API key required while in beta.

Base URL

Every request starts here. Paths are appended to this host.

https://prd.haaviq.dev

No authentication header is required during the beta. Send Content-Type: application/json with a JSON body.

Quickstart

Generate a complete PRD in one request.

# generate a PRD
curl -X POST https://prd.haaviq.dev/api/generate \\
  -H "Content-Type: application/json" \\
  -d '{
    "name": "Scrapling",
    "description": "AI web scraping platform that turns any site into structured data",
    "template": "Web App"
  }'

The response contains a single markdown field with the full document.

{ "markdown": "## 1. Overview & Goals\n\n..." }

Endpoints

POST/api/suggest

Propose a description, feature list, target users and tech stack from an app name. Useful to pre-fill the studio form.

FieldTypeDescription
titlestringRequired. The app or product name.
templatestringOptional. One of Mobile App, Web App, API Service, SaaS Product, Game, IoT.
curl -X POST https://prd.haaviq.dev/api/suggest \\
  -H "Content-Type: application/json" \\
  -d '{ "title": "Scrapling", "template": "Web App" }'

# response
{
  "description": ["..."],
  "features":    ["...", "..."],
  "users":       ["..."],
  "tech_stack":  ["..."]
}

POST/api/generate

Return a full product requirements document covering nine sections: overview, architecture, API, database and ERD, AI prompt design, security, testing, deployment and roadmap.

FieldTypeDescription
namestringRequired. Product name.
descriptionstringRequired. What the product does.
featuresstringOptional. One feature per line.
usersstringOptional. Target users.
techstringOptional. Preferred stack.
templatestringOptional. Product type.
curl -X POST https://prd.haaviq.dev/api/generate \\
  -H "Content-Type: application/json" \\
  -d '{
    "name": "Scrapling",
    "description": "AI web scraping platform",
    "features": "bulk scrape\nexport CSV",
    "template": "Web App"
  }'

# response
{ "markdown": "## 1. Overview & Goals ..." }

POST/api/diagram

Generate an architecture diagram (Mermaid) or an entity-relationship diagram (PlantUML). Returns both the diagram source and a rendered image URL.

FieldTypeDescription
kindstringRequired. arch or erd.
namestringRequired. Product name.
descriptionstringRequired. What the product does.
featuresstringOptional. Features to reflect in the diagram.
curl -X POST https://prd.haaviq.dev/api/diagram \\
  -H "Content-Type: application/json" \\
  -d '{ "kind": "arch", "name": "Scrapling", "description": "..." }'

# response
{
  "kind": "arch",
  "code": "flowchart TD ...",
  "svg_url": "https://kroki.io/mermaid/svg/..."
}

GET/api/health

Check that the service is up and see which models are configured.

curl https://prd.haaviq.dev/api/health

# response
{ "ok": true, "ai_configured": true, "models": ["..."] }

Errors

Errors return a JSON object with a detail field.

StatusMeaning
400Missing or invalid input, e.g. no name or description.
429Rate limit reached for your IP. Try again later.
502The upstream model failed or timed out. Retry the request.
{ "detail": "name and description are required" }

Rate limits

The beta is limited to 20 requests per hour per IP across all endpoints. Higher limits are available on request.

Output is AI-generated and may contain errors. Verify anything critical before you rely on it. See the terms.