Use MagmaRouter in n8n.
n8n's OpenAI credential has a Base URL field. Point it at MagmaRouter. One node setting matters: the OpenAI Chat Model node defaults to the Responses API, which MagmaRouter does not serve.
The OpenAI credential
Create an OpenAI credential and set:
- API Key: your rl-... key
- Base URL: https://magmarouter.com/v1 (the field defaults to https://api.openai.com/v1)
n8n sends the key as an Authorization: Bearer header and tests the credential against /models, which MagmaRouter answers.
Turn off Use Responses API
The one setting that breaks it The OpenAI Chat Model node (version 1.3 and up) defaults "Use Responses API" to on, which posts to /v1/responses and 404s on MagmaRouter. Turn it off so the node uses Chat Completions. Built-in tools that depend on the Responses API will not be available, which is expected.
With the credential and that toggle set, the OpenAI Chat Model node feeds the AI Agent node as normal. Pick a tool-capable model if the agent uses tools.