Base Path
SummarizeArticle
Generates an LLM summary of news headlines with provider selection and fallback support. Endpoint:POST /api/news/v1/summarize-article
Request Body
string
required
LLM provider:
"ollama", "groq", or "openrouter"string[]
required
Headlines to summarize (max 8 used)
string
Summarization mode:
"brief", "analysis", "translate", or empty string for defaultstring
Geographic signal context to include in the prompt
string
Variant:
"full", "tech", or target language for translate modestring
Output language code (default:
"en")Response
string
The generated summary text
string
Model identifier used for generation
string
Provider that produced the result (or “cache” if from Redis)
bool
Whether the result came from Redis cache
int32
Token count from the LLM response
bool
Whether the client should try the next provider in the fallback chain
bool
Whether this provider was skipped (credentials missing)
string
Human-readable skip/error reason
string
Error message if the request failed
string
Error type/name (e.g., “TypeError”)
Example Request: Brief Summary
Example Response
Example Request: Analysis Mode
Example Response
Example Request: Translation Mode
Example Response
Summarization Modes
Brief Mode
Generates concise 2-3 sentence summaries ideal for quick updates and notifications.Analysis Mode
Produces detailed analytical summaries with context, implications, and strategic assessments. Best for intelligence briefs and deeper understanding.Translate Mode
Translates headlines from source language to target language specified in thevariant field.
Default Mode
Balanced summarization suitable for general news aggregation.Provider Fallback
The service supports automatic fallback between providers:- Ollama: Local LLM deployment (fastest, no API costs)
- Groq: High-performance cloud inference (fast, low cost)
- OpenRouter: Access to premium models like Claude (highest quality)
fallback field will be true, signaling the client to retry with the next provider in the chain.
Caching
Summaries are cached in Redis based on a hash of the request parameters. Cached responses return immediately withcached: true and provider: "cache". Cache TTL is typically 1 hour for brief summaries and 4 hours for analysis mode.