GET /v1/chunk-textSplit text into chunks by word/char/sentence/paragraph
Text Utils lf-text-utils
Cuts long text into smaller pieces by words, characters, sentences or paragraphs. Split text into chunks by word/char/sentence/paragraph
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to split |
max_chunk_size | integer | No | Max chunk size |
overlap | integer | No | Overlap size |
mode | string | No | word, char, sentence, or paragraph |
Response Schema
chunks (array): Array of text chunks
total_chunks (integer): Number of chunks
mode (string): Split mode
cURL Example
curl 'https://lf-text-utils.laminarforge.dev/v1/chunk-text?text=<text>' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-text-utils.laminarforge.dev/v1/chunk-text'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'text': '<text>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())