Skip to main content
POST
/
v1
/
embeddings
Create Embeddings
curl --request POST \
  --url https://api.dedaluslabs.ai/v1/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": "<string>",
  "model": "<string>",
  "encoding_format": "float",
  "dimensions": 2,
  "user": "<string>"
}
'
{
  "data": [
    {
      "embedding": [
        123
      ],
      "index": 123,
      "object": "embedding"
    }
  ],
  "model": "<string>",
  "usage": {},
  "object": "list"
}

Authorizations

Authorization
string
header
required

API key authentication using Bearer token

Body

application/json

Fields:

  • input (required): str | Annotated[list[str], MinLen(1), MaxLen(2048)] | Annotated[list[int], MinLen(1), MaxLen(2048)] | Annotated[list[Annotated[list[int], MinLen(1)]], MinLen(1), MaxLen(2048)]
  • model (required): str | Literal['openai/text-embedding-ada-002', 'openai/text-embedding-3-small', 'openai/text-embedding-3-large', 'google/text-embedding-004']
  • encoding_format (optional): Literal['float', 'base64']
  • dimensions (optional): int
  • user (optional): str
input
required

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. Example Python code for counting tokens. 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
required

ID of the model to use. See our Model Providers for available embedding models.

encoding_format
enum<string>
default:float

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

Available options:
float,
base64
dimensions
integer

The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.

Required range: x >= 1
user
string

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Response

Successful Response

Response from embeddings endpoint.

data
Embedding · object[]
required

List of embedding objects

model
string
required

The model used for embeddings

usage
Usage · object
required

Usage statistics (prompt_tokens, total_tokens)

object
string
default:list

Object type, always 'list'

Allowed value: "list"