POST
/
v3
/
openai
/
embeddings
Create embeddings
curl --request POST \
  --url https://api.novita.ai/v3/openai/embeddings \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '{
  "input": {},
  "model": {},
  "encoding_format": "<string>"
}'
{
  "object": "<string>",
  "data": [
    {
      "index": 123,
      "embedding": [
        {}
      ],
      "object": "<string>"
    }
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}
Creates an embedding vector representing the input text.

Request Headers

Content-Type
string
required
Enum: application/json
Authorization
string
required
Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

input
string | arrary
required
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for text-embedding-ada-002), cannot be an empty string, and any array must be 2048 dimensions or less.
model
enum<string>
required
ID of the model to use. Enum: baai/bge-m3.
encoding_format
string
The format to return the embeddings in. Can be either float or base64.

Response

object
string
required
Fixed as list
data
array
required
List of embeddings vectors generated by the model.
model
string
required
The ID of the model used.
usage
object
required
Usage information.