Lunos

Documentation

Integration: Using Lunos/OpenRouter with n8n

You can easily integrate Lunos (or any OpenRouter-compatible API) with n8n to automate workflows and connect with hundreds of other services. n8n supports OpenAI-compatible APIs, so you can use the OpenAI node with a custom Base URL.

Note: Not all AI models support tool calls (function calling or code interpreter). Please check the model documentation and pick a model that supports the features you need.

  1. Set up OpenAI Credentials: In n8n, create new OpenAI credentials. In the credentials form, set the Base URL to https://api.lunos.tech/v1 (or your OpenRouter endpoint).
  2. Use the OpenAI Node: Add an OpenAI node to your workflow. Select your custom credentials. You can now use any supported model by specifying its model ID (e.g., openai/gpt-4o).
  3. Dynamic Model Selection: You can set the model property dynamically using expressions or workflow variables, allowing you to switch models on the fly.
  4. Example: To use OpenRouter in n8n versions before 1.78, simply use the OpenAI node with the custom Base URL. For n8n 1.78 and above, a dedicated OpenRouter node is available.

Tip: See the n8n OpenRouter workflow example for a ready-to-use template and more details.