Skip to content
HALOWERK

Text Tools

icu sentence prefix under byte budget

Sentence excerpt returns the longest complete sentence prefix within a UTF-8 byte budget. Use it when an agent needs a bounded excerpt that ends at a sentence boundary.

POST https://text.halowerk.com/v1/icu-sentence-prefix-under-byte-budget

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
textstringYes
localestringNo
max_bytesintegerYes
Show full input schema
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "maxLength": 7000,
      "minLength": 1
    },
    "locale": {
      "type": "string",
      "maxLength": 45,
      "minLength": 1
    },
    "max_bytes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 28000
    }
  },
  "required": [
    "text",
    "max_bytes"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "text": "Operating systems. Library management system.",
  "locale": "en",
  "max_bytes": 26
}

Result & documentation

Show published result schema
{
  "type": "object",
  "required": [
    "measured_at",
    "source",
    "data",
    "limitations"
  ],
  "properties": {
    "measured_at": {
      "type": "string"
    },
    "source": {
      "type": "object",
      "required": [
        "reference",
        "retrieved_at"
      ],
      "properties": {
        "reference": {
          "type": "string"
        },
        "retrieved_at": {
          "type": "string"
        }
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "excerpt": {
          "type": "string"
        },
        "included_sentences": {
          "type": "integer"
        },
        "used_bytes": {
          "type": "integer"
        },
        "omitted_sentences": {
          "type": "integer"
        }
      },
      "required": [
        "excerpt",
        "included_sentences",
        "used_bytes",
        "omitted_sentences"
      ]
    },
    "limitations": {
      "type": "string"
    }
  }
}

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-20 UTC.

More endpoints in this hub

All endpoints in this hub →