Skip to main content

Overview

Summarize is called through the OpenAI-compatible POST /v1/chat/completions endpoint. Set model to summarize (latest) or summarize-1 (pinned version) and send the text as the last user message. The model condenses it in its own words without adding new information or commentary. Unlike extractive summarization, the output is a fluent rewrite - not a selection of lifted sentences. Because the endpoint is OpenAI-compatible, you can point an unmodified OpenAI or OpenRouter SDK at ScaleDown by changing only the base URL and API key.

Request

string
required
"summarize" (always the latest version) or "summarize-1" (pinned to version 1). Both currently behave identically.
array
required
Standard OpenAI chat messages. The last user message is the text to summarize. Any system messages are joined and used as the summary instructions.
number
default:1000
Standard OpenAI field. Maximum number of tokens in the generated summary. Defaults to 1000, which is also the maximum: larger values are capped at 1000, and the model is instructed to finish within the limit. If a summary still hits the limit it is cut off and the parsed result sets finish_reason to "length" with a notice. For a higher output limit, email neal@scaledown.ai.
string
Non-standard extension, passed with the SDK’s extra_body. A base64-encoded file to summarize. Supported formats: JPEG, PNG, TIFF, single-page PDF, multi-page PDF. The text is read from the file and used as input.
string
Non-standard extension, passed with extra_body. MIME type of the document (e.g. "image/jpeg", "application/pdf"). Required when document is provided.
string
Optional top-level override for the input text. When present it takes precedence over the last user message - this lets a batch item body be reused verbatim. Likewise a top-level instructions string takes precedence over system messages.
Temperature, top-p, and other sampling parameters are fixed and not configurable.

Response

A standard chat.completion. The summary result is a JSON string in choices[0].message.content - parse it to read the fields below.
string
Echoes the model you sent (summarize or summarize-1).
object
prompt_tokens is the input tokens billed for the request, completion_tokens the model’s output tokens, and total_tokens their sum.
string
A JSON string with these fields:

Error responses

Authentication

Include your API key in every request using the x-api-key header. Authorization: Bearer <your-api-key> is also accepted, so an OpenAI SDK only needs its api_key set.

Examples

Basic summary

Response:

With instructions

Put format, language, focus area, or length guidance in a system message. It extends, and does not replace, the default behaviour (no new information, no commentary).
The parsed content is:

Summarizing a document

Pass a base64-encoded image or PDF through extra_body (extra_body fields are merged into the top level of the request). The text is extracted automatically and summarized, and the raw extracted text is returned as ocr_text. A message is still required; use a short placeholder user message.

Notes

  • The base instructions (no new information, no commentary) are always applied. System messages add on top of them - they do not replace them.
  • GET /v1/models lists summarize and summarize-1. The bare name always points at the latest version; use summarize-1 to pin.
  • Streaming is not supported; the full result is returned in one response.