API Endpoint
POST Text Summarization API
/api/v1/ai/text-summarize
Condense long-form text, articles, or transcripts into configurable summaries and optionally extract structured data.
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
text |
string | Required | The raw text content to summarize (Max: 25,000 characters). |
length |
string | Optional | Desired summary length: "short", "medium", or "long". Default is "short". |
format |
string | Optional | Output format: "paragraph", "bullet_points", or "key_takeaways". Default is "paragraph". |
target_audience |
string | Optional | Adjust the reading level and tone (e.g., "general", "expert", "5_year_old"). |
extract_schema |
object | Optional | Optional schema definition (JSON object) of exact data points you want extracted from the text. Example: {"company_name":"string", "revenue":"number"} |
custom_instructions |
string | Optional | Optional specific rules to guide the summarization or extraction process. |
model |
string | Optional | Optional AI model to use. |
Example Request (Summarize & Extract)
This endpoint allows you to instantly summarize long texts while safely extracting data simultaneously. The credit cost calculates automatically based on input length.
JSON Request
{
"text": "Acme Corp announced Q3 earnings today of $14.2 Million, representing a 22% increase year over year. The CEO, Jane Doe, stated that the new software division was the primary driver of growth. They plan to hire 200 new engineers next quarter.",
"length": "short",
"format": "bullet_points",
"extract_schema": {
"company_name": "string",
"q3_earnings_millions": "number",
"ceo_name": "string",
"planned_hires": "integer"
}
}
cURL
curl -X POST https://rsflowhub.com/api/v1/ai/text-summarize \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Acme Corp announced Q3 earnings today of $14.2 Million, representing a 22% increase year over year. The CEO, Jane Doe, stated that the new software division was the primary driver of growth. They plan to hire 200 new engineers next quarter.",
"length": "short",
"format": "bullet_points",
"extract_schema": {
"company_name": "string",
"q3_earnings_millions": "number",
"ceo_name": "string",
"planned_hires": "integer"
}
}'
Example Response
The API outputs the requested summary formatting alongside your strictly-typed extracted data.
JSON Response
{
"success": true,
"data": {
"result": {
"summary": [
"Acme Corp Q3 earnings reached $14.2 Million (up 22%).",
"Growth driven by the new software division.",
"Plan to hire 200 new engineers."
],
"original_length": 234,
"summary_length": 139,
"extracted_data": {
"company_name": "Acme Corp",
"q3_earnings_millions": 14.2,
"ceo_name": "Jane Doe",
"planned_hires": 200
}
}
},
"meta": {
"credits_used": 3,
"credits_remaining": 988
}
}
API Request Example
Use the cURL snippet below to test the endpoint.
cURL
curl -X POST 'https://rsflowhub.com/api/v1/ai/text-summarize' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"text": "Acme Corp announced Q3 earnings...",
"format": "bullet_points",
"extract_schema": {
"company_name": "string"
}
}'