Skip to main content

Create OpenAI-compatible API using GitHub models for free AI access

Workflow preview

Workflow preview
100%
Create OpenAI-compatible API using GitHub models for free AI access preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n template shows you how to connect Github's Free Models to your existing n8n AI workflows. Whilst it is possible to use HTTP nodes to access Gith...

Best for

  • Engineering automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.aggregate, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.respondtowebhook, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.stickynote, n8n-nodes-base.webhook

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jimleuk.

Original n8n.io source

1.1 Workflow description

Title
Create OpenAI-compatible API using GitHub models for free AI access
Workflow name
Create OpenAI-compatible API using GitHub models for free AI access

This n8n template shows you how to connect Github's Free Models to your existing n8n AI workflows.

Whilst it is possible to use HTTP nodes to access Github Models, The aim of this template is to use it with existing n8n LLM nodes - saves the trouble of refactoring!

Please note, Github states their model APIs are not intended for production usage! If you need higher rate limits, you'll need to use a paid service.

How it works

  • The approach builds a custom OpenAI compatible API around the Github Models API - all done in n8n!
  • First, we attach an OpenAI subnode to our LLM node and configure a new OpenAI credential.
  • Within this new OpenAI credential, we change the "Base URL" to point at a n8n webhook we've prepared as part of this template.
  • Next, we create 2 webhooks which the LLM node will now attempt to connect with: "models" and "chat completion".
  • The "models" webhook simply calls the Github Model's "list all models" endpoint and remaps the response to be compatible with our LLM node.
  • The "Chat Completion" webhook does a similar task with Github's Chat Completion endpoint.

How to use

  • Once connected, just open chat and ask away!
  • Any LLM or AI agent node connected with this custom LLM subnode will send requests to the Github Models API. Allowing your to try out a range of SOTA models for free.

Requirements

  • Github account and credentials for access to Models. If you've used the Github node previously, you can reuse this credential for this template.

Customising this workflow

  • This template is just an example. Use the custom OpenAI credential for your other workflows to test Github models.

References

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 2 - Github Models

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Github Chat Completions

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - n8n Webhooks

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 5 - Chat Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.2

Block 6 - Models Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.2

Block 7 - Powered By Github Models

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.6

Block 8 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - GET models

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 11 - POST ChatCompletions

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 12 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Is Agent?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 17 - Agent Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.2

3. Summary Table

Workflow Create OpenAI-compatible API using GitHub models for free AI access
Complexity advanced
Nodes 17
Categories Engineering, AI Chatbot
Author Jimleuk
Published 19 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4217/4217.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create OpenAI-compatible API using GitHub models for free AI access do?

This n8n template shows you how to connect Github's Free Models to your existing n8n AI workflows. Whilst it is possible to use HTTP nodes to access Gith...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Chatbot use case.