n8n
n8n can use Maritaca models through the OpenAI Chat Model sub-node. The configuration below was validated on n8n 2.30.7 with both a simple chain and an agent that executes a tool.
Prerequisites
- An n8n Cloud or self-hosted instance.
- A key created in the Maritaca platform.
Keep the MARITACA_API_KEY value outside the workflow and only store it in an
n8n credential.
Create the credential
- Go to Settings > Credentials > Add Credential.
- Search for OpenAI.
- In API Key, paste the value of your
MARITACA_API_KEY. - Set Base URL to
https://chat.maritaca.ai/api. - Save it with a name such as Maritaca AI.
Configure OpenAI Chat Model
Add OpenAI Chat Model to the chain or agent's Chat Model slot and set:
- Credential:
Maritaca AI. - Model: select ID mode and enter
sabia-4orsabia-4-thinking. - Use Responses API: disabled.
Disabling Use Responses API makes the sub-node use Chat Completions, which is the flow validated in the examples below.
Regular call with Basic LLM Chain
Build this workflow:
Manual Trigger → Basic LLM Chain
│
OpenAI Chat Model
- In Basic LLM Chain, select Define below for the prompt.
- Enter
What is 25 + 27? Include 52 in the answer.. - Connect the configured OpenAI Chat Model.
- Execute the workflow and inspect the chain output.
Agent with Calculator
Build this workflow:
Manual Trigger → AI Agent
├── OpenAI Chat Model
└── Calculator
- In AI Agent, select Define below for the prompt.
- Enter
Use the Calculator tool to calculate 6 times 7.. - Connect OpenAI Chat Model to the Chat Model slot.
- Add Calculator to the Tool slot.
- Execute the workflow; the final answer should include
42.
HTTP Request alternative
For a direct request, configure an HTTP Request node:
- Method:
POST. - URL:
https://chat.maritaca.ai/api/chat/completions. - Authentication:
Header Auth. - Header Name:
Authorization. - Header Value:
Bearer YOUR_API_KEY. - Content-Type:
application/json. - Body:
{
"model": "sabia-4",
"messages": [
{
"role": "user",
"content": "What is 25 + 27? Include 52 in the answer."
}
],
"max_tokens": 100
}
To use the reasoning model, only change model to sabia-4-thinking. Do not
put the API key directly in the workflow JSON.