Skip to main content
POST
/
dedicated
/
v1
/
embeddings
Embeddings
curl --request POST \
  --url https://api.friendli.ai/dedicated/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "encoding_format": "float",
  "input": "The food was delicious and the waiter...",
  "model": "(endpoint-id)"
}'
{
  "id": "embd-26a1e10db1311bc2adb488d2d205288b",
  "model": "(endpoint-id)",
  "object": "list",
  "data": [
    {
      "index": 0,
      "object": "embedding",
      "embedding": [
        0.0023064255,
        -0.009327292,
        -0.0028842222
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 26,
    "completion_tokens": 0,
    "total_tokens": 26
  },
  "created": 1735722153
}
Creates an embedding vector representing the input text. To request successfully, it is mandatory to enter a Friendli Token (e.g. flp_XXX) value in the Bearer Token field. Refer to the authentication section on our introduction page to learn how to acquire this variable and visit here to generate your token.

Authorizations

Authorization
string
header
required

Headers

X-Friendli-Team
string | null

Body

application/json
model
string
required
Examples:
input
required
Examples:
encoding_format
enum<string> | null
default:float
Available options:
float,
base64

Response

id
string
required
object
string
required
Allowed value: "list"
data
EmbeddingObject · object[]
required
usage
object
required
created
integer
required
model
string | null