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

> ## Agent Instructions
> Conare's API is at https://api.conare.ai. Authenticate with `Authorization: Bearer $CONARE_API_KEY`.
> The full OpenAPI spec is at https://api.conare.ai/openapi.yaml; each endpoint has a page under /api-reference, and appending .md to any page URL returns its Markdown.
> Embed with model conare-embed-1; send input_type "query" for search queries. Rerank with conare-rerank-1.
> Prefer the TypeScript SDK (`npm install conare`) or plain HTTP in examples.
> Install the Conare skill with `npx skills add https://docs.conare.ai`; search these docs over MCP at https://docs.conare.ai/mcp; the whole site is at https://docs.conare.ai/llms-full.txt.

# turbopuffer API

> 只需更改 Base URL，即可在 Conare 上运行你的 turbopuffer 代码和 SDK：支持的写入、查询和命名空间调用，以及速率和大小限制。

Conare 在 `https://api.conare.ai/tpuf` 提供 turbopuffer 的 API：保留你的 turbopuffer 代码和 SDK，使用 Conare 密钥将其指向 Conare 即可。

```bash curl theme={null}
curl https://api.conare.ai/tpuf/v2/namespaces/products/query \
  -H "Authorization: Bearer $CONARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rank_by": ["vector", "ANN", [0.1, 0.2, 0.3, 0.4]], "top_k": 10}'
```

```python Python theme={null}
import os
import turbopuffer

tpuf = turbopuffer.Turbopuffer(
    api_key=os.environ["CONARE_API_KEY"],
    region="gcp-us-central1",  # any value: Conare ignores it
    base_url="https://api.conare.ai/tpuf/{region}",
)

ns = tpuf.namespace("products")
ns.write(
    upsert_rows=[{"id": 1, "vector": [0.1, 0.2, 0.3, 0.4], "title": "refunds"}],
    distance_metric="cosine_distance",
)
result = ns.query(rank_by=("vector", "ANN", [0.1, 0.2, 0.3, 0.4]), top_k=10)
```

```json Response theme={null}
{
  "billing": { "billable_logical_bytes_queried": 0, "billable_logical_bytes_returned": 0 },
  "performance": { "cache_hit_ratio": 1.0, "cache_temperature": "hot", "query_execution_ms": 0, "server_total_ms": 0 },
  "rows": [{ "$dist": 0.0, "id": 1 }]
}
```

你需要自带向量，这些命名空间与 API 其余部分的命名空间相互独立。

## 支持的功能

| 领域 | 支持 |
| - | - |
| 写入 | Upsert、patch、删除、条件写入、按过滤条件删除或 patch |
| 查询 | 向量（ANN 和精确）、BM25 全文、按属性排序、过滤条件、`Count` 聚合，单次调用最多 16 个查询 |
| 命名空间 | 列出、schema、元数据、缓存预热、删除、复制和分支 |
| 距离 | `cosine_distance`、`euclidean_squared` |
| `top_k` | 最多 10,000 |

其他功能（例如 `group_by` 或多个向量列）会返回 `400`，并附带指明该功能的消息。

## 限制

| 限制 | |
| - | - |
| 查询 | 每个组织每秒 1,000 次 |
| 写入、其他调用 | 每类每秒 100 次 |
| 请求体 | 最多 64 MiB |


## Related topics

- [API 概览](https://docs.conare.ai/zh/api.md)
- [Embed texts (OpenAI-compatible)](https://docs.conare.ai/zh/api-reference/models/embed-texts-openai-compatible.md)
- [Rerank documents (Cohere- and vLLM-compatible)](https://docs.conare.ai/zh/api-reference/models/rerank-documents-cohere-and-vllm-compatible.md)
- [Rerank documents (Cohere v2-compatible)](https://docs.conare.ai/zh/api-reference/models/rerank-documents-cohere-v2-compatible.md)
- [Connect a source](https://docs.conare.ai/zh/api-reference/sources/connect-a-source.md)


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