CreateEmbeddingsRequestBody - TypeScript SDK

CreateEmbeddingsRequestBody type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Embeddings request input

Example Usage

1import { CreateEmbeddingsRequestBody } from "@openrouter/sdk/models/operations";
2
3let value: CreateEmbeddingsRequestBody = {
4 input: "The quick brown fox jumps over the lazy dog",
5 model: "openai/text-embedding-3-small",
6};

Fields

FieldTypeRequiredDescriptionExample
inputoperations.InputUnion✔️Text, token, or multimodal input(s) to embedThe quick brown fox jumps over the lazy dog
modelstring✔️The model to use for embeddingsopenai/text-embedding-3-small
encodingFormatoperations.EncodingFormatThe format of the output embeddingsfloat
dimensionsnumberThe number of dimensions for the output embeddings1536
userstringA unique identifier for the end-useruser-1234
providermodels.ProviderPreferencesProvider routing preferences for the request.
inputTypestringThe type of input (e.g. search_query, search_document)search_query