{
  "name": "Soke — Chat Completions",
  "nodes": [
    {
      "parameters": {},
      "id": "e1b2c3d4-0005-4000-8000-000000000001",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.usesoke.ai/api/v1/chat/completions",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"{{ $json.prompt || 'Research keywords for cooking tutorials and suggest 3 optimized titles' }}\"\n    }\n  ],\n  \"platform\": \"youtube\",\n  \"model\": \"soke-v1\",\n  \"stream\": false\n}",
        "options": {}
      },
      "id": "e1b2c3d4-0005-4000-8000-000000000002",
      "name": "Chat with Soke",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [480, 300],
      "credentials": {
        "httpHeaderAuth": {
          "id": "CREDENTIAL_ID",
          "name": "Soke API"
        }
      }
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={\n  \"response\": \"{{ $json.choices[0].message.content }}\",\n  \"servicesUsed\": {{ JSON.stringify($json.choices[0].message.data?.services_used || []) }},\n  \"results\": {{ JSON.stringify($json.choices[0].message.data?.results || {}) }}\n}",
        "options": {}
      },
      "id": "e1b2c3d4-0005-4000-8000-000000000003",
      "name": "Extract Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [720, 300]
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [{ "node": "Chat with Soke", "type": "main", "index": 0 }]
      ]
    },
    "Chat with Soke": {
      "main": [
        [{ "node": "Extract Response", "type": "main", "index": 0 }]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "soke-template"
  },
  "tags": [
    { "name": "Soke", "id": "soke-tag-1" }
  ]
}
