# Vector embeddings

Embeddings in the OpenAI format, for search, clustering and RAG pipelines.

`POST /v1/embeddings`

```bash
curl "https://sharellm.net/v1/embeddings" \
  -H "Authorization: Bearer $SHARE_LLM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<model-id>",
    "input": ["first document", "second document"]
  }'
```

## Request fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `model` | string | yes | Embedding model ID from the market. |
| `input` | string \| string[] | yes | One text or a batch. Send batches instead of one request per document — it is faster and cheaper on tokens. |
| `encoding_format` | string | no | `float` (default) or `base64`. |
| `dimensions` | integer | no | Requested vector size, on models that support truncation. |

## Response

```json
{
  "object": "list",
  "data": [
    {"object": "embedding", "index": 0, "embedding": [0.013, -0.041, ...]},
    {"object": "embedding", "index": 1, "embedding": [0.004, 0.019, ...]}
  ],
  "usage": {"prompt_tokens": 12, "total_tokens": 12}
}
```

## Billing

Embeddings bill per input token — batching keeps the request count (and the
rate-limit pressure) low at the same token cost.