data
Jina AI CLI for AI Agents
Use the Jina AI CLI from KosmoKrator to call Jina AI tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Jina AI CLI Setup
Jina AI can be configured headlessly with `kosmokrator integrations:configure jinaai`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure jinaai --set api_key="$JINAAI_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor jinaai --json
kosmokrator integrations:status --json Credentials
Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | JINAAI_API_KEY | Secret secret | yes | API Key |
url | JINAAI_URL | URL url | no | API Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call jinaai.jinaai_search '{"q":"example_q"}' --json kosmo integrations:jinaai jinaai_search '{"q":"example_q"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs jinaai --json
kosmo integrations:docs jinaai.jinaai_search --json
kosmo integrations:schema jinaai.jinaai_search --json
kosmo integrations:search "Jina AI" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
jinaai.jinaai_search
Search the web using Jina AI. Returns search results with titles, URLs, descriptions, and extracted content. Useful for finding up-to-date information on any topic.
read - Parameters
- q
kosmo integrations:call jinaai.jinaai_search '{"q":"example_q"}' --json kosmo integrations:jinaai jinaai_search '{"q":"example_q"}' --json jinaai.jinaai_read
Read and extract clean content from a URL using Jina AI Reader. Returns the main text content of a web page, stripping away navigation, ads, and other clutter. Useful for reading articles, documentation, or any web page.
read - Parameters
- url
kosmo integrations:call jinaai.jinaai_read '{"url":"example_url"}' --json kosmo integrations:jinaai jinaai_read '{"url":"example_url"}' --json jinaai.jinaai_ground
Ground a statement against provided context using Jina AI. Verifies whether a claim or statement is supported by the given reference text. Returns grounding results indicating which parts of the statement are supported or contradicted.
read - Parameters
- statement, references, context
kosmo integrations:call jinaai.jinaai_ground '{"statement":"example_statement","references":"example_references","context":"example_context"}' --json kosmo integrations:jinaai jinaai_ground '{"statement":"example_statement","references":"example_references","context":"example_context"}' --json jinaai.jinaai_embeddings
Generate text embeddings using Jina AI. Converts text into dense vector representations useful for semantic search, similarity comparison, clustering, and retrieval-augmented generation (RAG).
read - Parameters
- input, model
kosmo integrations:call jinaai.jinaai_embeddings '{"input":"example_input","model":"example_model"}' --json kosmo integrations:jinaai jinaai_embeddings '{"input":"example_input","model":"example_model"}' --json jinaai.jinaai_rerank
Rerank documents by relevance to a query using Jina AI. Takes a query and a list of text documents, then returns them sorted by relevance with scores. Useful for improving search results or filtering the most relevant content.
read - Parameters
- query, documents, model, top_n
kosmo integrations:call jinaai.jinaai_rerank '{"query":"example_query","documents":"example_documents","model":"example_model","top_n":1}' --json kosmo integrations:jinaai jinaai_rerank '{"query":"example_query","documents":"example_documents","model":"example_model","top_n":1}' --json jinaai.jinaai_classify
Classify text or image inputs using Jina AI Classifier. Provide labels for zero-shot classification or classifier configuration for few-shot classification.
read - Parameters
- input, labels, model, classifier_id, top_k
kosmo integrations:call jinaai.jinaai_classify '{"input":"example_input","labels":"example_labels","model":"example_model","classifier_id":"example_classifier_id","top_k":1}' --json kosmo integrations:jinaai jinaai_classify '{"input":"example_input","labels":"example_labels","model":"example_model","classifier_id":"example_classifier_id","top_k":1}' --json jinaai.jinaai_segment
Tokenize or segment long text using Jina AI Segmenter before embedding, reranking, or LLM processing.
read - Parameters
- content, tokenizer, return_tokens, return_chunks, max_chunk_length
kosmo integrations:call jinaai.jinaai_segment '{"content":"example_content","tokenizer":"example_tokenizer","return_tokens":true,"return_chunks":true,"max_chunk_length":1}' --json kosmo integrations:jinaai jinaai_segment '{"content":"example_content","tokenizer":"example_tokenizer","return_tokens":true,"return_chunks":true,"max_chunk_length":1}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
jinaai.jinaai_search 1 parameters
kosmo integrations:schema jinaai.jinaai_search --json | Parameter | Type | Required | Description |
|---|---|---|---|
q | string | yes | The search query string. |
jinaai.jinaai_read 1 parameters
kosmo integrations:schema jinaai.jinaai_read --json | Parameter | Type | Required | Description |
|---|---|---|---|
url | string | yes | The URL to read and extract content from. |
jinaai.jinaai_ground 3 parameters
kosmo integrations:schema jinaai.jinaai_ground --json | Parameter | Type | Required | Description |
|---|---|---|---|
statement | string | yes | The statement or claim to verify. |
references | array | no | Optional references or URLs to restrict grounding sources. |
context | string | no | Deprecated compatibility field. Prefer references when restricting sources. |
jinaai.jinaai_embeddings 2 parameters
kosmo integrations:schema jinaai.jinaai_embeddings --json | Parameter | Type | Required | Description |
|---|---|---|---|
input | array | yes | An array of strings to generate embeddings for. Each string is embedded independently. |
model | string | no | The embedding model to use (e.g., "jina-embeddings-v3"). Defaults to the Jina AI default model. |
jinaai.jinaai_rerank 4 parameters
kosmo integrations:schema jinaai.jinaai_rerank --json | Parameter | Type | Required | Description |
|---|---|---|---|
query | string | yes | The query to rank documents against. |
documents | array | yes | An array of document strings to rank by relevance to the query. |
model | string | no | The reranking model to use (e.g., "jina-reranker-v2-base-multilingual"). Defaults to the Jina AI default model. |
top_n | integer | no | Maximum number of top results to return. Defaults to all documents. |
jinaai.jinaai_classify 5 parameters
kosmo integrations:schema jinaai.jinaai_classify --json | Parameter | Type | Required | Description |
|---|---|---|---|
input | array | yes | Inputs to classify. Text inputs may be strings or objects accepted by Jina. |
labels | array | no | Zero-shot classification labels. |
model | string | no | Embedding or classifier model id. |
classifier_id | string | no | Few-shot classifier id when using a trained classifier. |
top_k | integer | no | Maximum labels per input to return. |
jinaai.jinaai_segment 5 parameters
kosmo integrations:schema jinaai.jinaai_segment --json | Parameter | Type | Required | Description |
|---|---|---|---|
content | string | yes | Text content to tokenize or segment. |
tokenizer | string | no | Tokenizer or model-compatible tokenizer to use. |
return_tokens | boolean | no | Whether to include token text in the response. |
return_chunks | boolean | no | Whether to include segmented chunks in the response. |
max_chunk_length | integer | no | Maximum chunk length when chunking is enabled. |
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.