diff --git a/package.json b/package.json index b5051d3..bc8b0c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@clawnify/clawflow", - "version": "1.2.2", + "version": "1.2.3", "description": "The n8n for agents. A declarative, AI-native workflow format that agents can read, write, and run.", "type": "module", "main": "./dist/index.js", diff --git a/src/core/runner.ts b/src/core/runner.ts index 563ec93..1751396 100644 --- a/src/core/runner.ts +++ b/src/core/runner.ts @@ -806,12 +806,17 @@ export class FlowRunner { maxTokens?: number, content?: ContentPart[], ): Promise { + const headers: Record = { + "Content-Type": "application/json", + Authorization: `Bearer ${apiKey}`, + }; + if (provider === "OpenRouter") { + headers["HTTP-Referer"] = "https://clawnify.com"; + headers["X-OpenRouter-Title"] = "Clawnify"; + } const resp = await fetch(`${baseUrl}/v1/chat/completions`, { method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${apiKey}`, - }, + headers, body: JSON.stringify({ model, max_tokens: maxTokens,