Skip to main content

/public/embeddings

This endpoint generates embeddings for a list of text strings using the OpenAI API. The user needs to be authenticated via a JWT token or an access key.

Request

URL

POST /public/embeddings

Query Parameters

  • accessKey (String, required): The access key for authenticating the user.

Request Body

  • textList (Array of String): An array of text strings for which you wish to generate embeddings.

Response

Success Response

Status Code: 200 OK

Response Body:

The response will contain the embedding information generated by the OpenAI API.

Error Responses

No Access Key Provided

Status Code: 401 Unauthorized

Response Body:

{
"message": "no access key"
}

Example

Request:

POST /public/embeddings

Headers:

Authorization: Bearer jwt_token_here

Request Body:

[
"text1",
"text2"
]

Successful Response:

The response will contain the embedding information generated by the OpenAI API.

Notes

  • The model are configured in the backend (text-embedding-ada-002).