TopicSummaryRequest

Summarize a set of articles. Provide either a template or custom instructions.

  • The anonymous visitor.

  • Fields to return for each source article.

  • Regenerate and overwrite the cached summary instead of returning a cached result.

  • Output format of the generated summary.

  • Selects the articles to summarize (Elasticsearch query-string syntax (Lucene)). Every matching catalog article — up to max_articles — is included in one summary.

    Examples:

    • "section:\"markets\"" — the markets section
    • "tags:\"interest rates\"" — a topic
    • "section:\"markets\" AND published_at:[NOW-7DAYS TO NOW]" — this week's articles (newsletter)
    • "rating:[4 TO *]" — numeric range
  • Custom instructions for the summary (tone, length, structure…). Provide this or template.

  • Maximum number of matching articles to include in the summary.

  • Per-article relevance filter: each candidate is kept only if it satisfies this (strict LLM check). e.g. "Keep only if interest-rate policy is a primary subject, not a passing mention."

  • Rules the summary must satisfy; it is regenerated up to 3× to meet them. e.g. ["Must be under 200 words", "Each article must be cited"].

  • A built-in summary template. Provide this or instructions.

  • Template applied to every link in the summary — use it to add click-tracking params, e.g. https://example.com{url}?utm_source=newsletter.

  • Hash of user_id/anonymous_id with your Secret API Key — send when calling from the browser with a Publishable key.

  • The signed-in user. Use anonymous_id for visitors.

  • User segment/type, used for rate limiting.

  • Extra articles not in your catalog to include. Prepended before catalog articles and cited identically.