# n8n

> Connecting n8n through OpenAI credentials with the gateway Base URL — for AI Agent and Basic LLM Chain.

n8n works with the gateway through the standard OpenAI credentials — they have
a Base URL field.
For an overview and model pricing, see [n8n on llmbox](/en/tools/n8n).

## Quick start

1. Open Credentials → Create credential and pick OpenAI.
2. API Key — your key from the cabinet.
3. Base URL: https://llmbox.cc/v1
4. Save: n8n checks the key with a request to `GET /v1/models`.
5. Add an AI Agent or Basic LLM Chain node to your workflow and attach an
   OpenAI Chat Model with these credentials.
6. In the Model field choose By ID and enter an ID from the
   [model catalog](https://llmbox.cc/en/models), e.g. `openai/gpt-5.6-sol`.

## How it works

- The OpenAI Chat Model node sends requests to `/v1/chat/completions` with your
  key; usage shows up in the cabinet.
- Tools attached to an AI Agent (calculator, HTTP request, other workflows) go
  to the model as regular functions; the gateway passes them as is.
- Every agent step is a separate request, so a workflow with tools uses more
  tokens than a single question to the model.

## Troubleshooting

| Symptom | Cause and fix |
| --- | --- |
| The credential test fails | Wrong key or a typo in the Base URL — it must end with `/v1`; copy it from step 3. |
| `404 model_not_found` | The model ID has a typo — check `GET /v1/models`. |
| `401 invalid_api_key` | Wrong or revoked key. |
