Catalog/rag-chunk-by-sentences

Retrieval

Chunk text by sentences API

Splits text at sentence boundaries and packs sentences up to a character budget, preserving sentence integrity. Answers 'How do I chunk text by sentences?', 'How do I split docs without cutting sentences?'.

Price$0.02per request
MethodPOST
Route/v1/retrieval/chunk-by-sentences
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
chunksentencessplitragingestionnlpboundarytext
API URLhttps://x402.hexl.dev/v1/retrieval/chunk-by-sentences
Integration docs
Example request
{
  "text": "First sentence. Second one. Third here.",
  "maxChars": 25
}
Example response
{
  "maxChars": 25,
  "sentenceCount": 3,
  "chunkCount": 2,
  "chunks": [
    {
      "index": 0,
      "text": "First sentence.",
      "charCount": 15,
      "sentenceCount": 1
    },
    {
      "index": 1,
      "text": "Second one. Third here.",
      "charCount": 23,
      "sentenceCount": 2
    }
  ]
}
Input schema
{
  "type": "object",
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string"
    },
    "maxChars": {
      "type": "integer"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}