Want to test an n8n AI workflow with one controlled request? Create a BetterToken account and API Key, then open the n8n instructions and add an OpenAI credential. Connect Manual Trigger, AI Agent, and OpenAI Chat Model; limit Max Retries; then match the manual execution to its model, status, Token usage, and charge in the BetterToken Dashboard.
You need your own API key for this credential. Create a BetterToken account
For the first test, request the exact one-line result N8N_OK_4; a prompt alone does not guarantee formatting.
What does n8n do in this AI process
n8n manages the node sequence and stores execution data. OpenAI Chat Model sends a request to the selected model, and BetterToken receives an OpenAI-compatible API call. For the first test, three components are enough:
Manual Trigger → AI Agent
└─ OpenAI Chat Model
Manual Trigger prevents an accidental run from a schedule or webhook. The AI Agent receives a fixed prompt, and the Chat Model sends one model request. Do not add Telegram, email, database, publishing, or any other node with external side effects.
BetterToken in this scheme is responsible for the API Key, Base URL, available Model ID and usage record in the Dashboard. It does not guarantee compatibility of all community nodes or OpenAI-hosted tools.
Regional availability note
From Russia, the BetterToken API endpoint can be reached without a VPN. The availability of n8n Cloud, a self-hosted server, and third-party integrations is checked separately.
How to create a credential without leaking the API Key
- Add the AI Agent node to the workflow.
- In the Chat Model connector, add the OpenAI Chat Model subnode.
- In the Credential to connect with field, select Create new credential → OpenAI.
Fill in the credential:
- API Key: your API Key BetterToken.
- Organization ID: leave blank.
-
Base URL:
https://www.bettertoken.ai/v1.
Save the credential in the n8n secure storage. Do not insert the key into a prompt, workflow JSON, Code node, screenshot, execution data, or repository.
Please check the official OpenAI credential documentation in n8n for current fields and authorization modes.
Base URL must end with /v1. Do not append /models, /chat/completions, or /responses: use exactly the Base URL in the current BetterToken instructions.
If the model list does not appear, reopen the credential and OpenAI Chat Model. Take the exact Model ID from the current BetterToken documentation for n8n or model catalog; this article does not hard-code a dynamic ID.
How to assemble a minimal AI workflow
1. Add Manual Trigger
Create a new workflow and add Manual Trigger. While testing is underway, do not publish workflow: n8n recommends using manual executions when building and testing.
2. Set up AI Agent
Connect Manual Trigger to AI Agent. In the prompt options, select an input that allows you to specify fixed text and use:
Reply with one line: N8N_OK_4. Do not call tools or perform external actions.
Do not connect Tool nodes. This test requires a response from the model, not agent automation.
3. Connect OpenAI Chat Model
In the OpenAI Chat Model subnode:
- select the created BetterToken credential;
- select the exact Model ID;
- for the first request, turn off Use Responses API and use Chat Completions;
- set the final Timeout;
- set Max Retries to the minimum value that the current version of n8n allows.
The Model, Use Responses API, Timeout and Max Retries parameters are described on OpenAI Chat Model official page.
Responses API and built-in Web Search, File Search or Code Interpreter are not included in this test. Their presence in the n8n interface does not confirm support for the selected model or endpoint.
4. Execute exactly one manual run
Click Execute Workflow. The result should contain N8N_OK_4 on one line; verify it manually rather than treating a prompt alone as a formatting guarantee. Don't restart immediately if node returns an error: first define its class.
Where to look at the execution log
Open Executions for the current workflow and select manual execution. Check:
- general status execution;
- start time and duration;
- AI Agent input and output;
- node where the process stopped;
- error text without copying credential or sensitive prompt.
n8n distinguishes between manual and production executions. Manual run is launched from editor and is suitable for testing; production execution starts automatically after publishing a workflow or from a trigger. Until the provider is verified, leave the workflow unpublished.
The differences between execution types and execution lists are documented in n8n executions documentation.
Execution data can contain a node's input and output. Do not use personal data or secrets for the first test; before production, separately check the execution-data retention settings for your n8n version and plan.
How to limit retries and troubleshoot the error
Automatic retry is only useful for temporary errors. It also creates additional API requests, so it affects the cost and complicates the mapping to a single execution.
-
401/ Unauthorized: do not repeat automatically; check the API Key and extra spaces first. -
403: do not repeat automatically; check Key access to the selected model. -
404/ model not found: do not repeat automatically; check Base URL and exact Model ID. -
429: allow only limited repetition after a pause; check the rate limit and the number of parallel runs. -
5xx/ timeout: do not exceed the specified limit; check the provider status, Timeout and prompt size. - Workflow error: do not repeat before diagnostics; check node, expression and input data.
For the first test, keep Max Retries to a minimum and do not add a loop, Wait + retry, or error workflow with the new API call. If you need retry in production, set the final number of retries and delay, and then check how many requests appeared in the Dashboard.
n8n error workflow is useful for failure notifications, but the notification itself is an external side effect. Add it only after a separate check and with your own limits.
How to check Token and value in Dashboard
Open BetterToken Dashboard immediately after one manual run. Match:
- narrow startup time in n8n and query time in Dashboard;
- Model ID in OpenAI Chat Model and model in the usage record;
- successful or error status;
- input, output and applicable cache Token;
- the corresponding expense for this entry.
Do not calculate the value based on the old article or a fixed number per million Token. Model and price vary; take the actual charge for one call from the Dashboard, and the current rate from BetterToken pricing page.
If one manual execution matches multiple lines in the Dashboard, check Max Retries and Agent behavior. One visible workflow run can cause several model requests, especially with agent loop or Responses tools. Therefore, the first check uses a fixed prompt, without tools and with minimal repetition.
Frequent errors
Credential test returns 401
Recreate the OpenAI credential and remove accidental spaces around the API Key. Check the current official credential fields; do not display the key in the execution log.
Credential test or node returns 404
Base URL should be https://www.bettertoken.ai/v1. Don't add /models or endpoint. Then reload the Model and select the current ID.
Regular Chat works, but Agent tools doesn't
Return to the minimal workflow: turn off Use Responses API, remove Tool nodes and repeat one fixed prompt. This will separate the provider connection from the specific tool or workflow restriction.
Execution successful, but Dashboard shows multiple requests
Check Max Retries and agent loop. Compare timestamps and statuses. Don't manually sum the lines as one call if n8n actually sent multiple requests.
FAQ
Do I need to publish a workflow for review?
No. Manual execution from editor is enough. The publication includes production triggers and can trigger external actions without additional confirmation.
Can I use the Responses API?
This is possible only after a separate check of the selected model and endpoint. For the first connection, use regular Chat Completions without built-in OpenAI tools.
Where is the BetterToken API Key stored?
In credential n8n type OpenAI. Don't duplicate it in node parameters, workflow JSON, prompt or repository.
How to understand the real cost of one workflow?
Execute one manual run with minimal retries and match the execution time, Model ID and status with the BetterToken Dashboard entry. Take Token and consumption from this post, and not from the estimated example.
Originally published on the BetterToken blog.
BetterToken provides pay-as-you-go access to AI model APIs through
OpenAI-compatible and Anthropic-compatible endpoints — useful if you are wiring
Claude Code, Codex, or your own tooling to a custom base URL.
See the docs to get started.
Top comments (0)