Learn / How to use Netra Runtime with n8n

How to use Netra Runtime with n8n

n8n is a workflow automation platform with built-in AI nodes: AI Agents, chat models, chains, and classifiers. Those nodes speak the OpenAI protocol, and the OpenAI credential in n8n accepts a custom base URL. That means a model served by Netra Runtime can power your n8n workflows with one credential change, no custom code.

What you need

  • An n8n instance (Cloud or self-hosted) that can reach your Netra endpoint over the network.
  • A Netra Runtime API key from your dashboard at app.netraruntime.com. The API base URL is https://api.netraruntime.com/v1 (self-hosted deployments use their own endpoint URL instead).

Step 1: create the credential

In n8n, open Credentials → Add credential → OpenAI and fill in:

Field Value
API KeyYour Netra API key
Base URLhttps://api.netraruntime.com/v1
Organization IDLeave empty

Name the credential something recognizable, like "Netra Runtime", so it's easy to pick in nodes. The credential test calls the models endpoint on your base URL; if it passes, the connection works. The fields are documented in n8n's OpenAI credentials reference.

Step 2: use it in AI nodes

Add an AI Agent (or any chain node) to your workflow, attach an OpenAI Chat Model as its language model, and select your Netra credential on that node. In the model field, enter the exact model id, for example qwen3.6-35b; the API's /v1/models endpoint lists the current set. If the model dropdown populates, it is reading that list live; if it doesn't, switch the field to expression or ID mode and type the id.

The same credential works in the OpenAI node for one-shot prompts, in the Question and Answer chain for RAG, and in the Text Classifier node.

Alternative: the HTTP Request node

If you want full control over the request body, or a node version handles custom base URLs inconsistently, call the API directly with an HTTP Request node. Set the method to POST, the URL to your chat completions endpoint, add an Authorization header, and send JSON:

POST https://api.netraruntime.com/v1/chat/completions
Authorization: Bearer YOUR_NETRA_API_KEY
Content-Type: application/json

{
    "model": "qwen3.6-35b",
    "messages": [
        { "role": "user", "content": "{{ $json.prompt }}" }
    ]
}

The response arrives in the standard OpenAI shape, so the answer text is at choices[0].message.content.

Troubleshooting

  • Credential test passes but the node fails at runtime. Known quirk of some OpenAI node versions with custom base URLs. Use the OpenAI Chat Model node under an AI Agent, or fall back to HTTP Request.
  • 404 errors. The Base URL must end at /v1, without /chat/completions; the node appends the path itself.
  • Connection timeout on self-hosted n8n. The n8n container must have a network route to your endpoint. For an endpoint on the same host, use host.docker.internal instead of localhost.

Frequently asked questions

Can n8n use an OpenAI-compatible API that isn't OpenAI?

Yes. The OpenAI credential in n8n has a Base URL field. Point it at any OpenAI-compatible endpoint, such as a Netra Runtime deployment, and nodes using that credential will call your endpoint instead of api.openai.com.

Does this work on both n8n Cloud and self-hosted n8n?

Yes, as long as the n8n instance can reach your Netra endpoint over the network. A publicly reachable endpoint works from n8n Cloud; an endpoint inside a VPC or on-prem network needs a self-hosted n8n instance inside that network.

What if a node ignores my custom base URL?

Some versions of the OpenAI node have handled custom base URLs inconsistently. The OpenAI Chat Model node used with the AI Agent is the most reliable path, and the HTTP Request node calling /v1/chat/completions directly always works.

Related