Skip to main content

Generate Summary

curl -X POST https://api.inspir.uk/api/summarizer/generate \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "[email protected]" \
  -F "length=medium" \
  -F "format=bullets" \
  -F "includeKeyConcepts=true"
Generate an AI-powered summary from uploaded files or text content. Supports optional authentication for saving.

Request

file
file
Upload a single file (PDF, DOCX, or TXT). Max 10MB.
content
string
Text content to summarize. Required if no file uploaded.
length
string
default:"medium"
Summary length: short (2-3 sentences), medium (1 paragraph), or long (2-3 paragraphs)
format
string
default:"bullets"
Output format: bullets or paragraph
includeKeyConcepts
boolean
default:"true"
Extract 5-8 key concepts/terms from the content
title
string
Custom title for the summary. Auto-generated if not provided.

Response

success
boolean
Indicates if the operation was successful
summary
string | string[]
Summary text (string for paragraph format, array for bullets format)
keyConcepts
string[]
List of key concepts extracted from the content
title
string
Title of the summary
wordCount
object
summaryId
string
Summary ID (null if not authenticated)
format
string
Output format used
length
string
Summary length used
{
  "success": true,
  "summary": [
    "Photosynthesis is the process by which plants convert light energy into chemical energy stored in glucose.",
    "The process occurs in chloroplasts and requires carbon dioxide, water, and sunlight.",
    "Oxygen is released as a byproduct, which is essential for most life on Earth."
  ],
  "keyConcepts": [
    "Photosynthesis",
    "Chloroplast",
    "Chlorophyll",
    "Carbon dioxide",
    "Glucose"
  ],
  "title": "Overview of Photosynthesis",
  "wordCount": {
    "original": 1500,
    "summary": 45,
    "reduction": 97
  },
  "summaryId": "550e8400-e29b-41d4-a716-446655440000",
  "format": "bullets",
  "length": "medium"
}

Errors

error
string
Error message
details
string
Additional error details
{
  "error": "Content is required"
}

Get Summary History

curl https://api.inspir.uk/api/summarizer/history \
  -H "Authorization: Bearer YOUR_TOKEN"
Retrieve all summaries for the authenticated user. Returns up to 50 most recent summaries.

Response

success
boolean
Indicates if the operation was successful
summaries
array
{
  "success": true,
  "summaries": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "title": "Overview of Photosynthesis",
      "summary_text": [
        "Photosynthesis is the process by which plants convert light energy into chemical energy.",
        "The process occurs in chloroplasts and requires carbon dioxide, water, and sunlight."
      ],
      "key_concepts": ["Photosynthesis", "Chloroplast", "Glucose"],
      "summary_length": "medium",
      "output_format": "bullets",
      "word_count": {
        "original": 1500,
        "summary": 45
      },
      "created_at": "2024-01-15T10:30:00Z"
    }
  ]
}

Get Summary by ID

curl https://api.inspir.uk/api/summarizer/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN"
Retrieve a specific summary by ID. Access requires authentication and ownership.

Response

success
boolean
Indicates if the operation was successful
summary
object
Complete summary object including original content (truncated to 10,000 characters)
{
  "success": true,
  "summary": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "user_id": "user123",
    "title": "Overview of Photosynthesis",
    "original_content": "Photosynthesis is a process...",
    "summary_text": [
      "Photosynthesis is the process by which plants convert light energy..."
    ],
    "key_concepts": ["Photosynthesis", "Chloroplast"],
    "summary_length": "medium",
    "output_format": "bullets",
    "word_count": {
      "original": 1500,
      "summary": 45
    },
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Errors

{
  "error": "Summary not found"
}

Delete Summary

curl -X DELETE https://api.inspir.uk/api/summarizer/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN"
Permanently delete a summary. Requires ownership.

Response

success
boolean
Indicates if the operation was successful
message
string
Confirmation message
{
  "success": true,
  "message": "Summary deleted successfully"
}

Build docs developers (and LLMs) love