Skip to main content
POST
/
v1
/
embeddings
Typescript
const client = new Dedalus();

const result = await client.embeddings.create({ ...params });
{
  "data": [
    {
      "index": 123,
      "embedding": [
        123
      ],
      "object": "<string>"
    }
  ],
  "model": "<string>",
  "object": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}

Overview

Create embeddings using any supported embedding model. Embeddings are vector representations of text that can be used for semantic search, clustering, and similarity comparisons.

Usage Examples

curl -X POST https://api.dedaluslabs.ai/v1/embeddings \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/text-embedding-3-small",
    "input": "The quick brown fox jumps over the lazy dog"
  }'

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Schema for EmbeddingRequest.

Fields:

  • input (required): str | Annotated[list[str], MinLen(1), MaxLen(2048), ArrayTitle("EmbeddingRequestInputArray")] | Annotated[list[int], MinLen(1), MaxLen(2048), ArrayTitle("EmbeddingRequestInputArray")] | Annotated[list[Annotated[list[int], MinLen(1), ArrayTitle("EmbeddingRequestInputItemArray")]], MinLen(1), MaxLen(2048), ArrayTitle("EmbeddingRequestInputArray")]
  • model (required): str | Literal["text-embedding-ada-002", "text-embedding-3-small", "text-embedding-3-large"]
  • 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. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.

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

Schema for EmbeddingResponse.

Fields:

  • data (required): list[Embedding]
  • model (required): str
  • object (required): Literal["list"]
  • usage (required): Usage
data
Embedding · object[]
required

The list of embeddings generated by the model.

model
string
required

The name of the model used to generate the embedding.

object
string
required

The object type, which is always "list".

Allowed value: "list"
usage
Usage · object
required

The usage information for the request.

Last modified on April 9, 2026