---
title: "Generate embeddings for text input"
method: POST
path: "/v1/embeddings"
tags: ["Embeddings", "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

## Changes

- **2026-06-02** `c711b911f68e` — 3 breaking, 8 info
  - the response property `data/items/object` became optional for the status `200`
  - the response property `model` became optional for the status `200`
  - the response property `object` became optional for the status `200`
  - added the new optional request property `model`
  - …7 more
- **2024-07-31** `3d6676aeac77` — 3 breaking, 3 warning
  - the `data/items/object` response's property type/format changed from ``/`` to `string`/`` for status `200`
  - the `model` response's property type/format changed from ``/`` to `string`/`` for status `200`
  - the `object` response's property type/format changed from ``/`` to `string`/`` for status `200`
  - added the new `embedding` enum value to the `data/items/object` response property for the response status `200`
  - …2 more
- **2023-11-29** `745b6d1eafa8` — 3 breaking, 6 info
  - the `data/items/object` response's property type/format changed from `string`/`` to ``/`` for status `200`
  - the `model` response's property type/format changed from `string`/`` to ``/`` for status `200`
  - the `object` response's property type/format changed from `string`/`` to ``/`` for status `200`
  - the `model` response property const value `private-gpt` was added for the status `200`
  - …5 more

[Change history](https://skmtc.dev/zylon-ai/apis/private-gpt-api/changes/v1/embeddings/post.md)

---

[API](https://skmtc.dev/zylon-ai/apis/private-gpt-api.md) · [All operations](https://skmtc.dev/zylon-ai/apis/private-gpt-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zylon-ai/private-gpt-api/revisions/4e828cf153c4/schema)
