For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Contact usJoin the Discord
ManualAPI GuideAPI Reference
  • Overview
    • API Reference
    • Client libraries
  • API Reference
      • POSTGenerate embeddings for text input
LogoLogo
Contact usJoin the Discord
API ReferenceEmbeddings

Generate embeddings for text input

POST
https://host.com/v1/embeddings
POST
/v1/embeddings
$curl -X POST https://host.com/v1/embeddings \
> -H "Content-Type: application/json" \
> -d '{
> "input": "input"
>}'
1{
2 "data": [
3 {
4 "index": 0,
5 "embedding": [
6 0.123,
7 -0.456,
8 0.789,
9 0.234,
10 -0.567,
11 0.891,
12 -0.123,
13 0.445,
14 -0.678,
15 0.901
16 ],
17 "object": "embedding"
18 }
19 ],
20 "object": "list",
21 "model": "private-gpt"
22}
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.
Was this page helpful?
Previous

Ingest Content

Next
Built with

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

This endpoint expects an object.
inputstring or list of stringsRequired

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).

modelstringOptionalDefaults to default
Model identifier or alias.

Response

This endpoint returns an object.
datalist of objects
List of embeddings, one for each input text
object"list"
The type of object returned
model"private-gpt"
The model used to generate embeddings

Errors

401
Unauthorized
422
Unprocessable Entity