The Summarization API provides multiple endpoints for summarizing text, files, and YouTube videos. Below is a list of available endpoints, along with their request formats and expected responses.
Endpoint:
GET /
Description:
Returns a simple response to verify that the API is running correctly.
Response:
{ "message": "Hello there." }Endpoint:
POST /summarize/video
Description:
Summarizes the content of a YouTube video using either transcript-based extraction (fast but not always available) or audio-based transcription (slower but more accurate).
Request Body:
content.videoUrl: The URL of the YouTube video.options: Optional customization parameters. check Summarization Options & Customization
Example
{
"content": { "videoUrl": "https://www.youtube.com/watch?v=EXAMPLE" },
"options": {
"length": "standard",
"format": "bullet-points",
"model": "openai",
"speed": "fast",
"lang": "english",
"list": true
}
}Response:
summary: The generated summary.transcript: The transcript of the video.videoMetadata: Metadata about the video.audioFilePath: Path to the audio file of the summary (tts).
{
"summary": "...",
"text": "...",
"videoMetadata": {
"title": "...",
"description": "...",
"thumbnailUrl": "..."
},
"audioFilePath": "..."
}Endpoint:
POST /summarize/file
Description:
Extracts text from an uploaded file (PDF, DOCX, TXT) and generates a summary.
Request Headers:
Content-Type: multipart/form-data
Request Body:
options: Optional customization parameters. check Summarization Options & Customization
Example
{
"options": {
"length": "detailed",
"format": "narrative",
"model": "deepseek",
"lang": "english"
}
}Response:
summary: The generated summary.text: The text of the document.
Example
{
"summary": "...",
"text": "..."
}Endpoint:
POST /summarize/text
Description:
Generates a summary from raw text input using AI models.
Request Body:
content.text: The text to summarize.options: Optional customization parameters. check Summarization Options & Customization
Example
{
"content": {
"text": "Machine learning is a subset of artificial intelligence..."
},
"options": {
"length": "detailed",
"format": "narrative",
"model": "deepseek",
"lang": "english"
}
}Response:
summary: The generated summary.text: The text of the document.
{
"summary": "Machine learning is a specialized branch of AI that enables computers to learn..."
}- An API key must be provided in the
Authorizationheader, if the request is from an unauthorized origin:Authorization: Bearer YOUR_API_KEY - If the request comes from an allowed origin, API keys set in
.envcan be used automatically.
Next Steps
- Summarization Customization – Learn how to customize summaries.
- File Storage – Understand how files are stored and managed.