> For the complete documentation index, see [llms.txt](https://docs.cortecs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortecs.ai/integration-examples/agents-and-automations/n8n.md).

# n8n

[n8n](https://n8n.io/) is a workflow automation platform with built-in AI nodes. Because Cortecs provides an OpenAI-compatible API, you can use Cortecs models in n8n without installing a community node.

{% hint style="info" %}
Before you begin, create a Cortecs API key by following the [Quickstart](/quickstart.md) and choose a model from the [model catalog](https://cortecs.ai/serverlessModels).
{% endhint %}

## 1. Create a Cortecs credential

1. In n8n, open **Credentials**, create a credential, and select **OpenAI**.
2. Enter the following values:
   * **API Key:** Your Cortecs API key
   * **Base URL:** `https://api.cortecs.ai/v1`
   * **Organization ID:** Leave blank
3. Save the credential.

## 2. Add a Cortecs model

1. Add an **OpenAI Chat Model** node to an AI Agent, Basic LLM Chain, or another AI workflow.
2. Select the Cortecs credential.
3. Select a model or enter its exact model ID from the [model catalog](https://cortecs.ai/serverlessModels).
4. Leave **Use Responses API** enabled. It is the n8n default and the recommended option for AI Agent workflows. Disable it only if you need the Cortecs Chat Completions endpoint.
5. Run the workflow to test the connection.

For an **AI Agent**, choose a model that supports tool calling.

For API details, see the Cortecs [Responses API](https://docs.cortecs.ai/api-overview/responses-beta). For node-specific options, see the [n8n OpenAI Chat Model documentation](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/).
