---
title: "Generate embeddings for text input"
method: POST
path: "/v1/embeddings"
tags: ["embeddings"]
---

# Generate embeddings for text input

`POST /v1/embeddings`

Generate vector embeddings from input text.

This endpoint converts text into high-dimensional vector representations
that capture semantic meaning. These embeddings preserve semantic
relationships between texts and can be used for various machine learning
tasks.

Notes:
* Empty strings or arrays are not accepted
* Results include index numbers for mapping back to original inputs
* All embeddings are generated as query vectors. If the embeddings have two modes
(e.g., query and document), this endpoint only returns query vectors.

## Request body

- EmbeddingsBody — Request body for generating vector embeddings from text input.
  - `model` string — Model identifier or alias.
  - `input` union, required — The text(s) to generate embeddings for. Can be a single string or an array of strings. Each text should be a meaningful unit of text (sentence, paragraph, etc).
    - string
    - string[]

## Response `200`

Successfully generated embeddings

- EmbeddingsResponse — Response containing generated embeddings for input text(s).
  - `object` 'list' — The type of object returned
  - `model` 'private-gpt' — The model used to generate embeddings
  - `data` Embedding[], required — List of embeddings, one for each input text
    - `index` integer, required — Sequential index of this embedding in the batch, starting from 0
    - `object` 'embedding' — Type identifier for this object, always 'embedding'
    - `embedding` number[], required — High-dimensional vector representation of the text content as a list of floating-point numbers

## Other responses

- `401` — Unauthorized
- `422` — Validation Error - Invalid input format

---

[API](https://skmtc.dev/privategpt/apis/api-reference.md) · [All operations](https://skmtc.dev/privategpt/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/privategpt/api-reference/revisions/15d9ccfd68da/schema)
