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
| Field | Type | Required | Description |
|---|---|---|---|
prdContent | string | Yes | PRD content to review |
projectName | string | No | Project name for context |
projectId | string | No | Save 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"}'
const res = await fetch('https://app.thig.ai/api/ai/coach', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prdContent: '# My PRD\n\n## Problem Statement\n...',
projectName: 'Mobile App'
})
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
// Parse SSE lines for progress and content events
for (const line of chunk.split('\n').filter(l => l.startsWith('data: '))) {
const data = JSON.parse(line.slice(6));
if (data.type === 'done') console.log('Review:', data.review);
}
}
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
Apply Improvement (Streaming)
POST /api/ai/improve
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Text to improve |
improvementType | string | Yes | Type: improve_writing, make_concise, add_detail, fix_grammar, make_technical, simplify, add_user_focus, add_metrics |
customPrompt | string | No | Custom 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"}'
const res = await fetch('https://app.thig.ai/api/ai/improve', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: 'The app lets users do stuff with their data.',
improvementType: 'improve_writing'
})
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
let improved = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
for (const line of chunk.split('\n').filter(l => l.startsWith('data: '))) {
const data = JSON.parse(line.slice(6));
if (data.type === 'content') improved += data.content;
}
}
| Type | Description |
|---|---|
improve_writing | Better clarity and flow |
make_concise | Shorten while preserving meaning |
add_detail | Expand with specifics |
fix_grammar | Correct grammar and spelling |
make_technical | Add technical depth |
simplify | Plain language rewrite |
add_user_focus | Center on user needs |
add_metrics | Add measurable success criteria |
AI Suggestions
POST /api/ai/suggestions
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | PRD content to analyze |
projectName | string | No | Project 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"}'
const res = await fetch('https://app.thig.ai/api/ai/suggestions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: '# My PRD\n\n## Problem\nUsers need a faster way to...',
projectName: 'Mobile App'
})
});
const { suggestions } = await res.json();
{
"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
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Source content |
source | string | Yes | prd, feature, or requirements |
projectName | string | No | Project name |
projectId | string | No | Save 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"}'
const res = await fetch('https://app.thig.ai/api/ai/user-stories', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: 'Users can create and share documents',
source: 'prd',
projectName: 'Docs App'
})
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
let stories = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
for (const line of chunk.split('\n').filter(l => l.startsWith('data: '))) {
const data = JSON.parse(line.slice(6));
if (data.type === 'content') stories += data.content;
}
}
Technical Specs (Streaming)
POST /api/ai/technical-specs
| Field | Type | Required | Description |
|---|---|---|---|
prdContent | string | Yes | PRD content |
projectName | string | No | Project name |
focusAreas | string[] | No | Specific areas to focus on |
projectId | string | No | Save 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"]}'
const res = await fetch('https://app.thig.ai/api/ai/technical-specs', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prdContent: '# PRD\n\n## Features\n- Real-time sync\n- Offline mode',
focusAreas: ['architecture', 'data-model']
})
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
let specs = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
for (const line of chunk.split('\n').filter(l => l.startsWith('data: '))) {
const data = JSON.parse(line.slice(6));
if (data.type === 'content') specs += data.content;
}
}
Implementation Roadmap
POST /api/ai/roadmap
| Field | Type | Required | Description |
|---|---|---|---|
prdContent | string | Yes | PRD content |
teamSize | string | Yes | small, medium, or large |
methodology | string | Yes | Development 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"
}'
const res = await fetch('https://app.thig.ai/api/ai/roadmap', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prdContent: '# My PRD\n\n## Features\n- User auth\n- Dashboard\n- Reports',
teamSize: 'small',
methodology: 'agile'
})
});
const { roadmap } = await res.json();
// roadmap contains phases with milestones, tasks, and timeline estimates
Code Spec (Streaming)
POST /api/ai/code-spec
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | PRD content |
projectId | string | No | Associate with project |
provider | string | No | Force 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"}'
const res = await fetch('https://app.thig.ai/api/ai/code-spec', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: '# E-commerce PRD\n\n## Features\n- Shopping cart\n- Checkout flow',
provider: 'anthropic'
})
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
let spec = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
for (const line of chunk.split('\n').filter(l => l.startsWith('data: '))) {
const data = JSON.parse(line.slice(6));
if (data.type === 'content') spec += data.content;
}
}
Launch Content (Streaming)
POST /api/ai/launch-content
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | PRD content |
contentType | string | Yes | blog_post, press_release, social_media, email_announcement, demo_script, or changelog |
projectId | string | No | Associate with project |
provider | string | No | Force 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"
}'
const res = await fetch('https://app.thig.ai/api/ai/launch-content', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: '# SaaS Analytics PRD\n\nReal-time dashboard for tracking...',
contentType: 'blog_post'
})
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
let content = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
for (const line of chunk.split('\n').filter(l => l.startsWith('data: '))) {
const data = JSON.parse(line.slice(6));
if (data.type === 'content') content += data.content;
}
}
Wireframe / Diagrams (Streaming)
POST /api/ai/wireframe
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | PRD content |
diagramType | string | Yes | user_flow, system_architecture, screen_layout, data_flow, sequence, or journey_map |
section | string | No | Focus on a specific PRD section |
projectId | string | No | Associate 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"
}'
const res = await fetch('https://app.thig.ai/api/ai/wireframe', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: '# User Management\n\nUsers can register, login, manage profiles...',
diagramType: 'user_flow',
section: 'Authentication'
})
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
let mermaid = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
for (const line of chunk.split('\n').filter(l => l.startsWith('data: '))) {
const data = JSON.parse(line.slice(6));
if (data.type === 'content') mermaid += data.content;
}
}
// mermaid contains a Mermaid.js diagram string