TokenReply

Loading…

Reload

n8n with TokenReply

Use an HTTP Request node pointed at the full /v1/chat/completions URL, add Bearer authentication and JSON content type, then map the response body explicitly.

Last checked · Sources: Official client documentation and TokenReply route review

Category
Automation
API format
Raw OpenAI-compatible HTTP request
Endpoint setting
HTTP Request node with full endpoint

Setup

  1. Create a generic credential or header-auth credential that stores the TokenReply key.
  2. Add an HTTP Request node with POST and the full /v1/chat/completions endpoint.
  3. Send a JSON body with an exact catalog model ID and stream set to false for the first test.
  4. Map choices[0].message.content only after inspecting a successful execution payload.
Example
Method: POST
URL: https://api.tokenreply.com/v1/chat/completions
Authorization: Bearer sk-your-token-here
Content-Type: application/json

{
  "model": "YOUR_MODEL_ID",
  "messages": [{"role": "user", "content": "{{$json.prompt}}"}],
  "stream": false
}

How to verify

  • The execution shows HTTP 200 and a JSON response body.
  • The API key is stored in credentials, not embedded in exported workflow JSON.
  • The response mapping handles an error body before reading choices[0].

Limitations

  • The documented n8n OpenAI credential targets OpenAI and may not expose a custom provider URL in every release.
  • Streaming responses need a streaming-aware workflow design; start with stream false.
  • Imported workflows can expose literal headers, so use n8n credentials or secrets.

Troubleshooting

SymptomWhat it usually meansWhat to do
The OpenAI node always calls api.openai.comThat node or credential version does not support a custom API host.Use an HTTP Request node with the full TokenReply endpoint.
The workflow reads choices before an error is checkedThe response mapping assumes every request succeeds.Branch on HTTP status or error first, then extract the successful message.

Resources

Ready to try it?