Skip to main content

AI Tools API

All AI tool endpoints use SSE streaming unless noted. They require authentication and are rate-limited.

PRD Coach

POST /api/ai/coach
Get a CPO-level PRD review with scoring. Body:
FieldTypeRequiredDescription
prdContentstringYesPRD content to review
projectNamestringNoProject name for context
projectIdstringNoSave review to project’s stakeholder views
curl -N -X POST https://app.thig.ai/api/ai/coach \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{"prdContent": "# My PRD\n\n## Problem Statement\n...", "projectName": "Mobile App"}'
SSE done payload:
{
  "review": {
    "overallScore": 78,
    "executiveSummary": "...",
    "dimensions": { "clarity": 85, "completeness": 72, ... },
    "strengths": ["..."],
    "improvements": [{ "priority": "high", "suggestion": "..." }],
    "missingSections": ["..."],
    "recommendations": [{ "effort": "low", "impact": "high", "description": "..." }]
  }
}

AI Improvements

List Improvement Types

GET /api/ai/improve
Returns available improvement types.

Apply Improvement (Streaming)

POST /api/ai/improve
Body:
FieldTypeRequiredDescription
contentstringYesText to improve
improvementTypestringYesType: improve_writing, make_concise, add_detail, fix_grammar, make_technical, simplify, add_user_focus, add_metrics
customPromptstringNoCustom improvement instructions
curl -N -X POST https://app.thig.ai/api/ai/improve \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{"content": "The app lets users do stuff with their data.", "improvementType": "improve_writing"}'
Improvement Types:
TypeDescription
improve_writingBetter clarity and flow
make_conciseShorten while preserving meaning
add_detailExpand with specifics
fix_grammarCorrect grammar and spelling
make_technicalAdd technical depth
simplifyPlain language rewrite
add_user_focusCenter on user needs
add_metricsAdd measurable success criteria

AI Suggestions

POST /api/ai/suggestions
Non-streaming. Analyzes PRD and returns 3-5 improvement suggestions. Body:
FieldTypeRequiredDescription
contentstringYesPRD content to analyze
projectNamestringNoProject name
curl -X POST https://app.thig.ai/api/ai/suggestions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "# My PRD\n\n## Problem\nUsers need a faster way to...", "projectName": "Mobile App"}'
Response:
{
  "suggestions": [
    {
      "id": "sug_1",
      "section": "Problem Statement",
      "type": "improvement",
      "title": "Add quantitative data",
      "description": "Consider adding market size or user pain point statistics",
      "severity": "warning"
    }
  ]
}

User Stories (Streaming)

POST /api/ai/user-stories
Body:
FieldTypeRequiredDescription
contentstringYesSource content
sourcestringYesprd, feature, or requirements
projectNamestringNoProject name
projectIdstringNoSave to project’s stakeholder views
curl -N -X POST https://app.thig.ai/api/ai/user-stories \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{"content": "Users can create and share documents", "source": "prd", "projectName": "Docs App"}'

Technical Specs (Streaming)

POST /api/ai/technical-specs
Body:
FieldTypeRequiredDescription
prdContentstringYesPRD content
projectNamestringNoProject name
focusAreasstring[]NoSpecific areas to focus on
projectIdstringNoSave to project
curl -N -X POST https://app.thig.ai/api/ai/technical-specs \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{"prdContent": "# PRD\n\n## Features\n- Real-time sync\n- Offline mode", "focusAreas": ["architecture", "data-model"]}'

Implementation Roadmap

POST /api/ai/roadmap
Non-streaming. Body:
FieldTypeRequiredDescription
prdContentstringYesPRD content
teamSizestringYessmall, medium, or large
methodologystringYesDevelopment methodology
curl -X POST https://app.thig.ai/api/ai/roadmap \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prdContent": "# My PRD\n\n## Features\n- User auth\n- Dashboard\n- Reports",
    "teamSize": "small",
    "methodology": "agile"
  }'

Code Spec (Streaming)

POST /api/ai/code-spec
Generate a developer specification sheet. Body:
FieldTypeRequiredDescription
contentstringYesPRD content
projectIdstringNoAssociate with project
providerstringNoForce AI provider
curl -N -X POST https://app.thig.ai/api/ai/code-spec \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{"content": "# E-commerce PRD\n\n## Features\n- Shopping cart\n- Checkout flow", "provider": "anthropic"}'

Launch Content (Streaming)

POST /api/ai/launch-content
Body:
FieldTypeRequiredDescription
contentstringYesPRD content
contentTypestringYesblog_post, press_release, social_media, email_announcement, demo_script, or changelog
projectIdstringNoAssociate with project
providerstringNoForce AI provider (openai, anthropic, gemini)
curl -N -X POST https://app.thig.ai/api/ai/launch-content \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "content": "# SaaS Analytics PRD\n\nReal-time dashboard for tracking...",
    "contentType": "blog_post"
  }'

Wireframe / Diagrams (Streaming)

POST /api/ai/wireframe
Body:
FieldTypeRequiredDescription
contentstringYesPRD content
diagramTypestringYesuser_flow, system_architecture, screen_layout, data_flow, sequence, or journey_map
sectionstringNoFocus on a specific PRD section
projectIdstringNoAssociate with project
curl -N -X POST https://app.thig.ai/api/ai/wireframe \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "content": "# User Management\n\nUsers can register, login, manage profiles...",
    "diagramType": "user_flow",
    "section": "Authentication"
  }'