Skip to main content
This guide demonstrates how to integrate Gravix Layer with n8n for building automation workflows that include model inference steps and data transformations.

What You’ll Learn

  • How to call Gravix Layer’s API from n8n
  • How to use the HTTP Request node for completions and chat
  • Example: Automated changelog generation from Git data

1. Install Required Packages

n8n is a no-code/low-code platform. You can self-host or use n8n Cloud. No Python packages required.

2. Configure Your API Key

Add your Gravix Layer API key as an environment variable or use n8n’s credentials manager.

3. Example: Generate a Changelog from Git Data

Add an HTTP Request node to your n8n workflow with the following configuration: n8n HTTP Request Node Example
{
	"parameters": {
		"method": "POST",
		"url": "https://api.gravixlayer.com/v1/chat/completions",
		"sendHeaders": true,
		"headerParameters": {
			"parameters": [
				{
					"name": "Authorization",
					"value": "=Bearer YOUR_GRAVIXLAYER_API_KEY"
				}
			]
		},
		"sendBody": true,
		"specifyBody": "json",
		"jsonBody": "={\n  {\n    \"model\": \"meta-llama/llama-3.1-8b-instruct\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Summarize the following commit:\\n\" + $json.commit_message\n      }\n    ]\n  }\n}"
	},
	"name": "Call GravixLayer AI",
	"type": "n8n-nodes-base.httpRequest",
	"typeVersion": 4.2
}
Expected Output:
A detailed changelog entry generated by the AI model based on your commit message.

Tips:
  • You can use any supported Gravix Layer model by changing the model parameter.
  • For vision or multimodal tasks, provide image URLs or base64-encoded images in the messages array.
  • Combine with other n8n nodes for powerful, end-to-end automation.
For more details, see the n8n documentation.
I