n8n
Use cheapaimodel models in n8n AI Agent and LLM chain workflows through the OpenAI credential.
n8n's OpenAI credential has a Base URL field. Point it at cheapaimodel, then use the credential in the OpenAI Chat Model sub-node of an AI Agent or Basic LLM Chain.
| n8n setting | Value | |
|---|---|---|
| Base URL | Base URL (OpenAI credential) | https://api.cheapaimodel.ai/v1 |
| API key | API Key (OpenAI credential) | Your key from the console's API Keys page |
| Model ID | Model (OpenAI Chat Model) | deepseek-v4-1-flash, or any ID from the catalog |
Set it up
Create the credential
Create a new OpenAI credential and fill in:
- API Key: your cheapaimodel key.
- Organization ID (optional): leave empty.
- Base URL:
https://api.cheapaimodel.ai/v1.
Save it. n8n tests the credential by requesting /v1/models with the key.
Add the chat model
On an AI Agent or Basic LLM Chain node, attach OpenAI Chat Model to the Chat Model input and select the credential. Under Model, use From List to pick from the models your key can use, or ID to type deepseek-v4-1-flash.
Use Responses API is on by default and sends requests to /v1/responses; turned off, the node uses /v1/chat/completions. The catalog's models list both. Leave Built-in Tools empty: Web Search, File Search and Code Interpreter run on OpenAI's platform, not on cheapaimodel.
An AI Agent's tool use depends on the model's tool calling. If a model handles tools poorly, try another model from the catalog.
The OpenAI node
The standalone OpenAI node uses the same credential, but most of its operations call endpoints cheapaimodel doesn't serve: images, audio, files, video, conversations and Classify Text for Violations. Use it only for Text → Message a Model, or use the OpenAI Chat Model sub-node above.
cheapaimodel has no embeddings models yet. For vector stores, connect an embeddings node backed by another provider, not this credential.
Common mistakes
- The credential test fails with
404andfault filter abort. Base URL is missing/v1. Sethttps://api.cheapaimodel.ai/v1. - The workflow fails with
404andInvalid URL (POST /v1/chat/completions/responses). Base URL includes the endpoint path; with Use Responses API off the doubled path ends in/chat/completions/chat/completionsinstead. n8n adds the path itself; sethttps://api.cheapaimodel.ai/v1. 401. The key is wrong, expired or out of budget. Check it in the console.503withmodel_not_found. The ID typed in ID mode doesn't match the catalog. Switch to From List or fix the spelling.