Documentation Index Fetch the complete documentation index at: https://docs.thig.ai/llms.txt
Use this file to discover all available pages before exploring further.
Chat & PRD Generation API
General AI Chat
Conversational AI endpoint that resolves the best available provider (BYOK → org key → platform key).
Body:
Field Type Required Description messagesarray Yes Array of {role, content} message objects providerstring No Force a specific provider (openai, anthropic, gemini) projectIdstring No Associate with a project for context
curl -X POST https://app.thig.ai/api/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "What sections should a good PRD include?"}
],
"provider": "anthropic"
}'
Response:
{
"role" : "assistant" ,
"content" : "Based on your requirements, I'd recommend..."
}
Project Chat
POST /api/projects/{projectId}/chat
Non-streaming chat within a project context. Saves QA pairs to the project.
Body:
Field Type Required Description messagestring Yes User message conversationHistoryarray No Previous messages for context
curl -X POST https://app.thig.ai/api/projects/proj_123/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "The app should support offline mode and push notifications"}'
Response:
{
"response" : "Great, let me ask about your target users..." ,
"qaPairId" : "qa_123"
}
Streaming Conversation
POST /api/projects/{projectId}/conversation/stream
SSE streaming endpoint for the conversational PRD builder.
Body: Same as Project Chat.
SSE Events:
data: {"type": "progress", "phase": "Analyzing your requirements...", "percent": 15}
data: {"type": "content", "content": "Based on what you've described..."}
data: {"type": "done", "fullContent": "Complete response text..."}
curl
JavaScript (EventSource)
curl -X POST https://app.thig.ai/api/projects/proj_123/conversation/stream \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{"message": "Users need to collaborate in real-time"}'
Generate PRD (Non-Streaming)
Generate a complete PRD from the project’s QA pairs.
Body:
Field Type Required Description projectIdstring Yes Project to generate PRD for stylestring No PRD style (comprehensive, technical, business, lean, agile) regenerateboolean No Force regeneration
curl -X POST https://app.thig.ai/api/generate-prd \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"projectId": "proj_123", "style": "comprehensive"}'
Generate PRD (Streaming)
POST /api/generate-prd/stream
SSE streaming PRD generation. Same body as non-streaming.
SSE Events:
data: {"type": "progress", "phase": "Generating Executive Summary...", "percent": 10}
data: {"type": "content", "content": "# Executive Summary\n\n..."}
data: {"type": "done", "fullContent": "Complete PRD content..."}
data: {"type": "error", "message": "Generation failed", "code": "GENERATION_ERROR"}
curl -N -X POST https://app.thig.ai/api/generate-prd/stream \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{"projectId": "proj_123", "style": "technical"}'
Chat Export
GET /api/projects/{projectId}/chat-export
Export the conversation history.
Query Parameters:
Parameter Type Description formatstring pdf, csv, or json
curl -G https://app.thig.ai/api/projects/proj_123/chat-export \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "format=json" \
-o chat-history.json
Returns the file directly as a download.