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

# Embeddings

> Turn text into vectors for search, RAG, and clustering.

Embedding models convert text into a numeric vector that captures its meaning.
Use them for semantic search, retrieval-augmented generation (RAG),
recommendations, and clustering. The `/v1/embeddings` endpoint is fully
OpenAI-compatible.

## Creating embeddings

<CodeGroup>
  ```bash cURL theme={null}
  curl https://gateway.omnia-voice.com/v1/embeddings \
    -H "Authorization: Bearer $OMNIA_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "Qwen/Qwen3-Embedding-8B",
      "input": "The quick brown fox jumps over the lazy dog."
    }'
  ```

  ```python Python theme={null}
  resp = client.embeddings.create(
      model="Qwen/Qwen3-Embedding-8B",
      input="The quick brown fox jumps over the lazy dog.",
  )

  vector = resp.data[0].embedding
  ```

  ```javascript JavaScript theme={null}
  const resp = await client.embeddings.create({
    model: "Qwen/Qwen3-Embedding-8B",
    input: "The quick brown fox jumps over the lazy dog.",
  });

  const vector = resp.data[0].embedding;
  ```
</CodeGroup>

Discover embedding-capable models with [`GET /v1/models`](/concepts/models).

## Parameters

`/v1/embeddings` accepts exactly these fields:

| Parameter         | Description                                                                  |
| ----------------- | ---------------------------------------------------------------------------- |
| `model`           | The embedding model id (required).                                           |
| `input`           | A string, or an array of strings to embed in one request.                    |
| `encoding_format` | `float` (default) for arrays of numbers, or `base64` for a compact encoding. |
| `dimensions`      | Request a reduced output dimensionality (model-dependent).                   |
| `user`            | An opaque end-user identifier you can attach to the request.                 |

<Note>
  As with chat, unknown parameters are silently ignored; only the fields above are
  forwarded to the model.
</Note>

## Batch input

`input` can be a single string or an **array of strings**. Batching many texts in
one request is the recommended way to embed a corpus: it embeds them in a single
round trip and reduces requests-per-minute (RPM) pressure against your
[rate limits](/reference/rate-limits).

```python theme={null}
resp = client.embeddings.create(
    model="Qwen/Qwen3-Embedding-8B",
    input=[
        "First document.",
        "Second document.",
        "Third document.",
    ],
)

for item in resp.data:
    print(item.index, len(item.embedding))
```

Results come back in `data`, each with an `index` that matches the position of
the corresponding input, so you can align vectors to their source texts.

## The response

```json theme={null}
{
  "object": "list",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.0123, -0.045, "..."] }
  ],
  "model": "Qwen/Qwen3-Embedding-8B",
  "usage": { "prompt_tokens": 11, "total_tokens": 11 }
}
```

## Billing

Embeddings are billed on **input tokens only**: there are no output tokens, so
`usage` reports `prompt_tokens` and `total_tokens`. Batching many inputs in one
request is priced the same as sending them individually, while cutting your
request count.

<Tip>
  Embeddings are the highest-hit-rate surface for
  [response caching](/billing/caching): the output is deterministic and RAG
  pipelines routinely re-embed unchanged text. With caching enabled on your
  workspace, a repeated identical `input` is served from cache at **25% of the
  normal price**; the `X-Omnia-Cache: hit|miss` header shows what happened.
</Tip>

## Errors and rate limits

Embedding models have their own per-model TPM/RPM limits; exceeding them returns
HTTP `429`; see [Rate limits](/reference/rate-limits). For error codes, see
[Errors](/reference/errors).
