POST
/
v1
/
embeddings
curl --request POST \
  --url https://app.premai.io/v1/embeddings \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "project_id": 123,
  "model": "<string>",
  "encoding_format": "float",
  "input": "<string>"
}'
{
  "data": [
    {
      "index": 123,
      "embedding": [
        123
      ]
    }
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  },
  "provider_name": "<string>",
  "provider_id": "<string>"
}

Authorizations

Authorization
string
headerrequired

Body

project_id
integer
required

The ID of the project to use.

model
string
required

The model to generate the embeddings.

encoding_format
enum<string>
  • float - float
  • base64 - base64
Available options:
float,
base64
input
required

Embedding Input

Response

200 - application/json
data
object[]
required

The embeddings for the input.

model
string
required

The model to generate the embeddings.

usage
object
required

The usage statistics for the completion.

provider_name
string
required

The name of the provider that generated the completion.

provider_id
string
required

The ID of the provider that generated the completion.