Content Generation
Operations for generating content and managing generation jobs
Creates a new content generation job with advanced parameter handling, direct job processing, and comprehensive validation.
This endpoint supports multiple authentication methods:
API Key authentication via x-api-key header
Session-based authentication
Admin authentication
User ID fallback for backwards compatibility
The endpoint performs comprehensive validation including:
Project ownership verification
Subscription limits checking
Active job conflict detection
File processing and URL generation for research
ID of the project to generate content for
123e4567-e89b-12d3-a456-426614174000
Main generation prompt describing the content to create
Write a comprehensive guide about artificial intelligence
Author name for the document
John Doe
Additional outline instructions or structure guidance
Include sections on history, current applications, and future trends
Whether to include technical diagrams in the content
auto
Possible values: Whether to include table of contents
auto
Possible values: Whether to use web research for content enhancement
auto
Possible values: Desired document length (pages or word count)
10-15 pages
Maximum pages allowed for generation (overrides subscription limits for admins)
50
POST /api/generateWork HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 172
{
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"prompt": "Write a comprehensive guide about artificial intelligence",
"author": "John Doe",
"email": "[email protected]"
}
{
"message": "Job started successfully",
"jobId": "987fcdeb-51a2-43d7-8f9e-123456789abc"
}
Creates and processes a content generation job using the wizard workflow. This endpoint is specifically designed for the wizard interface and includes enhanced parameter handling and direct job processing.
ID of the project to generate content for
Main generation prompt
Author name for the document
Author email address
Additional outline instructions
auto
Possible values: auto
Possible values: auto
Possible values: Desired document length
Maximum pages allowed for generation
POST /api/generateWizardWork HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 253
{
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"prompt": "text",
"author": "text",
"email": "[email protected]",
"outline_text": "text",
"has_technical_diagrams": "auto",
"has_tableofcontents": "auto",
"use_web_research": "auto",
"page_length": "text",
"max_pages": 1
}
{
"message": "Job started successfully",
"jobId": "123e4567-e89b-12d3-a456-426614174000"
}
Processes and formats user prompts using AI to improve clarity and effectiveness. Supports URL research integration and question-answer processing.
The prompt to format and enhance
Associated project ID for file access
POST /api/formatPrompt HTTP/1.1
Host:
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 68
{
"prompt": "text",
"projectId": "123e4567-e89b-12d3-a456-426614174000"
}
{
"formatted_prompt": "text"
}
Downloads the generated content for a completed job as a PDF file
ID of the completed job
GET /api/downloadPdf/{jobId} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
binary
Previews the generated content for a completed job as a PDF in the browser
ID of the completed job
GET /api/previewPdf/{jobId} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
binary