Integration

Connect n8n to an OpenAI-compatible gateway

Configure n8n credentials and an OpenAI-compatible model route for repeatable AI automation workflows.

Choose the n8n credential path

For the OpenAI Chat Model node, use your own API credential rather than n8n Gateway credits. Where your installed node or credential exposes a custom Base URL, set the chat API prefix to https://api.sinorouter.ai/v1 and enter an enabled model ID. Use the SinoRouter key; an OpenAI account key is not a substitute. Leave OpenAI-specific organization fields blank unless your route explicitly requires them.

Keep Use Responses API turned off for a Chat Completions route. The official n8n node reference distinguishes these APIs; compatibility with chat completions does not establish support for Responses or its built-in tools. Keep credentials in n8n’s credential store, not in a Code node or workflow export.

If your installed node cannot set a custom endpoint or model ID, use an HTTP Request node. Add a Manual Trigger, connect HTTP Request, set Method to POST, and use the full chat endpoint below. Select Generic Credential Type > Header Auth and create a credential whose header name is Authorization and value is Bearer followed by your private key. Enable a JSON request body and enter the sample JSON. Authentication belongs in the credential, not in this example body.

POST https://api.sinorouter.ai/v1/chat/completions
Content-Type: application/json
Authorization: Bearer <stored in the n8n credential>

{
  "model": "YOUR_ENABLED_MODEL_ID",
  "messages": [{"role": "user", "content": "Reply with a short greeting."}],
  "stream": false
}

Build the smallest useful workflow

Start with a trigger, one model request, and a short response. Pass the model ID as a configured value, limit output length, and inspect the returned usage and error fields. Add memory, tools, file handling, and branching only after the basic request works.

The gateway root is https://api.sinorouter.ai/. Check whether your node adds /v1 automatically. A 404 often means the version path was omitted or added twice; a 401 usually means the credential or header is wrong.

Operate the workflow safely

Set timeouts and bounded retries, and avoid replaying a video or other asynchronous job without checking its status. Limit concurrency if your model or account has RPM or TPM limits. Redact prompts and API keys from execution logs before sharing a diagnostic.

This guide covers the connection pattern, not a completed authenticated n8n test. Confirm the exact node, model features, payload fields, and account limits against your installed n8n version and route.

  • Store the key as an n8n credential.
  • Confirm the final URL contains /v1 once.
  • Use the exact enabled model ID.
  • Review execution log retention and access.

Reference and next checks

Use the applicable provider or application documentation alongside your account-specific route information. These guides explain configuration and evaluation; they do not certify live support for every feature.