Documentation
APIs
Summarization

Summarization

This API is no longer maintained and will soon be deprecated. The end of service is 10 May 2024.

Generates concise summaries of provided texts in a variety of formats to improve understanding and practical use. Designed for ease and adaptability, the Summarization API allows developers to seamlessly incorporate sophisticated text summarization features into their applications. This ensures that users can effortlessly capture the core insights of extensive texts, facilitating a quicker and more effective understanding.

Available models

ModelRelease dateContext LengthDescription
solar-1-mini-summarization2024-03-12 beta16384Solar-based Summarization model with a 16k context limit.

Request

POST https://api.upstage.ai/v1/solar/chat/completions

Parameters

The messages parameter is a list of message objects. In the context of the Summarization API, you will send only one message object for the text to be summarized. This message object’s role must be "user," and its content must exceed 250 characters.

The Summarization API will determine the most suitable format for the summarization result based on the input content. However, users have the option to select the length and format of their summarization result.

Currently, the solar-1-mini-summarization model supports a context limit of 16,384 tokens.

Request headers

Authorization string Required
Authentication token, format: Bearer API_KEY


Request body

messages list Required
A single message object is necessary to submit the text intended for summarization. This object should include two key properties: role and content.

messages[].role string Required
The role property identifies the originator of the message, which needs to be designated as "user."

messages[].content string Required
To proceed with the summarization, the submitted text must contain a minimum of 250 characters.

model string Required
Specifies the name of the model utilized to carry out the text summarization.

Current available model name is solar-1-mini-summarization.

format string Optional
Defines the output format for the summarization. Available options include "paragraph," "bullets," and "auto". Default value is auto.

length string Optional
Determines the summarization's extent, offering choices such as "short," "medium," "long," and "auto". Default value is auto.

temperature float Optional
An optional parameter to set the sampling temperature. The value should lie between 0 and 2. Higher values like 0.8 result in a more random output, whereas lower values such as 0.2 enhance focus and determinism in the output. Default value is 0.7.

Response

Return values

Returns a chat.completion object.

The chat completion object

id string
A unique identifier assigned to the chat completion, with each segment sharing the same ID.

object string
The type of object, consistently designated as chat.completion.

created integer
The creation time of the chat completion, marked by a Unix timestamp in seconds.

model string
A string indicating the version of the model that was utilized for the request.

choices list
An array of choices provided as chat completion outcomes.

choices[].finish_reason string
The reason the model stopped generating tokens. This will be stop if the model hit a natural stop point or a provided stop sequence, length if the maximum number of tokens specified in the request was reached.

choices[].index integer
The index of the choice in the list of choices.

choices[].message object
A chat completion message generated by the model.

choices[].message.content string
The contents of the message.

choices[].message.role string
The role of the author of this message.

choices[].logprobs null
This field is not yet available.

usage object
Usage statistics for the completion request.

usage.completion_tokens integer
Number of tokens in the generated completion.

usage.prompt_tokens integer
Number of tokens in the prompt.

usage.total_tokens integer
Total number of tokens used in the request (prompt + completion).

system_fingerprint null
This field is not yet available.

Example

Request

curl --location 'https://api.upstage.ai/v1/solar/chat/completions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "model": "solar-1-mini-summarization",
  "messages": [
    {
      "role": "user",
      "content": "(Blog post) Introducing Solar Mini : Powerful, Purpose-trained LLM. Welcome to the era of Solar, a pre-trained Large Language Model (LLM) from Upstage. In December 2023, Solar Mini made waves by reaching the pinnacle of the Open LLM Leaderboard of Hugging Face. Using notably fewer parameters, Solar Mini delivers responses comparable to GPT-3.5, but is 2.5 times faster. Let me guide you through how Solar Mini revolutionized the downsizing of LLM models without sacrificing its performance. - Looking into the model :Why we need Smaller LLMs Size became a pivotal factor in integrating Large Language Models (LLMs) into real-world applications. The main advantage of smaller models is their reduced computational time, which boosts responsiveness and efficiency. This translates to lower manpower requirements for optimization, as these LLMs are more straightforward to customize for specific domains and services. Additionally, their compact size enables on-device deployment, facilitating a decentralized approach that brings AI capabilities directly to the user'\''s local device. This not only enhances accessibility but also diminishes the dependence on extensive GPU resources, paving the way for more new and affordable AI solutions. - Compact Size, Mighty Performance Solar Mini is proof that you don'\''t need a large size for exceptional performance. It impressively outshined competitors like Llama2, Mistral 7B, Ko-Alpaca, and KULLM in a range of benchmarks."
    }
  ],
  "format": "bullets",
  "temperature": 0,
  "length": "auto"
}'

Response

Success - HTTP Status 200 OK

{
  "id": "998685e8-58e1-43aa-acde-098118365af5",
  "object": "chat.completion",
  "created": 1710337925,
  "model": "solar-1-mini-summarization",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "* Solar Mini is a powerful, purpose-trained LLM from Upstage.\n* It reached the top of the Open LLM Leaderboard in December 2023.\n* Solar Mini uses fewer parameters than GPT-3.5 but delivers comparable responses and is 2.5 times faster.\n* Smaller models like Solar Mini have reduced computational time, resulting in increased responsiveness and efficiency.\n* They are easier to customize for specific domains and services and can be deployed on local devices, enhancing accessibility and reducing dependence on GPU resources."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 500,
    "completion_tokens": 120,
    "total_tokens": 620
  },
  "system_fingerprint": ""
}

Error - HTTP Status : 400 Bad Request (Reason : content length)

{
    "error": {
        "message": "content must be at least 250 characters. content length provided: 227",
        "type": "invalid_request_error",
        "param": null,
        "code": null
    }
}

Error - HTTP Status : 400 Bad Request (Reason : exceed maximum token)

{
    "error": {
        "message": "summarization could not be completed due to a token limit. please provide a shorter input. prompt tokens: 15977, completion tokens: 408, total tokens: 16385",
        "type": "invalid_request_error",
        "param": null,
        "code": null
    }
}