{
  "name": "Create universal OpenAI-compatible API endpoints for multiple AI workflows",
  "nodes": [
    {
      "id": "f8831a38-92ef-44e5-99dd-0f410e9c0883",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1424,
        992
      ]
    },
    {
      "id": "3c36a5c8-28da-4656-aa9d-8593926b3e77",
      "name": "Models Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1600,
        992
      ]
    },
    {
      "id": "c28b03cb-bd1b-41d5-ba1b-486a099afb92",
      "name": "GET models",
      "type": "n8n-nodes-base.webhook",
      "position": [
        896,
        992
      ]
    },
    {
      "id": "855c24f5-0758-4344-b780-523383b51de1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        800
      ],
      "parameters": {
        "width": 1016,
        "height": 452,
        "content": "## 1. 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": [
        2000,
        784
      ],
      "parameters": {
        "width": 1448,
        "height": 588,
        "content": "## 2. 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": "cb4e2823-21af-418e-9f46-9c367932aef4",
      "name": "Get many workflows",
      "type": "n8n-nodes-base.n8n",
      "position": [
        1088,
        992
      ]
    },
    {
      "id": "f1c9a7d9-9958-4e3f-bd2d-22fb77028cd8",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1264,
        992
      ]
    },
    {
      "id": "fe6a6983-4b80-4b54-92f2-ffe7235d0c2e",
      "name": "POST ChatCompletions",
      "type": "n8n-nodes-base.webhook",
      "position": [
        2096,
        1072
      ]
    },
    {
      "id": "b296aba2-a74a-47fb-8461-c1d17badab28",
      "name": "Remap to Response API Schema",
      "type": "n8n-nodes-base.code",
      "position": [
        2352,
        1072
      ]
    },
    {
      "id": "f2a859c0-c7d4-49cc-baf6-b711700cef46",
      "name": "Format Completion Response",
      "type": "n8n-nodes-base.code",
      "position": [
        3040,
        1200
      ]
    },
    {
      "id": "9312f313-97f5-4ff7-9bbd-65d0ec3c6c2d",
      "name": "JSON Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3200,
        1200
      ]
    },
    {
      "id": "68572df2-ea64-4520-9b67-3d60a2059992",
      "name": "Text Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3200,
        976
      ]
    },
    {
      "id": "1a2c1e1b-d5ea-4da6-ae86-081a700ca80d",
      "name": "Format Stream Response",
      "type": "n8n-nodes-base.code",
      "position": [
        3024,
        976
      ]
    },
    {
      "id": "5e832bb8-c2a2-453b-9aef-b08862c659fc",
      "name": "Is Stream?",
      "type": "n8n-nodes-base.if",
      "position": [
        2576,
        1072
      ]
    },
    {
      "id": "790bb7d3-7b5d-417f-9d31-2f01d6ac89f3",
      "name": "Call workflow webhook",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2816,
        976
      ]
    },
    {
      "id": "4d0d9dfa-2df0-49dd-a60c-1164347c85c5",
      "name": "Call workflow webhook1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2816,
        1200
      ]
    },
    {
      "id": "d8728083-673c-479a-b804-6bbad1fa1581",
      "name": "n8n Webhooks",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1056,
        1824
      ]
    },
    {
      "id": "f96c8bae-1c75-4e01-bd41-bfc0b047d0f7",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        928,
        1632
      ]
    },
    {
      "id": "51aa0e26-8cb5-4561-9d9c-a5e9e306fecb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        1392
      ],
      "parameters": {
        "width": 680,
        "height": 580,
        "content": "## 3. Create a New Custom OpenAI Credential\n[Learn more about OpenAI Credentials](https://docs.n8n.io/integrations/builtin/credentials/openai/)\n\nTo chat with n8n workflow, the approach is to mimic an "
      }
    },
    {
      "id": "5280f412-126a-45ca-8d3e-8fe460d966d7",
      "name": "Powered By n8n Workflow Models",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1120,
        1632
      ]
    },
    {
      "id": "9ecab0cf-c376-4ab1-81ce-896e1766b734",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1184,
        1840
      ]
    }
  ],
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Models Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET models": {
      "main": [
        [
          {
            "node": "Get many workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Stream?": {
      "main": [
        [
          {
            "node": "Call workflow webhook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Call workflow webhook1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n Webhooks": {
      "ai_languageModel": [
        [
          {
            "node": "Powered By n8n Workflow Models",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Powered By n8n Workflow Models",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Models Response": {
      "main": [
        []
      ]
    },
    "Get many workflows": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "POST ChatCompletions": {
      "main": [
        [
          {
            "node": "Remap to Response API Schema",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call workflow webhook": {
      "main": [
        [
          {
            "node": "Format Stream Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call workflow webhook1": {
      "main": [
        [
          {
            "node": "Format Completion Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Stream Response": {
      "main": [
        [
          {
            "node": "Text Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Completion Response": {
      "main": [
        [
          {
            "node": "JSON Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Powered By n8n Workflow Models",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remap to Response API Schema": {
      "main": [
        [
          {
            "node": "Is Stream?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Powered By n8n Workflow Models": {
      "main": [
        []
      ]
    }
  }
}