# Jina AI Search Foundation API's documentation

1. Embeddings API
Endpoint: https://api.jina.ai/v1/embeddings
Purpose: Convert text/images/code to fixed-length vectors
Best for: semantic search, similarity matching, clustering, etc.
Method: POST
Authorization: HTTPBearer
Headers
- **Authorization**: Bearer $JINA_API_KEY
- **Content-Type**: application/json
- **Accept**: application/json

Jina Embeddings Models:
`jina-embeddings-v4` is a 3.8B parameter multimodal and multilingual embedding model supporting text, images, and PDFs with 2048-dimensional output. Best for unified multimodal retrieval and document understanding.
`jina-embeddings-v3` is a 570M parameter multilingual text embedding model with 1024-dimensional output. Optimized for retrieval, classification, and text matching across 100+ languages.
`jina-clip-v2` is a 885M parameter multimodal embedding model with 1024-dimensional output. Best for cross-modal text-image retrieval and zero-shot image classification.

Request body schema for jina-embeddings-v4: {"application/json":{"model":{"type":"string","required":true,"description":"Identifier of the model to use. `jina-embeddings-v4` is a multimodal and multilingual model with a model size of 3.8B and output dimensions of 2048."},"input":{"type":"array","required":true,"description":"Array of input strings or objects to be embedded."},"embedding_type":{"type":"string or array of strings","required":false,"default":"float","description":"The format of the returned embeddings.","options":["float","base64","binary","ubinary"]},"task":{"type":"string","required":false,"description":"Specifies the intended downstream application to optimize embedding output.","options":["retrieval.query","retrieval.passage","text-matching","code.query","code.passage"]},"dimensions":{"type":"integer","required":false,"description":"Truncates output embeddings to the specified size if set."},"late_chunking":{"type":"boolean","required":false,"default":false,"description":"If true, concatenates all sentences in input and treats as a single input for late chunking."},"truncate":{"type":"boolean","required":false,"default":false,"description":"If true, the model will automatically drop the tail that extends beyond the maximum context length allowed by the model instead of throwing an error."},"return_multivector":{"type":"boolean","required":false,"default":false,"description":"If true, the model will return NxD multi-vector embeddings for every document, where N is the number of tokens in the document. Useful for late interaction style retrieval."}}}
Example request1: {"model":"jina-embeddings-v4","input":["Hello, world!"]}
Example request2: {"model":"jina-embeddings-v4","input":[{"text": "Hello, world!"},{"image": "https://i.ibb.co/r5w8hG8/beach2.jpg"},{"image": "iVBORw0KGgoAAAANSUhEUgAAABwAAAA4CAIAAABhUg/jAAAAMklEQVR4nO3MQREAMAgAoLkoFreTiSzhy4MARGe9bX99lEqlUqlUKpVKpVKpVCqVHksHaBwCA2cPf0cAAAAASUVORK5CYII="}]}
Example request3: {"model":"jina-embeddings-v4","input":{"pdf":"https://jina.ai/Jina%20AI%20GmbH_Letter%20of%20Attestation%20SOC%202%20Type%202.pdf"}}
Example response: {"200":{"data":[{"embedding":"..."}],"usage":{"total_tokens":15}},"422":{"error":{"message":"Invalid input or parameters"}}}

Request body schema for jina-embeddings-v3 or jina-clip-v2: {"application/json":{"model":{"type":"string","required":true,"description":"Identifier of the model to use.","options":[{"name":"jina-clip-v2","size":"885M","dimensions":1024},{"name":"jina-embeddings-v3","size":"570M","dimensions":1024}]},"input":{"type":"array","required":true,"description":"Array of input strings or objects to be embedded."},"embedding_type":{"type":"string or array of strings","required":false,"default":"float","description":"The format of the returned embeddings.","options":["float","base64","binary","ubinary"]},"task":{"type":"string","required":false,"description":"Specifies the intended downstream application to optimize embedding output.","options":["retrieval.query","retrieval.passage","text-matching","classification","separation"]},"dimensions":{"type":"integer","required":false,"description":"Truncates output embeddings to the specified size if set."},"normalized":{"type":"boolean","required":false,"default":false,"description":"If true, embeddings are normalized to unit L2 norm."},"late_chunking":{"type":"boolean","required":false,"default":false,"description":"If true, concatenates all sentences in input and treats as a single input for late chunking."},"truncate":{"type":"boolean","required":false,"default":false,"description":"If true, the model will automatically drop the tail that extends beyond the maximum context length allowed by the model instead of throwing an error."}}}
Example request: {"model":"jina-embeddings-v3","input":["Hello, world!"]}
Example response: {"200":{"data":[{"embedding":"..."}],"usage":{"total_tokens":15}},"422":{"error":{"message":"Invalid input or parameters"}}}

Jina Code Embeddings Models:
`jina-code-embeddings-0.5b` (494M) and `jina-code-embeddings-1.5b` (1.54B) are code embedding models built on Qwen2.5-Coder backbone, designed for code retrieval from natural language queries, technical Q&A, and cross-language code similarity. Both support task-specific instructions (NL2Code, TechQA, Code2Code, Code2NL, Code2Completion) and Matryoshka representation learning for flexible embedding truncation.

Request body schema for jina-code-embeddings-0.5b or jina-code-embeddings-1.5b: {"application/json":{"model":{"type":"string","required":true,"description":"Identifier of the model to use.","options":[{"name":"jina-code-embeddings-0.5b","size":"494M"},{"name":"jina-code-embeddings-1.5b","size":"1.54B"}]},"input":{"type":"array","required":true,"description":"Array of input strings to be embedded."},"embedding_type":{"type":"string or array of strings","required":false,"default":"float","description":"The format of the returned embeddings.","options":["float","base64","binary","ubinary"]},"task":{"type":"string","required":false,"description":"Specifies the intended downstream application to optimize embedding output.","options":["nl2code.query","nl2code.passage","code2code.query","code2code.passage","code2nl.query","code2nl.passage","code2completion.query","code2completion.passage","qa.query","qa.passage"]},"dimensions":{"type":"integer","required":false,"description":"Truncates output embeddings to the specified size if set."},"truncate":{"type":"boolean","required":false,"default":false,"description":"If true, the model will automatically drop the tail that extends beyond the maximum context length allowed by the model instead of throwing an error."}}}
Example request1: {"model":"jina-code-embeddings-0.5b","input":["Calculates the square of a number. Parameters: number (int or float) - The number to square. Returns: int or float - The square of the number."], "task": "nl2code.query"}
Example request2: {"model":"jina-code-embeddings-1.5b","input":["import * as ElementPlusIconsVue from '@element-plus/icons-vue'\nconst app = createApp(App)\nfor (const [key, component] of Object.entries(ElementPlusIconsVue)) {\napp.component(key, component)\n}"], "task": "nl2code.passage"}
Example response: {"200":{"data":[{"embedding":"..."}],"usage":{"total_tokens":15}},"422":{"error":{"message":"Invalid input or parameters"}}}

2. Reranker API
Endpoint: https://api.jina.ai/v1/rerank
Purpose: find the most relevant search results
Best for: refining search results, refining RAG (retrieval augmented generation) contextual chunks, etc. 
Method: POST
Authorization: HTTPBearer
Headers
- **Authorization**: Bearer $JINA_API_KEY
- **Content-Type**: application/json
- **Accept**: application/json

Jina Reranker Models:
`jina-reranker-v3` is a 0.6B parameter multilingual document reranker with a novel last-but-not-late interaction architecture. Unlike ColBERT's separate encoding with multi-vector matching, this model performs causal self-attention between query and documents within the same context window, extracting contextual embeddings from the last token of each document.
`jina-reranker-m0` is a 2.4B parameter multimodal reranker that supports both text and image inputs.
`jina-reranker-v2-base-multilingual` is a 278M parameter multilingual text reranker.
`jina-colbert-v2` is a 560M parameter ColBERT-style reranker with multi-vector matching.

Request body schema for jina-reranker-v3 or jina-reranker-v2-base-multilingual or jina-colbert-v2: {"application/json":{"model":{"type":"string","required":true,"description":"Identifier of the model to use.","options":[{"name":"jina-reranker-v3","size":"0.6B"},{"name":"jina-reranker-v2-base-multilingual","size":"278M"},{"name":"jina-colbert-v2","size":"560M"}]},"query":{"type":"string or TextDoc","required":true,"description":"The search query."},"documents":{"type":"array of strings and/or TextDocs","required":true,"description":"A list of text strings or TextDocs to rerank. If a document object is provided, all text fields will be preserved in the response."},"top_n":{"type":"integer","required":false,"description":"The number of most relevant documents or indices to return, defaults to the length of documents."},"return_documents":{"type":"boolean","required":false,"default":true,"description":"If false, returns only the index and relevance score without the document text. If true, returns the index, text, and relevance score."}}}
Example request (v3): {"model":"jina-reranker-v3","query":"slm markdown","documents":["Document to rank 1","Document to rank 2"],"return_documents":false}
Example request (v2/colbert): {"model":"jina-reranker-v2-base-multilingual","query":"Search query","documents":["Document to rank 1","Document to rank 2"]}
Example response (v3): {"model":"jina-reranker-v3","usage":{"total_tokens":2813},"results":[{"index":1,"relevance_score":0.9310624287463884},{"index":0,"relevance_score":0.890233167219021}]}

Request body schema for jina-reranker-m0: {"application/json":{"model":{"type":"string","required":true,"description":"Identifier of the model to use.","value":"jina-reranker-m0"},"query":{"type":"string, TextDoc, or image (URL or base64-encoded string)","required":true,"description":"The search query."},"documents":{"type":"array of objects with keys 'text' and/or 'image'","required":true,"description":"A list of text and/or image documents to rerank. Each document can have 'text' (string) and/or 'image' (URL or base64-encoded string)."},"top_n":{"type":"integer","required":false,"description":"The number of most relevant documents or indices to return, defaults to the length of documents."},"return_documents":{"type":"boolean","required":false,"default":true,"description":"If false, returns only the index and relevance score without the document text. If true, returns the index, text, and relevance score."}}}
Example request (m0): {"model":"jina-reranker-m0","query":"small language model data extraction","documents":[{"image":"https://example.com/image1.png"},{"text":"Document to rank 2"}]}
Example response (m0): {"model":"jina-reranker-m0","usage":{"total_tokens":2829},"results":[{"index":0,"relevance_score":0.9587112551898949},{"index":1,"relevance_score":0.9337408271911014}]}

3. Reader API
Endpoint: https://r.jina.ai/
Purpose: retrieve/parse content from URL in a format optimized for downstream tasks like LLMs and other applications. Use https://eu.r.jina.ai/ to reside all infrastructure and data processing operations entirely within EU jurisdiction.
Best for: extracting structured content from web pages, suitable for generative models and search applications
Method: POST
Authorization: HTTPBearer
Headers
- **Authorization**: Bearer $JINA_API_KEY
- **Content-Type**: application/json
- **Accept**: Use `application/json` to get JSON response, `text/event-stream` to enable stream mode
- **X-Engine** (optional): Specifies the engine to retrieve/parse content. Use `browser` for fetching best quality content, `direct` for speed, `cf-browser-rendering` for experimental engine aimed at JS-heavy websites
- **X-Timeout** (optional): Specifies the maximum time (in seconds) to wait for the webpage to load
- **X-Target-Selector** (optional): CSS selectors to focus on specific elements within the page
- **X-Wait-For-Selector** (optional): CSS selectors to wait for specific elements before returning
- **X-Remove-Selector** (optional): CSS selectors to exclude certain parts of the page (e.g., headers, footers)
- **X-With-Links-Summary** (optional): `all` to gather all links or `true` to gather unique links at the end of the response
- **X-With-Images-Summary** (optional): `all` to gather all images or `true` to gather unique images at the end of the response
- **X-With-Generated-Alt** (optional): `true` to add alt text to images lacking captions
- **X-No-Cache** (optional): `true` to bypass cache for fresh retrieval
- **X-With-Iframe** (optional): `true` to include iframe content in the response
- **X-Return-Format** (optional): `markdown`, `html`, `text`, `screenshot`, or `pageshot` (for URL of full-page screenshot)
- **X-Token-Budget** (optional): Specifies maximum number of tokens to use for the request
- **X-Retain-Images** (optional): Use `none` to remove all images from the response
- **X-Respond-With** (optional): Use `readerlm-v2`, the language model specialized in HTML-to-Markdown, to deliver high-quality results for websites with complex structures and contents.
- **X-Set-Cookie** (optional): Forwards your custom cookie settings when accessing the URL, which is useful for pages requiring extra authentication. Note that requests with cookies will not be cached
- **X-Proxy-Url** (optional): Utilizes your proxy to access URLs, which is helpful for pages accessible only through specific proxies
- **X-Proxy** (optional): Sets country code for location-based proxy server. Use 'auto' for optimal selection or 'none' to disable
- **DNT** (optional): Use `1` to not cache and track the requested URL on our server
- **X-No-Gfm** (optional): Opt in/out features from GFM (Github Flavored Markdown). By default, GFM (Github Flavored Markdown) features are enabled. Use `true` to disable GFM (Github Flavored Markdown) features. Use `table` to Opt out GFM Table but keep the table HTML elements in response
- **X-Locale** (optional): Controls the browser locale to render the page. Lots of websites serve different content based on the locale.
- **X-Robots-Txt** (optional): Defines bot User-Agent to check against robots.txt before fetching content. Websites may allow different behaviors based on the User-Agent.
- **X-With-Shadow-Dom** (optional): Use `true` to extract content from all Shadow DOM roots in the document.
- **X-Base** (optional): Use `final` to follow the full redirect chain.
- **X-Md-Heading-Style** (optional): When to use '#' or '===' to create Markdown headings. Set `atx` to use any number of "==" or "--" characters on the line below the text to create headings.
- **X-Md-Hr** (optional): Defines Markdown horizontal rule format (passed to Turndown). Default is "***".
- **X-Md-Bullet-List-Marker** (optional): Sets Markdown bullet list marker character (passed to Turndown). Options: *, -, +
- **X-Md-Em-Delimiter** (optional): Defines Markdown emphasis delimiter (passed to Turndown). Options: -, *
- **X-Md-Strong-Delimiter** (optional): Sets Markdown strong emphasis delimiter (passed to Turndown). Options: **, __
- **X-Md-Link-Style** (optional): When not set, links are embedded directly within the text. Sets `referenced` to list links at the end, referenced by numbers in the text. Sets `discarded` to replace links with their anchor text.
- **X-Md-Link-Reference-Style** (optional): Sets Markdown reference link format (passed to Turndown). Set to `collapse`, `shortcut` or do not set this header.

Request body schema: {"application/json":{"url":{"type":"string","required":true},"viewport":{"type":"object","required":false,"description":"Sets browser viewport dimensions for responsive rendering.","width":{"type":"number", "required":true},"height":{"type":"number","required":true}},"injectPageScript":{"type":"string","required":false,"description":"Executes preprocessing JS code (inline string or remote URL), for instance manipulating DOMs."}}}
Example cURL request: ```curl -X POST 'https://r.jina.ai/' -H "Accept: application/json" -H "Authorization: Bearer ..." -H "Content-Type: application/json" -H "X-No-Cache: true" -H "X-Remove-Selector: header,.class,#id" -H "X-Target-Selector: body,.class,#id" -H "X-Timeout: 10" -H "X-Wait-For-Selector: body,.class,#id" -H "X-With-Generated-Alt: true" -H "X-With-Iframe: true" -H "X-With-Images-Summary: true" -H "X-With-Links-Summary: true" -d '{"url":"https://jina.ai"}'```
Example response: {"code":200,"status":20000,"data":{"title":"Jina AI - Your Search Foundation, Supercharged.","description":"Best-in-class embeddings, rerankers, LLM-reader, web scraper, classifiers.","url":"https://jina.ai/","content":"Jina AI - Your Search Foundation, Supercharged.\n===============\n","images":{"Image 1":"https://jina.ai/Jina%20-%20Dark.svg"},"links":{"Newsroom":"https://jina.ai/#newsroom","Contact sales":"https://jina.ai/contact-sales"},"usage":{"tokens":1234}}}
Note: Pay attention to the response format of the reader API, the actual content of the page will be available in `response["data"]["content"]`, and links / images (if using "X-With-Links-Summary: true" or "X-With-Images-Summary: true") will be available in `response["data"]["links"]` and `response["data"]["images"]`.

4. Search API
Endpoint: https://s.jina.ai/
Purpose: search the web for information and return results in a format optimized for downstream tasks like LLMs and other applications. Use https://eu.s.jina.ai/ to reside all infrastructure and data processing operations entirely within EU jurisdiction.
Best for: customizable web search with results optimized for enterprise search systems and LLMs, with options for Markdown, HTML, JSON, text, and image outputs
Method: POST
Authorization: HTTPBearer
Headers
- **Authorization**: Bearer $JINA_API_KEY
- **Content-Type**: application/json
- **Accept**: application/json
- **X-Site** (optional): Use "X-Site: <https://specified-domain.com>" for in-site searches limited to the given domain
- **X-With-Links-Summary** (optional): `all` to gather all links or `true` to gather unique links at the end of the response
- **X-With-Images-Summary** (optional): `all` to gather all images or `true` to gather unique images at the end of the response
- **X-Retain-Images** (optional): Use `none` to remove all images from the response
- **X-No-Cache** (optional): "true" to bypass cache and retrieve real-time data
- **X-With-Generated-Alt** (optional): "true" to generate captions for images without alt tags
- **X-Respond-With** (optional): Use `no-content` to exclude page content from the response
- **X-With-Favicon** (optional): `true` to include favicon of the website in the response
- **X-Return-Format** (optional): `markdown`, `html`, `text`, `screenshot`, or `pageshot` (for URL of full-page screenshot)
- **X-Engine** (optional): Specifies the engine to retrieve/parse content. Use `browser` for fetching best quality content or `direct` for speed
- **X-With-Favicons** (optional): `true` to fetch the favicon of each URL in the SERP and include them in the response as image URI, useful for UI rendering.
- **X-Timeout** (optional): Specifies the maximum time (in seconds) to wait for the webpage to load
- **X-Set-Cookie** (optional): Forwards your custom cookie settings when accessing the URL, which is useful for pages requiring extra authentication. Note that requests with cookies will not be cached
- **X-Proxy-Url** (optional): Utilizes your proxy to access URLs, which is helpful for pages accessible only through specific proxies
- **X-Locale** (optional): Controls the browser locale to render the page. Lots of websites serve different content based on the locale.

Request body schema: {"application/json":{"q":{"type":"string","required":true},"gl":{"type":"string","required":false,"description":"The country to use for the search. It's a two-letter country code."},"location":{"type":"string","required":false,"description":"From where you want the search query to originate. It is recommended to specify location at the city level in order to simulate a real user’s search."},"hl":{"type":"string","required":false,"description":"The language to use for the search. It's a two-letter language code."},"num":{"type":"number","required":false,"description":"Sets maximum results returned. Using num may cause latency and exclude specialized result types. Omit unless you specifically need more results per page."},"page":{"type":"number","required":false,"description":"The result offset. It skips the given number of results. It's used for pagination."} }}
Example cURL request: ```curl -X POST 'https://s.jina.ai/' -H "Authorization: Bearer ..." -H "Content-Type: application/json" -H "Accept: application/json" -H "X-No-Cache: true" -H "X-Site: https://jina.ai" -d '{"q":"When was Jina AI founded?"}'```
Example response: {"code":200,"status":20000,"data":[{"title":"Jina AI - Your Search Foundation, Supercharged.","description":"Our frontier models form the search foundation for high-quality enterprise search...","url":"https://jina.ai/","content":"Jina AI - Your Search Foundation, Supercharged...","usage":{"tokens":10475}},{"title":"Jina AI CEO, Founder, Key Executive Team, Board of Directors & Employees","description":"An open-source vector search engine that supports structured filtering...","url":"https://www.cbinsights.com/company/jina-ai/people","content":"Jina AI Management Team...","usage":{"tokens":8472}}]}
Note: Similarly to the reader API, you must pay attention to the response format of the search API, and you must ensure to extract the required content correctly.

5. VLM API
Endpoint: https://api-beta-vlm.jina.ai/v1/chat/completions
Purpose: Vision-language model for image understanding and multimodal chat (OpenAI-compatible API)
Best for: image description, visual question answering, multimodal conversations
Method: POST
Authorization: HTTPBearer
Headers
- **Authorization**: Bearer $JINA_API_KEY
- **Content-Type**: application/json
- **Accept**: application/json

Request body schema: {"application/json":{"model":{"type":"string","required":true,"description":"Identifier of the model to use.","value":"jina-vlm"},"messages":{"type":"array","required":true,"description":"A list of messages comprising the conversation. Each message has a role (user/assistant) and content. Images can be passed as HTTP/HTTPS URLs or base64 data URIs."},"stream":{"type":"boolean","required":false,"default":false,"description":"If true, returns tokens as they are generated via server-sent events."}}}
Example request (image): ```curl https://api-beta-vlm.jina.ai/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $JINA_API_KEY" -d '{"model":"jina-vlm","messages":[{"role":"user","content":[{"type":"text","text":"Describe this image"},{"type":"image_url","image_url":{"url":"https://example.com/photo.jpg"}}]}]}'```
Example request (streaming): ```curl https://api-beta-vlm.jina.ai/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $JINA_API_KEY" -d '{"model":"jina-vlm","stream":true,"messages":[{"role":"user","content":"Hello"}]}'```
Example response: {"id":"chatcmpl-123","object":"chat.completion","created":1234567890,"model":"jina-vlm","choices":[{"index":0,"message":{"role":"assistant","content":"The image shows..."},"finish_reason":"stop"}],"usage":{"prompt_tokens":100,"completion_tokens":50,"total_tokens":150}}
Note: Cold starts may take 30-60 seconds. Retry if you receive a 503 error.

6. DeepSearch API
Endpoint: https://deepsearch.jina.ai/v1/chat/completions
Purpose: combines web searching, reading, and reasoning for comprehensive investigation. Think of it as an agent that you give a research task to - it searches extensively and works through multiple iterations before providing an answer.
Method: POST
Authorization: HTTPBearer
Headers
- **Authorization**: Bearer $JINA_API_KEY
- **Content-Type**: application/json
- **Accept**: application/json

Request body schema:{"application/json":{"model":{"type":"string","required":true,"description":"ID of the model to use."},"stream":{"type":"boolean","required":false,"description":"Delivers events as they occur through server-sent events, including reasoning steps and final answers. We strongly recommend keeping this option enabled since DeepSearch requests can take significant time to complete. Disabling streaming may result in '524 timeout' errors."},"reasoning_effort":{"type":"string","required":false,"description":"Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."},"budget_tokens":{"type":"number","required":false,"description":"This determines the maximum number of tokens is allowed use for DeepSearch process. Larger budgets can improve response quality by enabling more exhausive search for complex queries, although DeepSearch may not use the entire budget allocated. This overrides the reasoning_effort parameter."},"max_attempts":{"type":"number","required":false,"description":"The maximum number of retries for solving a problem in DeepSearch process. A larger value allows DeepSearch to retry solving the problem by using different reasoning approaches and strategies. This parameter overrides the reasoning_effort parameter."},"no_direct_answer":{"type":"boolean","required":false,"description":"Forces the model to take further thinking/search steps even when the query seems trivial. This is useful if you're using DeepSearch in scenarios where you're certain the query always needs DeepSearch, rather than for trivial questions like '1+1=?'"},"max_returned_urls":{"type":"number","required":false,"description":"The maximum number of URLs to include in the final answer/chunk. URLs are sorted by relevance and other important factors."},"response_format":{"type":"object","required":false,"description":"This enables Structured Outputs which ensures the final answer from the model will match your supplied JSON schema.","properties":{"type":{"type":"string","enum":["json_schema"],"required":true,"description":"Schema output format. Accepts `json_schema`"},"json_schema":{"type":"object","required":true,"description":"JSON schema for output"}}},"boost_hostnames":{"type":"array","required":false,"description":"A list of domains that are given a higher priority for content retrieval. Useful for domain-specific, high-quality sources that provide valuable content."},"bad_hostnames":{"type":"array","required":false,"description":"A list of domains to be strictly excluded from content retrieval. Typically used to filter out known spam, low-quality, or irrelevant websites."},"only_hostnames":{"type":"array","required":false,"description":"A list of domains to be exclusively included in content retrieval. All other domains will be ignored. Useful for domain-specific searches."},"messages":{"type":"array","required":true,"description":"A list of messages between the user and the assistant comprising the conversation so far. You can add images (webp, png, jpeg) or files (txt, pdf) to the message."}}}
Example cURL request: ```curl -X POST 'https://deepsearch.jina.ai/v1/chat/completions' -H "Content-Type: application/json" -H "Authorization: Bearer ..." -d '{"model":"jina-deepsearch-v1","messages":[{"role":"user","content":"Hi!"},{"role":"assistant","content":"Hi, how can I help you?"},{"role":"user","content":"what is the latest blog post from jina ai?"}],"reasoning_effort":"low","max_attempts":1,"no_direct_answer":true,"max_returned_urls":1,"stream":true,"response_format":{"type":"json_schema","json_schema":{"type":"object","properties":{"numerical_answer_only":{"type":"number"}}}},"boost_hostnames":["jina.ai"]}'```
Example response: {"id":"1744185427961","object":"chat.completion.chunk","created":1744185427,"model":"jina-deepsearch-v1","system_fingerprint":"fp_1744185427961","choices":[{"index":0,"delta":{"role":"assistant","content":"<think>","type":"think"},"logprobs":null,"finish_reason":null}]}...
Note: DeepSearch API provides stream response like other chat completion APIs.

7. Segmenter API
Endpoint: https://segment.jina.ai/
Purpose: tokenizes text, divide text into chunks
Best for: counting number of tokens in text, segmenting text into manageable chunks (ideal for downstream applications like RAG)
Method: POST
Authorization: HTTPBearer
Headers
- **Authorization**: Bearer $JINA_API_KEY
- **Content-Type**: application/json
- **Accept**: application/json

Request body schema: {"application/json":{"content":{"type":"string","required":true,"description":"The text content to segment."},"tokenizer":{"type":"string","required":false,"default":"cl100k_base","enum":["cl100k_base","o200k_base","p50k_base","r50k_base","p50k_edit","gpt2"],"description":"Specifies the tokenizer to use."},"return_tokens":{"type":"boolean","required":false,"default":false,"description":"If true, includes tokens and their IDs in the response."},"return_chunks":{"type":"boolean","required":false,"default":false,"description":"If true, segments the text into semantic chunks."},"max_chunk_length":{"type":"integer","required":false,"default":1000,"description":"Maximum characters per chunk (only effective if 'return_chunks' is true)."},"head":{"type":"integer","required":false,"description":"Returns the first N tokens (exclusive with 'tail')."},"tail":{"type":"integer","required":false,"description":"Returns the last N tokens (exclusive with 'head')."}}}
Example cURL request: ```curl -X POST 'https://segment.jina.ai/' -H "Content-Type: application/json" -H "Authorization: Bearer ..." -d '{"content":"\n  Jina AI: Your Search Foundation, Supercharged! 🚀\n  Ihrer Suchgrundlage, aufgeladen! 🚀\n  您的搜索底座，从此不同！🚀\n  検索ベース,もう二度と同じことはありません！🚀\n","tokenizer":"cl100k_base","return_tokens":true,"return_chunks":true,"max_chunk_length":1000,"head":5}'```
Example response: {"num_tokens":78,"tokenizer":"cl100k_base","usage":{"tokens":0},"num_chunks":4,"chunk_positions":[[3,55],[55,93],[93,110],[110,135]],"tokens":[[["J",[41]],["ina",[2259]],[" AI",[15592]],[":",[25]],[" Your",[4718]],[" Search",[7694]],[" Foundation",[5114]],[",",[11]],[" Super",[7445]],["charged",[38061]],["!",[0]],[" ",[11410]],["🚀",[248,222]],["\n",[198]],["  ",[256]]],[["I",[40]],["hr",[4171]],["er",[261]],[" Such",[15483]],["grund",[60885]],["lage",[56854]],[",",[11]],[" auf",[7367]],["gel",[29952]],["aden",[21825]],["!",[0]],[" ",[11410]],["🚀",[248,222]],["\n",[198]],["  ",[256]]],[["您",[88126]],["的",[9554]],["搜索",[80073]],["底",[11795,243]],["座",[11795,100]],["，",[3922]],["从",[46281]],["此",[33091]],["不",[16937]],["同",[42016]],["！",[6447]],["🚀",[9468,248,222]],["\n",[198]],["  ",[256]]],[["検",[162,97,250]],["索",[52084]],["ベ",[2845,247]],["ース",[61398]],[",",[11]],["も",[32977]],["う",[30297]],["二",[41920]],["度",[27479]],["と",[19732]],["同",[42016]],["じ",[100204]],["こ",[22957]],["と",[19732]],["は",[15682]],["あり",[57903]],["ま",[17129]],["せ",[72342]],["ん",[25827]],["！",[6447]],["🚀",[9468,248,222]],["\n",[198]]]],"chunks":["Jina AI: Your Search Foundation, Supercharged! 🚀\n  ","Ihrer Suchgrundlage, aufgeladen! 🚀\n  ","您的搜索底座，从此不同！🚀\n  ","検索ベース,もう二度と同じことはありません！🚀\n"]}
Note: for the API to return chunks, you must specify `"return_chunks": true` as part of the request body.

8. Classifier API
Endpoint: https://api.jina.ai/v1/classify
Purpose: zero-shot classification for text or images
Best for: text or image classification without training
Method: POST
Authorization: HTTPBearer
Headers
- **Authorization**: Bearer $JINA_API_KEY
- **Content-Type**: application/json
- **Accept**: application/json

Request body schema for text and images : {"application/json":{"model":{"type":"string","required":false,"description":"Identifier of the model to use. Required if classifier_id is not provided.","options":[{"name":"jina-clip-v2","size":"885M","dimensions":1024},{"name":"jina-embeddings-v4","size":"3.8B","dimensions":2048}]},"classifier_id":{"type":"string","required":false,"description":"The identifier of the classifier. If not provided, a new classifier will be created."},"input":{"type":"array","required":true,"description":"Array of inputs for classification. Each entry can either be a text object {\"text\": \"your_text_here\"} or an image object {\"image\": \"base64_image_string\"}. You cannot mix text and image objects in the same request."},"labels":{"type":"array of strings","required":true,"description":"List of labels used for classification."}}}
Example request: {"model":"jina-clip-v2","input":[{"image":"base64_image_string"}],"labels":["category1","category2"]}
Example response: {"200":{"data":[{"index":0,"prediction":"category1","object":"classification","score":0.85}],"usage":{"total_tokens":10}},"422":{"detail":[{"message":"Validation error","field":"input"}]}}
Request body schema for text: {"application/json":{"model":{"type":"string","required":false,"description":"Identifier of the model to use. Required if classifier_id is not provided.","options":[{"name":"jina-embeddings-v3","size":"570M","dimensions":1024}]},"classifier_id":{"type":"string","required":false,"description":"The identifier of the classifier. If not provided, a new classifier will be created."},"input":{"type":"array","required":true,"description":"Array of text inputs for classification. Each entry should be a simple string representing the text to classify.","items":{"type":"string"}},"labels":{"type":"array","required":true,"description":"List of labels used for classification.","items":{"type":"string"}}}}
Example request:  {"model":"jina-embeddings-v3", "input": ["walk", "marathon"], "labels": ["Simple task", "intensive task", "Creative writing"]}
Example response: {"usage":{"total_tokens":19},"data":[{"object":"classification","index":0,"prediction":"Simple task","score":0.35543856024742126,"predictions":[{"label":"Simple task","score":0.35543856024742126},{"label":"intensive task","score":0.33334434032440186},{"label":"Creative writing","score":0.3112170696258545}]},{"object":"classification","index":1,"prediction":"intensive task","score":0.3616286516189575,"predictions":[{"label":"Simple task","score":0.34063565731048584},{"label":"intensive task","score":0.3616286516189575},{"label":"Creative writing","score":0.2977357804775238}]}]}
Pay attention to the model used, when classifying images you must use `jina-clip-v2`, when classifying texts it is best to use `jina-embeddings-v3`, when classifying texts or images you can also use `jina-embeddings-v4` (newest text and image embedding model from Jina)!!!

**Note: all API's require authorization using the bearer token (get it from https://jina.ai/?sui=apikey)!**
Make sure that any code you generate uses the JINA_API_KEY environment variable, and remind the user to correctly set this variable before running the code!