Skip to main content

Documentation

Learning Center

Master content moderation with comprehensive guides, tutorials, and API documentation

Document Summarization

Discuse condenses long text or documents into a short summary with POST /api/v2/summarize. Send raw text (up to 100,000 characters) or up to 5 document URLs, and you get back a single plain-language summary — useful for giving human moderators the gist of a long report, ticket, or upload before they read the whole thing.

When is summarization useful?

Moderation queues fill up with long content: support threads, pasted articles, multi-page PDFs, terms-of-service complaints. A reviewer who has to read every word is slow and expensive. A summary lets a moderator triage at a glance — decide what needs a full read and what can be cleared or routed quickly.

How do I summarize content?

Provide either text or file_urls (one is required). With file_urls, Discuse extracts the text from the documents first, then summarizes it.

Summarize raw text

curl -X POST https://api.discuse.com/api/v2/summarize \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "text": "Long support thread or article text here..."
  }'

Summarize documents

curl -X POST https://api.discuse.com/api/v2/summarize \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "file_urls": ["https://example.com/user-report.pdf"]
  }'

Response

{
  "summary": "A user reports repeated harassment from another account over three days, including direct messages and comments. They have screenshots and request the account be reviewed.",
  "usage": {
    "api_requests_used": 87,
    "api_requests_limit": 500,
    "api_requests_remaining": 413
  }
}

Request fields

Field Type Notes
X-API-Key header Required. Your API key; a key in the request body is not accepted
text string Text to summarize, up to 100,000 characters
file_urls string[] Document URLs to read and summarize, up to 5

Provide one of text or file_urls. If you send both, text is used.

Response fields

Field Type Description
summary string The generated summary
usage object api_requests_used, api_requests_limit, api_requests_remaining

Usage limits

Summarization is a paid-plan feature; each summary counts once against your document-summary quota.

Plan Monthly Summaries Overage Rate
Basic Not available -
Gold 100 $0.02/summary
Platinum 500 $0.017/summary (15% discount)
Ultimate 2,000 $0.015/summary (25% discount)

If a project has no active subscription, summarize requests are denied.

Best practices

Summarize to triage, not to decide

A summary is a reading aid for human reviewers, not a moderation verdict. Use it to prioritize the queue, then run the original content through POST /api/v2/check (or moderate during OCR) for the actual policy decision.

Pair with OCR for scanned documents

file_urls already runs OCR before summarizing, so a scanned PDF or an image of text works directly — no separate OCR call needed.

Respect the length cap

text is capped at 100,000 characters. For longer source material, summarize in sections and combine, or pass the document as a URL.

Integration examples

Node.js

async function summarize({ text, fileUrls }) {
  const response = await fetch('https://api.discuse.com/api/v2/summarize', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.DISCUSE_API_KEY
    },
    body: JSON.stringify(text ? { text } : { file_urls: fileUrls })
  });
  return response.json();
}

Python

import os
import requests

def summarize(text=None, file_urls=None):
    payload = {'text': text} if text else {'file_urls': file_urls}
    response = requests.post(
        'https://api.discuse.com/api/v2/summarize',
        headers={
            'Content-Type': 'application/json',
            'X-API-Key': os.environ['DISCUSE_API_KEY']
        },
        json=payload
    )
    return response.json()

Ready to speed up your review queue? Get started with Discuse.

Written by the Discuse Team · Last updated June 2026