---
title: "Embeddings API · OpenAI-compatible, hosted in the EU"
description: "Turn text into vectors for search, RAG and clustering with an OpenAI-compatible embeddings API. Open embedding models, processed in EU data centres."
canonical: "https://inference.eu/api/embeddings/"
language: "en"
---

POST /v1/embeddings

# Embeddings API: OpenAI-compatible vectors, processed in the EU

The embeddings endpoint turns text into vectors of numbers that capture its meaning, so that similar passages end up close together. It is the foundation of semantic search, retrieval-augmented generation, deduplication and clustering. The request format matches OpenAI's, and the documents you embed, often your most sensitive data, are processed in European data centres.

[Contact sales](https://inference.eu/contact/)[Example request](#example)

1.  01API format: OpenAI
2.  02EU data centres
3.  03Covered by one DPA

POST /v1/embeddings

```
curl https://api.inference.eu/v1/embeddings \
  -H "Authorization: Bearer $INFERENCE_EU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-embedding-8b",
    "input": [
      "Die Kündigungsfrist beträgt drei Monate zum Quartalsende.",
      "The notice period is three months to the end of a quarter.",
      "Le préavis est de trois mois avant la fin du trimestre."
    ],
    "dimensions": 1024,
    "encoding_format": "float"
  }'
```

## What the endpoint does

`POST /v1/embeddings` takes a `model` and an `input`, which is either one string or an array of strings, and returns one vector per input. The response has a `data` array in which each item carries an `index` matching the position of the input, and an `embedding`, a list of floats. `usage` reports the `prompt_tokens` used.

Multilingual models such as `qwen3-embedding-8b` place a German, an English and a French sentence with the same meaning close to each other, so a question in one language finds documents in another. That matters for European companies whose contracts, tickets and wikis are rarely in one language.

## Key request fields

Send batches rather than one string per request: an array of inputs is processed together and is far more efficient. Each input must fit within the model's maximum input length, so split long documents into chunks first.

`dimensions` shortens the vector on models trained to support it, such as the Qwen3 embedding family. Shorter vectors take less storage and make search faster, with a small loss of accuracy; test 512 or 1024 against the full size on your own data. `encoding_format` can be `float` or `base64`; base64 makes large responses smaller over the network. Always use the same model and dimension for documents and queries.

## A practical RAG pattern

A typical retrieval pipeline converts documents to clean text, splits them into chunks of a few hundred tokens with some overlap, embeds each chunk and stores the vectors with the source text in a vector database such as pgvector, Qdrant or Weaviate. At query time, embed the question, fetch the 20 to 50 nearest chunks by cosine similarity, and pass them to a reranker to keep the best five or so.

Then give those chunks to a chat model as context. For Qwen3 embeddings, prefix queries with a short task instruction, as the model card recommends, and embed documents without it. Run initial indexing of large collections through the batch API.

## Errors and edge cases

An input longer than the model's limit returns a 400 error rather than being silently cut, so chunk before you send. Empty strings are rejected too; filter them out. Sending a chat model id to this endpoint returns an error that names the model type, and an unknown id returns 404.

Vectors from different models, or from the same model at different `dimensions`, cannot be compared. If you change either, re-embed the whole collection. Most models return normalised vectors, so cosine similarity and dot product give the same ranking. Retry 429 responses with backoff, and spread large indexing jobs over time or use batches.

## Embeddings

Endpoint

POST /v1/embeddings

Category

Endpoints

API format

OpenAI

Base URL

api.inference.eu/v1

Processing

EU data centres

Training on your data

Never

## Embeddings: common questions

The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.

Yes. The request takes \`model\`, \`input\`, \`dimensions\` and \`encoding\_format\`, and the response returns \`data\` items with \`index\` and \`embedding\` plus \`usage\`, exactly as in the OpenAI API. \`client.embeddings.create\` in the OpenAI SDKs, LangChain's \`OpenAIEmbeddings\` and LlamaIndex work after you change the base URL and key.

For multilingual European text, \`qwen3-embedding-8b\` is a strong default and supports shorter vectors through \`dimensions\`. Smaller embedding models are cheaper to run at large volume. Test two or three on a sample of your real queries, measuring how often the right document appears in the top results.

Yes, with a multilingual embedding model. These models map sentences with the same meaning to nearby vectors regardless of language, so an English question can retrieve German or French passages. Add a reranker to improve the order of results, and let the chat model answer in the user's language.

You can send an array of inputs in one request, and batching is much more efficient than one call per text. The maximum number of inputs and tokens per request depends on the model and your plan, and we confirm it with you. For millions of chunks, use the batch API.

Each input must fit within the model's maximum input length in tokens, which is listed on its model page. In practice, retrieval works best with chunks of a few hundred tokens, because one vector for a whole long document blurs its details. Inputs over the limit return a 400 error.

Often, yes. Models that support \`dimensions\` keep most of their accuracy at 512 or 1024 values, and smaller vectors cut storage and speed up search. Compare retrieval quality on your own data before you choose, because you have to re-embed everything if you change it later.

No. Text sent to the embeddings endpoint is processed in EU data centres to compute the vectors and is never used to train models. The vectors are returned to you; where you store them, and for how long, is up to you and your vector database.

Not always, but it usually helps. Embeddings find candidates quickly across millions of chunks, while a reranker reads the query and each candidate together and scores them more precisely. Retrieving 30 candidates and reranking to the top five is a common, reliable setup for RAG.

[Ask a question](https://inference.eu/contact/)

## Related

[API overview](https://inference.eu/api/)

-   [RerankRe-order search results by relevance with a rerank API for RAG. Cross-encoder reranker models such as bge-reranker-v2-m3, processed in EU data centres.Endpoints](https://inference.eu/api/rerank/)
-   [Document conversionConvert PDF, Word, PowerPoint and Excel files to clean Markdown for RAG and LLM prompts. Tables, headings and scanned pages, processed in the EU.Tools](https://inference.eu/api/document-conversion/)
-   [BatchesRun thousands of chat or embedding requests as one asynchronous job with an OpenAI-compatible batch API. Upload JSONL, collect results, all in the EU.Endpoints](https://inference.eu/api/batches/)
-   [List modelsList the open-weight models your inference.eu key can use with GET /v1/models, in the OpenAI format. Pick model ids for chat, embeddings, speech and more.Endpoints](https://inference.eu/api/models/)

## Move your AI workloads to EU infrastructure

Tell us which models you use and roughly how much traffic you have. We reply within one working day with pricing and next steps.

-   Reply within one working day
-   Pricing for your volume
-   DPA ready to sign
