Summarize
curl --request POST \
--url https://api.scaledown.xyz/summarization/abstractive \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"text": "<string>",
"instructions": "<string>",
"max_tokens": 20048
}
'import requests
url = "https://api.scaledown.xyz/summarization/abstractive"
payload = {
"text": "<string>",
"instructions": "<string>",
"max_tokens": 20048
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: '<string>', instructions: '<string>', max_tokens: 20048})
};
fetch('https://api.scaledown.xyz/summarization/abstractive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scaledown.xyz/summarization/abstractive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'instructions' => '<string>',
'max_tokens' => 20048
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scaledown.xyz/summarization/abstractive"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_tokens\": 20048\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scaledown.xyz/summarization/abstractive")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_tokens\": 20048\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scaledown.xyz/summarization/abstractive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_tokens\": 20048\n}"
response = http.request(request)
puts response.read_body{
"summary": "<string>",
"input_chars": 123,
"output_chars": 123,
"latency_ms": 123
}Summarize
Summarize
Produce an abstractive summary of a block of text.
POST
/
summarization
/
abstractive
Summarize
curl --request POST \
--url https://api.scaledown.xyz/summarization/abstractive \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"text": "<string>",
"instructions": "<string>",
"max_tokens": 20048
}
'import requests
url = "https://api.scaledown.xyz/summarization/abstractive"
payload = {
"text": "<string>",
"instructions": "<string>",
"max_tokens": 20048
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: '<string>', instructions: '<string>', max_tokens: 20048})
};
fetch('https://api.scaledown.xyz/summarization/abstractive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scaledown.xyz/summarization/abstractive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'instructions' => '<string>',
'max_tokens' => 20048
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scaledown.xyz/summarization/abstractive"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_tokens\": 20048\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scaledown.xyz/summarization/abstractive")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_tokens\": 20048\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scaledown.xyz/summarization/abstractive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"instructions\": \"<string>\",\n \"max_tokens\": 20048\n}"
response = http.request(request)
puts response.read_body{
"summary": "<string>",
"input_chars": 123,
"output_chars": 123,
"latency_ms": 123
}Overview
The/summarization/abstractive endpoint condenses text in the model’s own words without adding new information or commentary. Unlike extractive summarization, the output is a fluent rewrite - not a selection of lifted sentences.
Request
string
The input text to summarize. Can be an article, document, transcript, or any plain text string. Either
text or document must be provided. If both are given, the OCR text is appended after text.string
A base64-encoded file to summarize. Supported formats: JPEG, PNG, TIFF, single-page PDF, multi-page PDF. The file is processed via AWS Textract OCR and the extracted text is used as input. Either
text or document must be provided.string
MIME type of the document (e.g.
"image/jpeg", "application/pdf"). Required when document is provided.string
Optional additional rules for the summary. These are appended to the base instructions - they extend, not replace, the default behaviour (no new information, no commentary).Examples:
"Use bullet points.""Focus on financial figures only.""Write in Spanish.""Limit to 3 sentences."
number
default:2048
Maximum number of tokens in the generated summary.
Response
string
The generated summary text.
number
Character count of the input text.
number
Character count of the generated summary.
number
End-to-end request latency in milliseconds.
string | null
The raw text extracted from the document via OCR.
null if no document was provided.Error responses
| Status | Meaning |
|---|---|
422 Unprocessable Entity | Malformed request body, neither text nor document provided, or OCR failed. |
500 Internal Server Error | Inference service unavailable. |
504 Gateway Timeout | Summarization request timed out. |
Authentication
Include your API key in every request using thex-api-key header.
-H "x-api-key: <your-api-key>"
Examples
Basic summary
curl -X POST https://api.scaledown.xyz/summarization/abstractive \
-H "Content-Type: application/json" \
-H "x-api-key: <your-api-key>" \
-d '{
"text": "Your long text here..."
}'
import requests
response = requests.post(
"https://api.scaledown.xyz/summarization/abstractive",
headers={"x-api-key": "<your-api-key>"},
json={
"text": "Your long text here...",
},
)
print(response.json())
const response = await fetch(
"https://api.scaledown.xyz/summarization/abstractive",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "<your-api-key>",
},
body: JSON.stringify({
text: "Your long text here...",
}),
}
);
const data = await response.json();
{
"summary": "The company reported strong Q3 results, approved a share buyback program, and announced plans for Southeast Asian expansion.",
"input_chars": 8340,
"output_chars": 142,
"latency_ms": 3241
}
With instructions
Useinstructions to control format, language, focus area, or length.
curl -X POST https://api.scaledown.xyz/summarization/abstractive \
-H "Content-Type: application/json" \
-H "x-api-key: <your-api-key>" \
-d '{
"text": "Your long text here...",
"instructions": "Use bullet points. Focus on dates and key decisions only.",
"max_tokens": 500
}'
import requests
response = requests.post(
"https://api.scaledown.xyz/summarization/abstractive",
headers={"x-api-key": "<your-api-key>"},
json={
"text": "Your long text here...",
"instructions": "Use bullet points. Focus on dates and key decisions only.",
"max_tokens": 500,
},
)
print(response.json())
const response = await fetch(
"https://api.scaledown.xyz/summarization/abstractive",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "<your-api-key>",
},
body: JSON.stringify({
text: "Your long text here...",
instructions: "Use bullet points. Focus on dates and key decisions only.",
max_tokens: 500,
}),
}
);
const data = await response.json();
{
"summary": "- The company reported Q3 revenue of $4.2B, up 12% year-over-year.\n- The board approved a $500M share buyback program on October 14.\n- CEO announced plans to expand into Southeast Asia by mid-2027.",
"input_chars": 8340,
"output_chars": 198,
"latency_ms": 3241
}
Summarizing a document
Pass a base64-encoded image or PDF in thedocument field. The OCR text is extracted automatically and summarized. The raw OCR output is returned as ocr_text.
DOCUMENT=$(base64 -b 0 -i report.pdf)
curl -X POST https://api.scaledown.xyz/summarization/abstractive \
-H "Content-Type: application/json" \
-H "x-api-key: <your-api-key>" \
-d '{
"document": "'"$DOCUMENT"'",
"document_mime_type": "application/pdf",
"instructions": "Use bullet points. Focus on key figures and decisions only."
}'
import base64
import requests
with open("report.pdf", "rb") as f:
document = base64.b64encode(f.read()).decode()
response = requests.post(
"https://api.scaledown.xyz/summarization/abstractive",
headers={"x-api-key": "<your-api-key>"},
json={
"document": document,
"document_mime_type": "application/pdf",
"instructions": "Use bullet points. Focus on key figures and decisions only.",
},
)
print(response.json())
import fs from "fs";
const document = fs.readFileSync("report.pdf").toString("base64");
const response = await fetch(
"https://api.scaledown.xyz/summarization/abstractive",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "<your-api-key>",
},
body: JSON.stringify({
document,
document_mime_type: "application/pdf",
instructions: "Use bullet points. Focus on key figures and decisions only.",
}),
}
);
const data = await response.json();
{
"summary": "- Q3 revenue reached $4.2B, up 12% year-over-year.\n- Board approved a $500M share buyback program.\n- CEO announced Southeast Asian expansion by mid-2027.",
"input_chars": 12480,
"output_chars": 178,
"latency_ms": 4103,
"ocr_text": "Q3 2024 Earnings Report\nRevenue: $4.2 billion (+12% YoY)\n..."
}
Notes
- The base instructions (no new information, no commentary) are always applied. The
instructionsfield adds on top of them - it does not replace them. - Temperature, top-p, and other sampling parameters are fixed and not configurable via the API.
Authorizations
Body
application/json