> ## 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.

# 임베딩과 리랭킹

> OpenAI 및 Cohere 호환 엔드포인트를 통해 어떤 벡터 데이터베이스에서든 Conare의 임베딩 및 리랭킹 모델을 사용하세요.

OpenAI 또는 Cohere 클라이언트를 `https://api.conare.ai/v1`로 지정하면 Conare의 모델을 단독으로 사용할 수 있습니다. **Models only** [키](https://docs.conare.ai/ko/console.md#키)는 모델을 호출할 수 있으며 어떤 네임스페이스에도 접근하지 않습니다.

| 모델 | 용도 | 출력 |
| - | - | - |
| `conare-embed-1` | 문서와 쿼리용 임베딩 | 1,024차원 |
| `conare-rerank-1` | 리랭킹(기본값) | 문서별 관련성 점수 |

## 임베딩

`POST /v1/embeddings`

문서는 그대로 임베딩하고, 검색 쿼리는 `input_type: "query"`로 임베딩하세요.

```bash curl theme={null}
curl https://api.conare.ai/v1/embeddings \
  -H "Authorization: Bearer $CONARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "conare-embed-1", "input": ["Refunds are available for 30 days."]}'

curl https://api.conare.ai/v1/embeddings \
  -H "Authorization: Bearer $CONARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "conare-embed-1", "input": "how do refunds work?", "input_type": "query"}'
```

```ts TypeScript theme={null}
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.conare.ai/v1", apiKey: process.env.CONARE_API_KEY });

const docs = await client.embeddings.create({ model: "conare-embed-1", input: ["Refunds are available for 30 days."] });
const query = await client.embeddings.create({
  model: "conare-embed-1",
  input: "how do refunds work?",
  input_type: "query",
} as OpenAI.EmbeddingCreateParams);
```

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

client = OpenAI(base_url="https://api.conare.ai/v1", api_key=os.environ["CONARE_API_KEY"])

docs = client.embeddings.create(model="conare-embed-1", input=["Refunds are available for 30 days."])
query = client.embeddings.create(
    model="conare-embed-1",
    input="how do refunds work?",
    extra_body={"input_type": "query"},
)
```

```json Response theme={null}
{
  "data": [{ "embedding": [0.12506497, 0.07159516, 0.017521178, ...], "index": 0, "object": "embedding" }],
  "model": "conare-embed-1",
  "object": "list",
  "usage": { "prompt_tokens": 12, "total_tokens": 12 }
}
```

| 옵션 | 타입 | 기능 |
| - | - | - |
| `input` | string 또는 array, 필수 | 1-128개의 텍스트, 각각 최대 32 KiB |
| `model` | string | `conare-embed-1`(기본값) 또는 자체 모델의 id |
| `input_type` | string, 기본값 `document` | 검색 쿼리에는 `query` |
| `encoding_format` | string, 기본값 `float` | `float`, 또는 리틀 엔디언 float32용 `base64` |
| `dimensions` | integer | 모델 고유의 1,024만 가능 |

`data`에는 입력마다 1,024개 숫자로 된 `embedding`이 `index`와 함께 하나씩 들어 있습니다. 전체 스키마: [텍스트 임베딩(OpenAI 호환)](https://docs.conare.ai/ko/api-reference/models/embed-texts-openai-compatible.md).

## 리랭킹

`POST /v1/rerank`

쿼리에 대해 문서에 점수를 매겨 가장 좋은 것부터 반환합니다. Cohere의 요청 형식을 받으며, `/v2/rerank`는 Cohere의 `ClientV2`를 받습니다.

```bash curl theme={null}
curl https://api.conare.ai/v1/rerank \
  -H "Authorization: Bearer $CONARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "how do refunds work?",
    "documents": ["Orders ship within two days.", "Refunds are available for 30 days."],
    "top_n": 1
  }'
```

```ts TypeScript (SDK) theme={null}
import { Conare } from "conare";

const conare = new Conare();
const ranked = await conare.rerank("how do refunds work?", [
  "Orders ship within two days.",
  "Refunds are available for 30 days.",
]);
// [{ index: 1, score: 0.3468, document: "Refunds are available for 30 days." }, ...]
```

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

co = cohere.Client(base_url="https://api.conare.ai", api_key=os.environ["CONARE_API_KEY"])

response = co.rerank(
    query="how do refunds work?",
    documents=["Orders ship within two days.", "Refunds are available for 30 days."],
    top_n=1,
)
```

```json Response theme={null}
{
  "id": "d9d8ac5739d77af256c01449d7f23bb2",
  "model": "conare-rerank-1",
  "results": [{ "index": 1, "relevance_score": 0.3484 }],
  "unscored": [],
  "usage": { "total_tokens": 57 }
}
```

| 옵션 | 타입 | 기능 |
| - | - | - |
| `query` | string, 필수 | 최대 8,192자 |
| `documents` | array, 필수 | 1-100개의 문자열 또는 `text`가 있는 객체. 맞춤 학습된 모델은 최대 1,000개 |
| `model` | string | 생략하면 `conare-rerank-1`. 알 수 없는 모델은 `400`을 반환합니다 |
| `top_n` | integer | 상위 `top_n`개만 반환합니다 |
| `return_documents` | boolean, 기본값 `false` | 각 문서의 텍스트를 `document`로 포함합니다 |
| `max_tokens_per_doc` | integer | 각 문서를 이 토큰 수 정도로 자릅니다 |

| 필드 | 의미 |
| - | - |
| `results` | 가장 좋은 것부터: `documents` 내의 `index`와 `relevance_score`(높을수록 좋음) |
| `unscored` | 리랭커가 시간 내에 처리하지 못한 문서 |
| `id`, `usage` | 요청 id와 읽은 토큰 수 |

전체 스키마: [리랭킹(Cohere 호환)](https://docs.conare.ai/ko/api-reference/models/rerank-documents-cohere-and-vllm-compatible.md), [리랭킹(Cohere v2)](https://docs.conare.ai/ko/api-reference/models/rerank-documents-cohere-v2-compatible.md).

## 모델

`GET /v1/models`

조직을 위해 학습된 모델을 포함해, 키로 호출할 수 있는 모델을 `data`에 나열합니다.

* 각 모델에는 `id`와 `type`(`embedding` 또는 `rerank`)이 있습니다. 지원 종료 예정인 모델에는 `sunset` 날짜와 `successor`가 있습니다.
* `GET /v1/models/:id`는 모델 하나 또는 `404 model_not_found`를 반환합니다.

전체 스키마: [모델 나열](https://docs.conare.ai/ko/api-reference/models/list-models-openai-compatible.md).

## 네이티브 라우트

[SDK](https://docs.conare.ai/ko/sdk.md)가 사용하는 Conare 고유 형식입니다.

`POST /embed`

```ts TypeScript theme={null}
const [vector] = await conare.embed("how do refunds work?", { type: "query" });
const int8 = await conare.embed("how do refunds work?", { type: "query", outputDtype: "int8" });
```

```json Response theme={null}
{ "dimensions": 1024, "embeddings": [[0.15636191, 0.03499228, -0.003388892, ...]], "model": "conare-embed-1" }
```

| 옵션 | 타입 | 기능 |
| - | - | - |
| `input` | array, 필수 | 1-128개의 텍스트 |
| `type` | string, 기본값 `document` | 검색 쿼리에는 `query` |
| `output_dtype` | string, 기본값 `float` | `int8`은 -127에서 127 사이의 정수와 벡터별 스케일 하나를 `scales`에 반환합니다. 코사인 유사도는 동일합니다 |

전체 스키마: [텍스트 임베딩](https://docs.conare.ai/ko/api-reference/models/embed-texts.md).

`POST /rerank`

```json Response theme={null}
{
  "model": "conare-rerank-1",
  "results": [{ "index": 1, "score": 0.3484 }, { "index": 0, "score": 0.1169 }],
  "unscored": []
}
```

| 옵션 | 타입 | 기능 |
| - | - | - |
| `query` | string, 필수 | 최대 8,192자 |
| `documents` | array, 필수 | 1-100개의 문자열, 맞춤 학습된 모델은 최대 1,000개 |
| `top_k` | integer | 상위 `top_k`개만 반환합니다 |

전체 스키마: [문서 리랭킹](https://docs.conare.ai/ko/api-reference/models/rerank-documents.md).


## Related topics

- [소개](https://docs.conare.ai/ko/index.md)
- [API 개요](https://docs.conare.ai/ko/api.md)
- [콘솔](https://docs.conare.ai/ko/console.md)
- [문서 쓰기](https://docs.conare.ai/ko/write.md)
- [검색](https://docs.conare.ai/ko/query.md)


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