
Use TokenRex with n8n
Use TokenRex as a custom OpenAI-compatible provider in n8n.
Setup checked against the linked documentation. Screenshots are reference examples from the tool's publisher, not proof of a TokenRex connection. Live execution inside this third-party app has not been tested; verify a short request before running larger tasks.
Before you start
- A TokenRex API key
- A version of the app that accepts a custom OpenAI-compatible base URL
Setup methods
OpenAI Chat Model node
- 1
Create an OpenAI credential using your TokenRex key and Base URL https://tokenrex.ai/api/public/v1.
- 2
Add an OpenAI Chat Model node and select that credential. Keep Use Responses API off for a Chat Completions workflow.
- 3
Choose an enabled model from discovery or enter its exact ID if your version supports manual selection. Connect the model to your AI workflow and run a small test.
- 4
Sub-node expressions resolve against the first input item; check this when processing batches.
OpenAI node — Generate a Chat Completion
- 1
Add the OpenAI node with the same TokenRex credential.
- 2
Choose Text → Generate a Chat Completion, set the model and messages, then execute the node.
- 3
Node labels and supported operations vary by n8n version. Do not switch to Responses without verifying that protocol.
HTTP Request node
- 1
Use POST https://tokenrex.ai/api/public/v1/chat/completions in an HTTP Request node.
- 2
Use a stored Header Auth credential for Authorization: Bearer <your key>, not a key embedded in a shared workflow.
- 3
Set the body to JSON using the example below, execute the node and read choices[0].message.content.
{
"model": "gpt-6-astra",
"messages": [
{
"role": "user",
"content": "Reply with a short greeting."
}
]
}Troubleshooting
- Authentication fails
- Check that the saved TokenRex key is active and belongs in the tool's API-key field, not its subscription sign-in. Remove accidental spaces, check your wallet balance, and never share the key in screenshots or exported settings.
- The model is missing or the request URL returns 404
- Copy an exact enabled model ID from Models & Pricing. Follow this method's URL field: some tools expect the versioned base, others the root or full completion address. Check the documented API protocol before changing the path.
- Chat works but streaming or tools fail
- Test a short plain-text conversation first. Confirm the selected model and installed tool version support the required protocol and capabilities. Enable agent actions only after separately checking streaming and tool calls.
Verify the connection
Send a short message with the selected model, read its response, then confirm the exact model appears in your TokenRex usage. Test streaming and tool use separately before larger agent tasks.