openrouter-embed

n8n community sub-node for OpenRouter Embeddings – access embedding models from multiple providers via OpenRouter's unified API

Package Information

Released: 4 mo ago
Downloads: 16 weekly / 203 monthly
Latest Version: 0.1.0

Documentation

n8n-nodes-openrouter-embeddings

An n8n community sub-node that lets you generate text embeddings through OpenRouter's unified API. Access embedding models from OpenAI, Cohere, Google, and many other providers with a single credential.

Features

  • Multi-provider access – use OpenAI, Cohere, Google, and other embedding models through one API
  • Dynamic model list – models are loaded directly from the OpenRouter API so you always see the latest options
  • Batch processing – configurable batch size for efficient bulk embedding
  • Drop-in sub-node – works with every n8n vector store and AI chain node
  • Simple auth – only requires an OpenRouter API key
  • Debug logging – set N8N_NODES_DEBUG=1 for detailed request/response logs

Installation

Community Node (Recommended)

  1. In n8n, go to Settings → Community Nodes
  2. Search for n8n-nodes-openrouter-embeddings
  3. Click Install

Manual Installation

npm install n8n-nodes-openrouter-embeddings

Setup

Prerequisites

  1. An OpenRouter account
  2. An API key – create one at https://openrouter.ai/keys

Authentication

  1. In n8n, go to Credentials → New Credential
  2. Search for OpenRouter API
  3. Paste your API key and save

Usage

This is a sub-node that supplies embeddings to other n8n AI nodes (vector stores, chains, agents).

Using with Vector Stores

  1. Add a vector store node to your workflow (e.g., Pinecone, Qdrant, Supabase)
  2. Connect Embeddings OpenRouter to the embeddings input
  3. Select your OpenRouter API credential
  4. Pick a model from the dropdown (e.g., openai/text-embedding-3-small)
  5. Configure options as needed

Example Workflow

[Document Loader] → [Vector Store] ← [Embeddings OpenRouter]
                          ↓
                    [AI Agent / Chain]

Configuration

Parameter Description
Model Embedding model to use. The dropdown is populated dynamically from the OpenRouter API. Default: openai/text-embedding-3-small.
Strip New Lines Remove \n characters before embedding (default: true).
Batch Size Maximum texts per API call (default: 100). Lower this if you hit rate limits.

Popular Models

Browse all available models at https://openrouter.ai/models?output_modalities=embeddings.

Some commonly used models:

Model ID Provider Notes
openai/text-embedding-3-small OpenAI Fast, cost-effective, 1 536 dimensions
openai/text-embedding-3-large OpenAI Higher quality, 3 072 dimensions
cohere/embed-multilingual-v3.0 Cohere Excellent multilingual support
google/text-embedding-004 Google 768 dimensions

Use Cases

  • RAG (Retrieval-Augmented Generation) – embed documents and queries for context retrieval
  • Semantic Search – find relevant documents by meaning instead of keywords
  • Document Similarity – compare and cluster documents in a vector store
  • Classification & Clustering – group or categorize text by embedding proximity

Compatible Nodes

Works with any n8n node that accepts an embeddings sub-node, including:

  • Simple Vector Store
  • Pinecone Vector Store
  • Qdrant Vector Store
  • Supabase Vector Store
  • PGVector Vector Store
  • Milvus Vector Store
  • MongoDB Atlas Vector Store
  • Zep Vector Store
  • Question and Answer Chain
  • AI Agent nodes

Troubleshooting

Error Cause Fix
401 Unauthorized Invalid or missing API key Verify your key at https://openrouter.ai/keys
402 Payment Required Insufficient credits Top up your OpenRouter balance
404 Not Found Model doesn't exist or isn't an embedding model Check the model ID and the models page
429 Too Many Requests Rate limit exceeded Lower the batch size or add delays
529 Provider Overloaded Upstream provider is overloaded Retry later or try a different model

API Reference

This node calls the OpenRouter Embeddings API:

POST https://openrouter.ai/api/v1/embeddings

Full API docs: https://openrouter.ai/docs/api/reference/embeddings

Contributing

Contributions are welcome! Please open a Pull Request or Issue.

License

MIT

Changelog

0.1.0

  • Initial release
  • OpenRouter embeddings support with dynamic model loading
  • Batch processing with configurable batch size
  • Strip new-lines option
  • Custom credential with connection test

Discussion