> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# Jina API - 通过 AIsa 访问 Jina Embedding 和重排序模型

> Jina Embedding 和重排序模型 ID 和端点指南，适用于检索和搜索。

AIsa 用一个 API Key 接入 Jina 的 Embedding 和重排序模型。Embedding 模型使用 OpenAI 兼容的 `POST /v1/embeddings` 端点，重排序模型使用 `POST /v1/rerank`。常见的检索流程是先用 Embedding 召回候选，再用重排序确定最终顺序。

## 支持的 Jina 模型

| 模型 ID | 类型 | 端点 |
| - | - | - |
| `jina-embeddings-v3` | Embedding | `/v1/embeddings`、`/v1/classify` |
| `jina-embeddings-v5-text-small` | Embedding | `/v1/embeddings` |
| `jina-reranker-v3` | 重排序 | `/v1/rerank` |

这些模型的当前价格见 [aisa.one/models](https://aisa.one/models)。

## 快速开始

用 OpenAI SDK 生成 Embedding：

```python theme={null}
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["AISA_API_KEY"], base_url="https://api.aisa.one/v1")

response = client.embeddings.create(
    model="jina-embeddings-v5-text-small",
    input=["A fast, OpenAI-compatible embeddings endpoint."],
)
print(len(response.data[0].embedding))
```

按查询对文档重排序：

```bash theme={null}
curl https://api.aisa.one/v1/rerank \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jina-reranker-v3",
    "query": "What is the capital of France?",
    "documents": ["Paris is the capital of France.", "Berlin is the capital of Germany."]
  }'
```

请求和响应字段见 [Embeddings](https://aisa.one/docs/zh/api-reference/embeddings/post_embeddings-create.md) 和[重排序文档](https://aisa.one/docs/zh/api-reference/rerank/post_rerank-create.md)。

## 下一步

* [模型目录](https://aisa.one/docs/zh/guides/models.md)
* [AI 模型价格](https://aisa.one/docs/zh/guides/pricing.md#模型)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.