API Reference
Token Chunker
Splits text into chunks based on token count, ensuring each chunk stays within specified token limits.
POST
Authorizations
Your API Key from the Chonkie Cloud dashboard
Body
multipart/form-data
The file to chunk.
Tokenizer to use. Can be a string identifier or a tokenizer instance.
Maximum number of tokens per chunk.
Number or percentage of overlapping tokens between chunks.
Whether to return chunks as Chunk
objects or plain text strings.
Available options:
texts
, chunks
Response
200 - application/json
Successful Response: A list of `Chunk` objects.
The actual text content of the chunk.
The starting character index of the chunk within the original input text.
The ending character index (exclusive) of the chunk within the original input text.
The number of tokens in this specific chunk, according to the tokenizer used.