For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
    • Overview
    • Usage for Agents
  • TypeScript SDK
    • Overview
      • Analytics
      • APIKeys
      • Byok
      • Chat
      • Credits
      • Embeddings
      • Endpoints
      • Generations
      • Guardrails
      • OAuth
      • Observability
        • CreateEmbeddingsRequestBody
      • Organization
      • Presets
      • Providers
      • Rerank
      • Beta.Responses
      • Transcriptions
      • Speech
      • VideoGeneration
      • Workspaces
  • Python SDK
    • Overview
  • Go SDK
  • DevTools
    • Overview
    • Migrating to @openrouter/agent
LogoLogo
ModelsChatRankingsDocs
On this page
  • Example Usage
  • Fields
TypeScript SDKAPI ReferenceOperations

CreateEmbeddingsRequestBody - TypeScript SDK

CreateEmbeddingsRequestBody type definition
Was this page helpful?
Previous

Organization - TypeScript SDK

Organization method reference
Next
Built with

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