{
  "name": "Create OpenAI-compatible API using GitHub models for free AI access",
  "nodes": [
    {
      "id": "f8831a38-92ef-44e5-99dd-0f410e9c0883",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        440,
        260
      ]
    },
    {
      "id": "7c51c3f5-3d2f-4d7d-8fd8-30641b1b9516",
      "name": "Github Models",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        260
      ]
    },
    {
      "id": "c9602915-e903-4891-b131-68b3190f637b",
      "name": "Github Chat Completions",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1120,
        320
      ]
    },
    {
      "id": "ccdfc4f2-53dd-409b-9887-6e191374e23c",
      "name": "n8n Webhooks",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        320,
        -160
      ]
    },
    {
      "id": "29ed818b-fb54-4b55-b5ac-1d5220222558",
      "name": "Chat Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1540,
        400
      ]
    },
    {
      "id": "3c36a5c8-28da-4656-aa9d-8593926b3e77",
      "name": "Models Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        640,
        260
      ]
    },
    {
      "id": "3c1efb37-c04c-4426-acde-690dbaf54183",
      "name": "Powered By Github Models",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        240,
        -340
      ]
    },
    {
      "id": "704e5aae-bda3-4238-b770-f3a1d2732311",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        40,
        -340
      ]
    },
    {
      "id": "ed87f51d-c2bd-43c4-aabb-4f92b12b82f3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -240
      ],
      "parameters": {
        "width": 520,
        "height": 220,
        "content": "### LLM Models via N8N Webhooks\n1. Create a new OpenAI Credential and call it \"n8n-webhook\"\n2. Enter API key as anything you like eg. \"12345\"\n3. Enter Base URL as \"https://<your_n8n_url>/webhook/githu"
      }
    },
    {
      "id": "c28b03cb-bd1b-41d5-ba1b-486a099afb92",
      "name": "GET models",
      "type": "n8n-nodes-base.webhook",
      "position": [
        40,
        260
      ]
    },
    {
      "id": "02cb7e26-f992-4444-a886-dcaea1dbb63c",
      "name": "POST ChatCompletions",
      "type": "n8n-nodes-base.webhook",
      "position": [
        920,
        320
      ]
    },
    {
      "id": "be0e06be-2b0d-4167-ad70-84d188f5ca68",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -560
      ],
      "parameters": {
        "width": 680,
        "height": 580,
        "content": "## 1. Create a New Custom OpenAI Credential\n[Learn more about OpenAI Credentials](https://docs.n8n.io/integrations/builtin/credentials/openai/)\n\nTo use Github Models with our existing n8n nodes, one a"
      }
    },
    {
      "id": "855c24f5-0758-4344-b780-523383b51de1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        60
      ],
      "parameters": {
        "width": 840,
        "height": 420,
        "content": "## 2. Listing All Available Models \n[Read more about the Webhook Trigger node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/)\n\nOur first endpoint is for listing all model"
      }
    },
    {
      "id": "d5f0446d-2e59-47ee-a442-f66490d8759d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        60
      ],
      "parameters": {
        "width": 920,
        "height": 540,
        "content": "## 3. Request a Chat Completion \n[Read more about the HTTP Request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nOur second endpoint is for executing a chat co"
      }
    },
    {
      "id": "e8a13b04-fd51-4031-90f3-7088871e6dfd",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -560
      ],
      "parameters": {
        "width": 420,
        "height": 1280,
        "content": "## Try It Out!\n### This n8n template shows you how to connect [Github's Free Models](https://docs.github.com/en/github-models) to your existing n8n AI workflows.\n\nWhilst it is possible to use HTTP nod"
      }
    },
    {
      "id": "2a75f35d-695f-425d-8b8e-425c9075c702",
      "name": "Is Agent?",
      "type": "n8n-nodes-base.if",
      "position": [
        1320,
        320
      ]
    },
    {
      "id": "31e0325d-ef82-40af-862b-9dcffbf650e6",
      "name": "Agent Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1540,
        240
      ]
    }
  ],
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Models Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Agent?": {
      "main": [
        [
          {
            "node": "Agent Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Chat Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET models": {
      "main": [
        [
          {
            "node": "Github Models",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n Webhooks": {
      "ai_languageModel": [
        [
          {
            "node": "Powered By Github Models",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Github Models": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "POST ChatCompletions": {
      "main": [
        [
          {
            "node": "Github Chat Completions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Github Chat Completions": {
      "main": [
        [
          {
            "node": "Is Agent?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Powered By Github Models",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}