Skip to main content
POST
/
api
/
news
/
v1
/
summarize-article
SummarizeArticle
curl --request POST \
  --url https://api.example.com/api/news/v1/summarize-article \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider": "<string>",
  "headlines": [
    "<string>"
  ],
  "mode": "<string>",
  "geoContext": "<string>",
  "variant": "<string>",
  "lang": "<string>"
}
'
{
  "summary": "<string>",
  "model": "<string>",
  "provider": "<string>",
  "tokens": 123,
  "fallback": true,
  "error": "<string>",
  "errorType": "<string>",
  "status": "SUMMARIZE_STATUS_UNSPECIFIED",
  "statusDetail": "<string>"
}

Body

application/json

SummarizeArticleRequest specifies parameters for LLM article summarization.

provider
string
required

LLM provider: "ollama", "groq", "openrouter"

Minimum string length: 1
headlines
string[]
Minimum array length: 1

Headlines to summarize (max 8 used).

mode
string

Summarization mode: "brief", "analysis", "translate", "" (default).

geoContext
string

Geographic signal context to include in the prompt.

variant
string

Variant: "full", "tech", or target language for translate mode.

lang
string

Output language code, default "en".

Response

Successful response

SummarizeArticleResponse contains the LLM summarization result.

summary
string

The generated summary text.

model
string

Model identifier used for generation.

provider
string

Provider that produced the result (or "cache").

tokens
integer<int32>

Token count from the LLM response.

fallback
boolean

Whether the client should try the next provider in the fallback chain.

error
string

Error message if the request failed.

errorType
string

Error type/name (e.g. "TypeError").

status
enum<string>

SummarizeStatus indicates the outcome of a summarization request.

Available options:
SUMMARIZE_STATUS_UNSPECIFIED,
SUMMARIZE_STATUS_SUCCESS,
SUMMARIZE_STATUS_CACHED,
SUMMARIZE_STATUS_SKIPPED,
SUMMARIZE_STATUS_ERROR
statusDetail
string

Human-readable detail for non-success statuses (skip reason, etc.).