Optional providerProvider name. When supplied without model, the default embedding model
for the provider is resolved automatically from the built-in defaults.
`"openai"`, `"ollama"`, `"openrouter"`
Optional modelModel identifier. Accepts "provider:model" or plain model name with provider.
`"openai:text-embedding-3-small"`, `"nomic-embed-text"`
Text(s) to embed. Pass a single string for one embedding or an array for batch processing.
// Single input
input: 'Hello world'
// Batch input
input: ['Hello world', 'Goodbye world']
Optional dimensionsDesired output dimensionality. Only honoured by models that support
dimension reduction (e.g. OpenAI text-embedding-3-* with dimensions).
Ignored when the model has a fixed output size.
Optional apiOverride the API key instead of reading from environment variables.
Optional baseOverride the provider base URL (useful for local proxies or Ollama).
Optional usageOptional durable usage ledger configuration for helper-level accounting.
Options for an embedText call.
At minimum,
inputmust be provided. Provider/model resolution follows the same rules as generateText: supplyprovider,model(optionally inprovider:modelformat), or rely on env-var auto-detection.Example