Skip to main content

Gravix Layer x n8n Integration

Easily connect Gravix Layer's AI models to your n8n workflows using the built-in HTTP Request node. This allows you to automate tasks, generate content, or analyze data with powerful LLMs and vision models directly from your n8n automations.

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/inference/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.