Use Gonka Broker with n8n
Connect n8n to Gonka Broker with an HTTP Request node, protected bearer credentials, a test payload, and bounded error handling.
POST https://api.gonka.broker/v1/chat/completions. Store the bearer key in an n8n credential and use gonka-auto as the model.Before you start
- A Gonka Broker account and API key
- An n8n workflow with input text available in the current item
- A small prepaid balance and a test-only usage limit
Do not paste the key into workflow JSON, expressions, node names or notes. Exported workflows should contain no usable credentials.
Create the credential
- In n8n, create a credential for the HTTP Request node.
- Select header authentication.
- Use
Authorizationas the header name. - Use
Bearer YOUR_KEYas the value, entering the key only in the credential field. - Restrict that credential to the workflow or project that needs it.
Configure the HTTP Request node
- Method:
POST - URL:
https://api.gonka.broker/v1/chat/completions - Authentication: the protected header credential
- Send body: JSON
- Content type:
application/json - Timeout: set a finite value suitable for the workflow
Example JSON body
{
"model": "gonka-auto",
"messages": [
{
"role": "user",
"content": "Summarize in three bullets: {{$json.text}}"
}
],
"max_tokens": 300
}Adjust $json.text to match the field produced by the previous node. Keep the first test short and inspect the complete response before mapping downstream fields.
Read the result
The assistant text is normally available under choices[0].message.content. The response can also include usage information and a request identifier. Map only the fields your workflow needs, and avoid storing full prompts or responses in routine logs unless the workflow genuinely requires them.
Handle failures without creating a loop
- Send authentication and validation errors to a stop or operator-review branch.
- Retry temporary rate-limit or server errors only a small number of times.
- Add delay or backoff between retry attempts.
- Set an input-length guard before the API node.
- Set an output-token limit in every automated request.
- Alert on repeated failures instead of retrying forever.
Production checklist
Use a dedicated key for n8n, test the workflow with representative data, verify usage in the Gonka Broker dashboard, and keep another route for critical automations until the exact behavior is proven. See the API docs and current pricing.
Next step: Create an account or read the integration docs.