# Point n8n at kenari

> n8n's AI Agent only takes an OpenAI credential, and that credential works with any OpenAI-compatible endpoint. Three fields: a kn- API Key, the kenari Base URL, and a model id ending in :free.

Source: https://kenari.id/en/blog/point-n8n-at-kenari
Published: 2026-08-18
Author: kenari team

---
Drop an **AI Agent** node onto the canvas and it will not run until you fill in an OpenAI credential, when all the workflow needs is one model it can call.

n8n's OpenAI credential works with any OpenAI-compatible endpoint, and kenari is one, so three fields cover the move: **API Key** takes your `kn-`, **Base URL** points at kenari, **Model** an id ending in `:free`.

Coding editors (Claude Code, Codex, OpenCode) get their own post, since the setup differs: [Point your editor at kenari](/en/blog/point-your-editor-at-kenari). This one stays on n8n.

## n8n's AI Agent runs from sub-nodes

**AI Agent** is a root node, which means it never calls a model on its own. You attach a chat-model sub-node underneath it plus one or more tools, and the agent works out which tool to reach for.

The n8n docs require at least one tool on an AI Agent, so the node stays incomplete until you give it one. To just smoke-test the connection, skip the agent and put an **OpenAI Chat Model** on a **Basic LLM Chain**, since the credential behind both is identical.

What matters is that the model in n8n comes from the OpenAI credential, not from a "Kenari" node that does not exist. n8n's own credential, pointed at a compatible gateway, does the whole job.

## The credential fields that actually exist

n8n calls the credential type **OpenAI**. From current n8n source, these are the fields it really has:

| Field | Required | Value for kenari |
| --- | --- | --- |
| **API Key** | yes | `kn-...` from the kenari dashboard |
| **Organization ID (optional)** | no | leave blank |
| **Base URL** | no, has a default | `https://kenari.id/v1` |
| **Add Custom Header** | no | leave off |

The default Base URL is `https://api.openai.com/v1`, so replace the whole value rather than editing its tail. The usual slip is appending `/v1` onto a URL that already ends in one, and `https://kenari.id/v1/v1/...` usually comes back `405`.

n8n's credential test calls `GET {Base URL}/models`, and `GET https://kenari.id/v1/models` is public and live, so a green test means n8n already read the same catalog you would.

The header n8n sends is `Authorization: Bearer <API Key>`, exactly the format kenari expects. Fill in Organization ID and n8n also sends `OpenAI-Organization`, which does nothing here, so leave that field empty and the custom header switch off.

## Three values, then attach the agent

### 1. A `kn-` key

Sign in to the [dashboard](https://kenari.id/login), open **API keys**, and click **Create key**. The key starts with `kn-` and is shown exactly once, so copy it before you close the dialog, and that one key covers every model and both protocols. Store it in the credential as the **API Key**, never in the workflow chat.

### 2. Base URL

```
https://kenari.id/v1
```

That is a straight swap for `https://api.openai.com/v1`, and n8n appends the rest of the path, whether that is `/chat/completions` or `/models`.

### 3. A `:free` model

On the **OpenAI Chat Model** node, the **Model** field loads dynamically from `/models` on whichever Base URL the credential carries, so type or pick an id exactly as the catalog spells it. For a first run on an empty balance, `step-3-7-flash:free` does the job: when we checked it sat in the catalog with `pricing.free: true` and `tool_call: true`, and AI Agent needs that second flag.

The list changes, so do not memorize an id. Check instead:

```bash
curl https://kenari.id/v1/models
```

Look for an `id` ending in `:free`, or `pricing.free: true` on the entry. Do not stop at the suffix though. When we checked, the catalog held 16 `:free` ids and only 14 of them carried `tool_call: true`. Two did not.

Pick one of those two and the AI Agent still runs, still answers, and still looks healthy. The only thing that never happens is the tool call, and nothing in the output tells you so. Read the `tool_call` flag, not just the suffix.

How to choose a free model, and how they differ from PAYG or BYOK, is in [Try a free model first](/en/blog/try-a-free-model-first).

## Put it on the canvas

![n8n AI Agent canvas](/blog/images/n8n-ai-agent-canvas.png)

1. Add **AI Agent**.
2. Attach **OpenAI Chat Model** to the model slot, pick the credential whose Base URL points at kenari, and set **Model** to `step-3-7-flash:free`.
3. Leave **Use Responses API** off. Reason below.
4. Attach at least one n8n tool (HTTP Request, Wikipedia, or your own workflow tool) and let AI Agent decide when to call it.
5. Run it once. If `choices` or the agent output comes back with an answer in it, the credential works.

Other workflows already on that credential move across with it, so there are no nodes to replace.

## About the Use Responses API toggle

The toggle reads like the newer option, so reaching for it is a fair instinct. For n8n, leave it off.

n8n defaults to Chat Completions at `/v1/chat/completions`, the path we serve for OpenAI-compat clients. kenari accepts `/v1/responses` as well, but only as a stateless subset: `previous_response_id` is rejected, and tool types other than `function` are dropped with no message at all.

That last part is what sends people in circles. The built-in tools behind the toggle, Web Search, File Search, and Code Interpreter, all belong to OpenAI, not to the n8n tools you attached on the canvas. Turn the toggle on and those tools drop out of the request, with nothing in the response to say where they went.

## If you get stuck

- Credential test red, or `401`: the key is wrong, truncated on the paste, or still an `sk-`. Copy the `kn-...` again.
- `model_not_found`: the id has a typo, or the dropdown still holds an OpenAI id. Take it straight from `GET /v1/models`.
- `402 insufficient_balance`: a model without `:free` on a Rp 0 balance. Switch to a `:free` id, or [top up first](/en/blog/pay-for-tokens-with-qris).
- `405`: the Base URL is the wrong shape. It must be `https://kenari.id/v1`, not bare `https://kenari.id` and not `.../v1/v1`.
- `429` with `free_quota_rpm` or `free_quota_daily`: the free-model rate limit. Read `Retry-After` and wait, or move to a paid model with balance.

None of this shifts between n8n Cloud and self-hosted n8n, since only the field values differ.