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

# Embeddings

> Generate vector embeddings with Venice for semantic search, RAG retrieval, clustering, and recommendations using the /embeddings endpoint.

Embeddings convert text into vectors that capture semantic meaning. Use them for search, retrieval-augmented generation (RAG), clustering, recommendations, deduplication, and similarity scoring.

The Venice embeddings endpoint is OpenAI-compatible. Send one string or an array of strings to `/embeddings`, then store the returned vectors in your database or vector index.

## Basic Usage

<CodeGroup>
  ```python Python theme={"system"}
  import os
  from openai import OpenAI

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

  response = client.embeddings.create(
      model="text-embedding-bge-m3",
      input="Privacy-first AI infrastructure for semantic search",
  )

  vector = response.data[0].embedding
  print(len(vector), vector[:5])
  ```

  ```javascript Node.js theme={"system"}
  import OpenAI from "openai";

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

  const response = await client.embeddings.create({
    model: "text-embedding-bge-m3",
    input: "Privacy-first AI infrastructure for semantic search",
  });

  const vector = response.data[0].embedding;
  console.log(vector.length, vector.slice(0, 5));
  ```

  ```bash cURL theme={"system"}
  curl https://api.venice.ai/api/v1/embeddings \
    -H "Authorization: Bearer $VENICE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "text-embedding-bge-m3",
      "input": "Privacy-first AI infrastructure for semantic search",
      "encoding_format": "float"
    }'
  ```
</CodeGroup>

## Batch Inputs

Pass an array of strings to embed multiple texts in one request:

```json theme={"system"}
{
  "model": "text-embedding-bge-m3",
  "input": [
    "Venice supports private chat completions.",
    "Embeddings help retrieve relevant documents.",
    "Vector search powers RAG applications."
  ]
}
```

The response preserves input order. Store each vector with the source text ID, metadata, and embedding model ID.

## Common Workflow

1. Split source documents into chunks.
2. Generate embeddings for each chunk.
3. Store vectors and metadata in a vector database.
4. Embed the user's query.
5. Retrieve nearby chunks.
6. Send the retrieved context to a chat model.

For a complete implementation, see [Building a Private RAG Bot](/guides/projects/private-rag-bot).

## Model Selection

Use the [Embedding Models](/models/embeddings) page to compare current embedding models, dimensions, and pricing.

<Note>
  Use the same embedding model for indexing and querying. Mixing models can make similarity scores unreliable because vector spaces are not interchangeable.
</Note>

## Related Resources

* [Embeddings API](/api-reference/endpoint/embeddings/generate)
* [Embedding Models](/models/embeddings)
* [Private RAG Bot Guide](/guides/projects/private-rag-bot)
