Text Squasher

Text Squasher API

Content

Squeeze your text to fit character/word limits while preserving meaning. Perfect for LinkedIn messages, tweets, and other constrained formats.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

10 requests per minute

Endpoints

1 endpoint available

Overview

Send text plus a length limit and where it will be used, and an AI model rewrites it to fit while keeping the meaning and adjusting the tone for that use. Pick a template for common limits, or pass your own constraints and useCase.

Templates

  • linkedin: under 200 characters, LinkedIn Connection Message
  • tweet: under 280 characters, Tweet (X)
  • email: under 100 characters, Email Subject
  • sms: under 160 characters, SMS Message
  • headline: under 70 characters, News Headline
  • caption: under 2200 characters, Social Media Caption
  • bio: under 160 characters, Bio/Profile Description

Notes

  • constraints and useCase override the template's values. Without a template, both are required.
  • The model usually meets the limit but is not guaranteed to. Check characterCount.
  • Limits: text up to 20,000 characters, constraints and useCase up to 500.
  • Your text is sent to a third-party AI model.
  • This is an AI endpoint: 10 requests per minute and 200 per day per API key.

Endpoints

POST
https://opentools.ca/api/v1/tools/text-squasher
Rewrite text to fit a length limit for a given use

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
text
string
Required
The text to rewrite. 1-20000 characters.
template
string
Enum: linkedin, tweet, email, sms, headline, caption, bio
OptionalPreset that fills in constraints and useCase.
constraints
string
OptionalThe limit to meet, e.g. "under 150 characters" or "max 25 words". Required without a template.
useCase
string
OptionalWhere the text will be used, e.g. "Product page meta description". Required without a template.

Response Example

{
  "success": true,
  "text": "Big news: our app now syncs across all your devices, works offline and loads twice as fast. Update today and see the difference.",
  "characterCount": 128,
  "constraints": "under 280 characters",
  "useCase": "Tweet (X)"
}

Error Codes

400
Invalid JSON or invalid parameters (see details)
401
Missing or invalid API key
403
API key inactive or expired, or request IP not allowed
429
Rate limit exceeded (10 per minute or 200 per day)
500
Internal server error or AI model failure

Code Examples

curl -X POST https://opentools.ca/api/v1/tools/text-squasher \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "We are thrilled to announce that the latest version of our app now syncs across every device you own, keeps working when you are offline, and loads about twice as fast as before.",
    "template": "tweet"
  }'

Ready to get started?

Create an API key to start using the Text Squasher API.

Rather use it in your browser? Open the Text Squasher