# n8n

Use sivcloud in n8n through the OpenAI credential or the HTTP Request node.

n8n can call sivcloud because its API is OpenAI-compatible. You need an API key from the [API keys](https://sivcloud.com/en/docs/console/api-keys/) page and a model id from the Models page in the console.

## OpenAI credential

1. In n8n, create a new credential of type **OpenAI**.
2. Put your sivcloud API key in **API Key**.
3. Set the base URL to `https://ai.sivcloud.com/v1`. If your n8n version shows no base URL field in the credential, look for it in the node options; its name can differ between versions.
4. Save, then run the connection test if there is one. The n8n test calls the model list; if it fails but the chat node works, ignore it.

## OpenAI Chat Model node

1. Add the **OpenAI Chat Model** node as a sub-node of an AI Agent or a Basic LLM Chain.
2. Pick the sivcloud credential.
3. Type the model id from the Models page, for example `deepseek-v4.1-flash`. The built-in n8n list is OpenAI's own, so a sivcloud model id has to be typed.
4. Leave **Use Responses API** off so n8n uses chat completions.

n8n's built-in OpenAI tools such as web search and file search are not available through sivcloud.

## Another way: the HTTP Request node

If the node above does not fit, send the request yourself:

- Method `POST`, URL `https://ai.sivcloud.com/v1/chat/completions`.
- Header `Authorization` set to `Bearer <your API key>`, and `Content-Type` set to `application/json`.
- JSON body:

```json
{
  "model": "deepseek-v4.1-flash",
  "messages": [{ "role": "user", "content": "Hello" }]
}
```

The full format is on the [endpoint page](https://sivcloud.com/en/docs/chat-completions/).

## Common errors

- `401`: the API key is wrong, blocked or expired. Check the key in the console.
- `402`: the balance is empty. Add balance on the [Balance](https://sivcloud.com/en/docs/console/balance/) page.
- `404`: the model id does not exist. Copy the id exactly from the Models page.

The full list is on [Error codes](https://sivcloud.com/en/docs/errors/). Do not put the API key in a workflow you share; keep it in an n8n credential.
