Segmenter
Free API for segmenting long text into chunks and tokenization.
Segmenter API
Our Segmenter API is crucial for helping LLMs manage input within context limits, and optimizing model performance. It allows developers to count tokens and extract relevant text segments, ensuring efficient data processing and cost management.
chevron_leftchevron_right
Use GET request to count tokens
Use POST request for more features
Return the last N tokens
Segmenter
cl100k_base
arrow_drop_down
upload
Request
Bash
Language
arrow_drop_down
curl -X POST 'https://segment.jina.ai/' \
-H "Content-Type: application/json" \
-d @- <<EOFEOF
{
"content": "\n Jina AI: Your Search Foundation, Supercharged! 🚀\n Ihrer Suchgrundlage, aufgeladen! 🚀\n 您的搜索底座,从此不同!🚀\n 検索ベース,もう二度と同じことはありません!🚀\n"
}
EOFEOF
key
API key
Available tokens
0
What is a Segmenter?
A segmenter is a crucial component that converts text into tokens or chunks, which are the basic units of data that an embedding/reranker model or LLM processes. Tokens can represent whole words, parts of words, or even individual characters.
Input text
Chunking long documents, lightning fast!
You can also use Segmenter API to cut long documents into smaller chunks, making it easier to process them in embeddings or rerankers. We leverage common structural cues and build a set of rules and heuristics which perform well across diverse types of content, e.g. Markdown, HTML, LaTeX and CJK languages.
Input text
Maximum number of characters in each chunk. In practice the chunk length can be smaller than this value, if there is a good boundary in the text.
0 chunks in total
Segmenter API is free!
By providing your API key, you can access a higher rate limit, and your key won't be charged.
Rate Limit
Columns
arrow_drop_down
Product | API Endpoint | Descriptionarrow_upward | w/o API Key | w/ API Key | w/ Premium API Key | Average Latency | Token Usage Counting | Allowed Request | |
---|---|---|---|---|---|---|---|---|---|
Embedding API | https://api.jina.ai/v1/embeddings | Convert text/images to fixed-length vectors | block | 500 RPM & 1,000,000 TPM | 2,000 RPM & 5,000,000 TPM | bolt depends on the input size help | Count the number of tokens in the input request. | POST | |
Reranker API | https://api.jina.ai/v1/rerank | Tokenize and segment long text | block | 500 RPM & 1,000,000 TPM | 2,000 RPM & 5,000,000 TPM | bolt depends on the input size help | Count the number of tokens in the input request. | POST | |
Reader API | https://r.jina.ai | Convert URL to LLM-friendly text | 20 RPM | 200 RPM | 1000 RPM | 4.6s | Count the number of tokens in the output response. | GET/POST | |
Reader API | https://s.jina.ai | Search the web and convert results to LLM-friendly text | block | 40 RPM | 100 RPM | 8.7s | Count the number of tokens in the output response. | GET/POST | |
Reader API | https://g.jina.ai | Grounding a statement with web knowledge | block | 10 RPM | 30 RPM | 22.7s | Count the total number of tokens in the whole process. | GET/POST | |
Classifier API (Zero-shot) | https://api.jina.ai/v1/classify | Classify inputs using zero-shot classification | block | 200 RPM & 500,000 TPM | 1,000 RPM & 3,000,000 TPM | bolt depends on the input size | Tokens counted as: input_tokens + label_tokens | POST | |
Classifier API (Few-shot) | https://api.jina.ai/v1/classify | Classify inputs using a trained few-shot classifier | block | 20 RPM & 200,000 TPM | 60 RPM & 1,000,000 TPM | bolt depends on the input size | Tokens counted as: input_tokens | POST | |
Classifier API | https://api.jina.ai/v1/train | Train a classifier using labeled examples | block | 20 RPM & 200,000 TPM | 60 RPM & 1,000,000 TPM | bolt depends on the input size | Tokens counted as: input_tokens × num_iters | POST | |
Segmenter API | https://segment.jina.ai | Tokenize and segment long text | 20 RPM | 200 RPM | 1,000 RPM | 0.3s | Token is not counted as usage. | GET/POST |
Rate Limit
Columns
arrow_drop_down
Product | API Endpoint | Descriptionarrow_upward | w/o API Key | w/ API Key | w/ Premium API Key | Average Latency | Token Usage Counting | Allowed Request | |
---|---|---|---|---|---|---|---|---|---|
Embedding API | https://api.jina.ai/v1/embeddings | Convert text/images to fixed-length vectors | block | 500 RPM & 1,000,000 TPM | 2,000 RPM & 5,000,000 TPM | bolt depends on the input size help | Count the number of tokens in the input request. | POST | |
Reranker API | https://api.jina.ai/v1/rerank | Tokenize and segment long text | block | 500 RPM & 1,000,000 TPM | 2,000 RPM & 5,000,000 TPM | bolt depends on the input size help | Count the number of tokens in the input request. | POST | |
Reader API | https://r.jina.ai | Convert URL to LLM-friendly text | 20 RPM | 200 RPM | 1000 RPM | 4.6s | Count the number of tokens in the output response. | GET/POST | |
Reader API | https://s.jina.ai | Search the web and convert results to LLM-friendly text | block | 40 RPM | 100 RPM | 8.7s | Count the number of tokens in the output response. | GET/POST | |
Reader API | https://g.jina.ai | Grounding a statement with web knowledge | block | 10 RPM | 30 RPM | 22.7s | Count the total number of tokens in the whole process. | GET/POST | |
Classifier API (Zero-shot) | https://api.jina.ai/v1/classify | Classify inputs using zero-shot classification | block | 200 RPM & 500,000 TPM | 1,000 RPM & 3,000,000 TPM | bolt depends on the input size | Tokens counted as: input_tokens + label_tokens | POST | |
Classifier API (Few-shot) | https://api.jina.ai/v1/classify | Classify inputs using a trained few-shot classifier | block | 20 RPM & 200,000 TPM | 60 RPM & 1,000,000 TPM | bolt depends on the input size | Tokens counted as: input_tokens | POST | |
Classifier API | https://api.jina.ai/v1/train | Train a classifier using labeled examples | block | 20 RPM & 200,000 TPM | 60 RPM & 1,000,000 TPM | bolt depends on the input size | Tokens counted as: input_tokens × num_iters | POST | |
Segmenter API | https://segment.jina.ai | Tokenize and segment long text | 20 RPM | 200 RPM | 1,000 RPM | 0.3s | Token is not counted as usage. | GET/POST |
Segmenter-related common questions
How much does the Segmenter API cost?
keyboard_arrow_down
If I don't provide an API key, what is the rate limit?
keyboard_arrow_down
If I provide an API key, what is the rate limit?
keyboard_arrow_down
Will you charge the tokens from my API key?
keyboard_arrow_down
Does the Segmenter API support multiple languages?
keyboard_arrow_down
What is the difference between GET and POST requests?
keyboard_arrow_down
What is the maximum length I can tokenize per request?
keyboard_arrow_down
How does the chunking feature work? Is it semantic chunking?
keyboard_arrow_down
How do you handle special tokens such as 'endoftext' in the Segmenter API?
keyboard_arrow_down
Does chunking support other languages than English?
keyboard_arrow_down
API-related common questions
code
Can I use the same API key for embedding, reranking, reader, fine-tuning APIs?
keyboard_arrow_down
code
Can I monitor the token usage of my API key?
keyboard_arrow_down
code
What should I do if I forget my API key?
keyboard_arrow_down
code
Do API keys expire?
keyboard_arrow_down
code
Why is the first request for some models slow?
keyboard_arrow_down
code
Is user input data used for training your models?
keyboard_arrow_down
Billing-related common questions
attach_money
Is billing based on the number of sentences or requests?
keyboard_arrow_down
attach_money
Is there a free trial available for new users?
keyboard_arrow_down
attach_money
Are tokens charged for failed requests?
keyboard_arrow_down
attach_money
What payment methods are accepted?
keyboard_arrow_down
attach_money
Is invoicing available for token purchases?
keyboard_arrow_down