DeepFellow DOCS

Create Embeddings

POST
/v1/embeddings

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

Authorization

headerAuthorizationBearer <token>

Header Parameters

OpenAI-Organization?|

Organization Id from OpenAi compatible endpoint. Required to organization access or project access (with OpenAI-Project header) when logged as User or Admin User.

OpenAI-Project?|

Project Id from OpenAi compatible endpoint. Required to project access for organization api key or User / Admin User access with OpenAI-Organization

Request Body

application/json
  1. body
input*|array<string>|array<integer>|array<array<integer>>

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 all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. In addition to the per-input token limit, all embedding models enforce a maximum of 300, 000 tokens summed across all inputs in a single request.

model*|

ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.

dimensions?|

The number of dimensions the resulting output embeddings should have.

encoding_format?|

The format to return the embeddings in.

user?|

A unique identifier for the end-user

Response Body

Successful Response

application/json
  1. response
data*array<>

List of embeddings

object?string

Object type, always 'list[Embedding]'

Default"list"
model*string

ID of the model used for embedding

usage*

Usage information for the embedding(s)

Example Request
curl -X POST 'https://deepfellow-server-host/v1/embeddings' \  -H 'Content-Type: application/json' \  -d '{  "encoding_format": "float",  "input": "Hello, how are you?",  "model": "llama3"}'
Example Response
{  "data": [    {      "object": "embedding",      "embedding": [        -0.009327292,        -0.0028842222      ],      "index": 0    }  ],  "object": "list",  "model": "llama3",  "usage": {    "prompt_tokens": 0,    "total_tokens": 0  }}

We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.