Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Embeddings request input

Example Usage

import { CreateEmbeddingsRequestBody } from "@openrouter/sdk/models/operations";

let value: CreateEmbeddingsRequestBody = {
  input: "The quick brown fox jumps over the lazy dog",
  model: "openai/text-embedding-3-small",
};

Fields

FieldTypeRequiredDescriptionExample
dimensionsnumber:heavy_minus_sign:The number of dimensions for the output embeddings1536
encodingFormatoperations.EncodingFormat:heavy_minus_sign:The format of the output embeddingsfloat
inputoperations.InputUnion:heavy_check_mark:Text, token, or multimodal input(s) to embedThe quick brown fox jumps over the lazy dog
inputTypestring:heavy_minus_sign:The type of input (e.g. search_query, search_document)search_query
modelstring:heavy_check_mark:The model to use for embeddingsopenai/text-embedding-3-small
providermodels.ProviderPreferences:heavy_minus_sign:N/A{"allow_fallbacks": true}
userstring:heavy_minus_sign:A unique identifier for the end-useruser-1234