AI Sentence Shortener

Makes shorter the sentences using AI

Endpoint

URL

https://www.capix.uz/v2/shortener/

Method

POST

Headers

Required Headers

  • Content-Type: application/json

  • token: API_KEY

Header Details

  • Content-Type: Specifies the format of the request body. Must be set to application/json.

  • token: A unique API key required to authenticate the request. Replace API_KEY with your actual API token.

Request Body

Format

The request body must be in JSON format.

Parameters

  • sentence: A string containing the text that needs to be shortened. This is the main content to be processed by the sentence shortener tool.

    • Type: string

    • Required: Yes

    • Example: "Struggling with wordy sentences? Want to make your writing crisp and clear? We have got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!"

  • word_count: The desired word count for the shortened sentence. The tool will attempt to reduce the original sentence to this number of words.

    • Type: string

    • Required: Yes

    • Example: "50"

Example Request

{
  "sentence": "Struggling with wordy sentences? Want to make your writing crisp and clear? We have got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!",
  "word_count": "50"
}

Response

Format

The response will be in JSON format.

Success Response

  • Code: 200 OK

  • Content Example:

    {
      "original_sentence": "Struggling with wordy sentences? Want to make your writing crisp and clear? We have got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!",
      "shortened_sentence": "Struggling with wordy sentences? Make your writing crisp and clear with Sentence Shortener, the free tool to cut down extra words. No more long, complicated sentences. Make your writing easy to read and understand in just a few clicks!",
      "word_count": 50
    }

Error Responses

  • Code: 400 Bad Request

    • Content Example:

      {
        "error": "Invalid input data. Ensure 'sentence' is a string and 'word_count' is a valid number."
      }
  • Code: 401 Unauthorized

    • Content Example:

      {
        "error": "Invalid or missing API token."
      }
  • Code: 500 Internal Server Error

    • Content Example:

      {
        "error": "An unexpected error occurred. Please try again later."
      }

Curl Command Example

curl -X POST "https://www.capix.uz/v2/shortener/" \
     -H "Content-Type: application/json" \
     -H "token: YOUR_API_KEY" \
     -d '{
           "sentence": "Struggling with wordy sentences? Want to make your writing crisp and clear? We have got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!",
           "word_count": "50"
         }'

Replace YOUR_API_KEY with your actual API key.

Notes

  • Ensure that your API key is kept secure and not exposed publicly.

  • The word_count parameter must be a string representing a number. Make sure it is set correctly to avoid input validation errors.

  • The sentence provided should be a coherent piece of text to get the best results from the sentence shortener tool.

Last updated