POST
/
inference
/
embeddings
curl --request POST \
  --url https://api.nugen.in/inference/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "input": "The quick brown fox jumped over the lazy dog",
  "model": "nugen-embed-legal",
  "dimensions": "None"
}'
{
  "created": 1623645497,
  "data": [
    {
      "embedding": [
        0.007897645,
        -0.006754357,
        0.007654689
      ],
      "index": 0
    }
  ],
  "id": "nugen-1234",
  "model": "nugen-embed-legal",
  "usage": {
    "total_tokens": 25
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
input
required

Input text to embed, encoded as a string or a list of strings. To embed multiple inputs in a single request, pass a list of strings. The input must not exceed the max input tokens for the model, cannot be an empty string.

Example:

"The quick brown fox jumped over the lazy dog"

model
string
required

The name of the model used to generate the embedding.

Example:

"nugen-embed-legal"

dimensions
integer | null

(Applicable for only Resizable Matryoshka Embedding models) The number of dimensions the resulting output embeddings should have.

Example:

"None"

Response

200
application/json
Successful Response
id
string
required

A unique identifier of the response.

data
object[]
required

The list of embeddings generated by the model.

model
string
required

The name of the model used to generate the embedding.

created
number
required

The Unix time in seconds when the response was generated.

usage
object
required

The usage information for the request.