n8n-nodes-openrouter-embeddings
v0.2.0
Published
n8n community sub-node for OpenRouter Embeddings – access embedding models from multiple providers via OpenRouter's unified API
Maintainers
Readme
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=1for detailed request/response logs
Installation
Community Node (Recommended)
- In n8n, go to Settings → Community Nodes
- Search for
n8n-nodes-openrouter-embeddings - Click Install
Manual Installation
npm install n8n-nodes-openrouter-embeddingsSetup
Prerequisites
- An OpenRouter account
- An API key – create one at https://openrouter.ai/keys
Authentication
- In n8n, go to Credentials → New Credential
- Search for OpenRouter API
- 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
- Add a vector store node to your workflow (e.g., Pinecone, Qdrant, Supabase)
- Connect Embeddings OpenRouter to the embeddings input
- Select your OpenRouter API credential
- Pick a model from the dropdown (e.g.,
openai/text-embedding-3-small) - 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/embeddingsFull 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
