Dedicated.Embeddings

Embeddings

Creates an embedding vector representing the input text.

post/dedicated/v1/embeddings

Request

Headers

X-Friendli-Teamstring nullable

ID of team to run requests as (optional parameter).

Request body

modelstring required

ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone.

tokensinteger[] nullable

The tokenized prompt (i.e., input tokens).

Either input or tokens field is required.

encoding_format'float' | 'base64' nullable

The format to return the embeddings in. Can be either float or base64.

Example request

{
  "encoding_format": "float",
  "input": "The food was delicious and the waiter...",
  "model": "(endpoint-id)"
}

Response

Successfully generated embeddings.

idstring required

A unique ID of the embeddings.

modelstring nullable

The model to generate the embeddings. For dedicated endpoints, it returns the endpoint id.

object'list' required

The object type, which is always set to list.

createdinteger required

The Unix timestamp (in seconds) for when the embeddings were created.

Example response

{
  "usage": {
    "prompt_tokens": 5,
    "completion_tokens": 7,
    "total_tokens": 12
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.