n8n-nodes-agnicwallet 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -6
- package/dist/credentials/AgnicWalletApi.credentials.js +70 -41
- package/dist/credentials/AgnicWalletOAuth2Api.credentials.js +120 -91
- package/dist/nodes/AgnicAI/AgnicAI.node.js +1160 -411
- package/dist/nodes/AgnicAILanguageModel/AgnicAILanguageModel.node.js +1016 -355
- package/dist/nodes/AgnicMCPTool/AgnicMCPTool.node.js +12330 -336
- package/dist/nodes/X402HttpRequest/X402HttpRequest.node.js +345 -310
- package/package.json +9 -8
|
@@ -1,422 +1,1171 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// nodes/AgnicAI/AgnicAI.node.ts
|
|
22
|
+
var AgnicAI_node_exports = {};
|
|
23
|
+
__export(AgnicAI_node_exports, {
|
|
24
|
+
AgnicAI: () => AgnicAI
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(AgnicAI_node_exports);
|
|
27
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
28
|
+
var AgnicAI = class {
|
|
29
|
+
constructor() {
|
|
30
|
+
this.description = {
|
|
31
|
+
displayName: "AgnicAI",
|
|
32
|
+
name: "agnicAI",
|
|
33
|
+
group: ["transform"],
|
|
34
|
+
version: 1,
|
|
35
|
+
description: "Access various language models through AgnicPay AI Gateway with X402 payment support. Use this node in regular workflows to call AI models.",
|
|
36
|
+
defaults: {
|
|
37
|
+
name: "AgnicAI"
|
|
38
|
+
},
|
|
39
|
+
icon: "file:AgnicAI.png",
|
|
40
|
+
inputs: [import_n8n_workflow.NodeConnectionTypes.Main],
|
|
41
|
+
outputs: [import_n8n_workflow.NodeConnectionTypes.Main],
|
|
42
|
+
credentials: [
|
|
43
|
+
{
|
|
44
|
+
name: "agnicWalletOAuth2Api",
|
|
45
|
+
required: false,
|
|
46
|
+
displayOptions: {
|
|
47
|
+
show: {
|
|
48
|
+
authentication: ["oAuth2"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "agnicWalletApi",
|
|
54
|
+
required: false,
|
|
55
|
+
displayOptions: {
|
|
56
|
+
show: {
|
|
57
|
+
authentication: ["apiKey"]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
properties: [
|
|
63
|
+
{
|
|
64
|
+
displayName: "Authentication",
|
|
65
|
+
name: "authentication",
|
|
66
|
+
type: "options",
|
|
67
|
+
options: [
|
|
68
|
+
{
|
|
69
|
+
name: "OAuth2",
|
|
70
|
+
value: "oAuth2",
|
|
71
|
+
description: "Recommended: Connect your account"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "API Key",
|
|
75
|
+
value: "apiKey",
|
|
76
|
+
description: "For CI/CD or programmatic access"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
default: "oAuth2",
|
|
80
|
+
description: "How to authenticate with AgnicWallet"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: "Model",
|
|
84
|
+
name: "model",
|
|
85
|
+
type: "options",
|
|
86
|
+
typeOptions: {
|
|
87
|
+
allowCustomValues: true
|
|
88
|
+
},
|
|
89
|
+
options: [
|
|
90
|
+
// ==================== RECOMMENDED ====================
|
|
91
|
+
{
|
|
92
|
+
name: "\u2B50 GPT-4o Mini (Recommended)",
|
|
93
|
+
value: "openai/gpt-4o-mini",
|
|
94
|
+
description: "Best balance of speed, quality and cost. Great default choice."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "\u2B50 Claude 3.5 Sonnet (Recommended)",
|
|
98
|
+
value: "anthropic/claude-3.5-sonnet",
|
|
99
|
+
description: "Excellent for complex reasoning, coding, and long-form content."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "\u2B50 Gemini 2.0 Flash (Recommended)",
|
|
103
|
+
value: "google/gemini-2.0-flash-001",
|
|
104
|
+
description: "Google's fast model with 1M context. Great for large documents."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "\u2B50 DeepSeek Chat V3 (Recommended - Affordable)",
|
|
108
|
+
value: "deepseek/deepseek-chat",
|
|
109
|
+
description: "Very affordable with strong performance across tasks."
|
|
110
|
+
},
|
|
111
|
+
// ==================== OPENAI MODELS ====================
|
|
112
|
+
{
|
|
113
|
+
name: "OpenAI: GPT-5",
|
|
114
|
+
value: "openai/gpt-5",
|
|
115
|
+
description: "Latest GPT-5. Top-tier performance."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "OpenAI: GPT-5 Pro",
|
|
119
|
+
value: "openai/gpt-5-pro",
|
|
120
|
+
description: "GPT-5 Pro variant. Enhanced capabilities."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "OpenAI: GPT-5 Mini",
|
|
124
|
+
value: "openai/gpt-5-mini",
|
|
125
|
+
description: "Smaller GPT-5 variant. Fast and cost-effective."
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "OpenAI: GPT-5 Nano",
|
|
129
|
+
value: "openai/gpt-5-nano",
|
|
130
|
+
description: "Smallest GPT-5. Ultra-fast responses."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "OpenAI: GPT-4.1",
|
|
134
|
+
value: "openai/gpt-4.1",
|
|
135
|
+
description: "Latest GPT-4.1 with improved instruction following."
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "OpenAI: GPT-4.1 Mini",
|
|
139
|
+
value: "openai/gpt-4.1-mini",
|
|
140
|
+
description: "Smaller, faster GPT-4.1 variant."
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "OpenAI: GPT-4.1 Nano",
|
|
144
|
+
value: "openai/gpt-4.1-nano",
|
|
145
|
+
description: "Smallest GPT-4.1. Ultra-fast and cheapest."
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: "OpenAI: GPT-4o",
|
|
149
|
+
value: "openai/gpt-4o",
|
|
150
|
+
description: "OpenAI's flagship multimodal model. 128K context."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "OpenAI: GPT-4o Mini",
|
|
154
|
+
value: "openai/gpt-4o-mini",
|
|
155
|
+
description: "Fast and affordable GPT-4o variant."
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "OpenAI: GPT-4 Turbo",
|
|
159
|
+
value: "openai/gpt-4-turbo",
|
|
160
|
+
description: "GPT-4 with 128K context."
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "OpenAI: GPT-4",
|
|
164
|
+
value: "openai/gpt-4",
|
|
165
|
+
description: "Original GPT-4. 8K context. Reliable."
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "OpenAI: GPT-3.5 Turbo",
|
|
169
|
+
value: "openai/gpt-3.5-turbo",
|
|
170
|
+
description: "Fast and affordable. 16K context."
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "[REASONING] OpenAI: o1",
|
|
174
|
+
value: "openai/o1",
|
|
175
|
+
description: "Advanced reasoning model. Step-by-step thinking."
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "[REASONING] OpenAI: o3",
|
|
179
|
+
value: "openai/o3",
|
|
180
|
+
description: "Latest reasoning model from OpenAI."
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "[REASONING] OpenAI: o3 Mini",
|
|
184
|
+
value: "openai/o3-mini",
|
|
185
|
+
description: "Compact reasoning model. Fast chain-of-thought."
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "[REASONING] OpenAI: o3 Mini High",
|
|
189
|
+
value: "openai/o3-mini-high",
|
|
190
|
+
description: "o3 Mini with higher compute budget."
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "[REASONING] OpenAI: o3 Pro",
|
|
194
|
+
value: "openai/o3-pro",
|
|
195
|
+
description: "Professional reasoning model."
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "[REASONING] OpenAI: o4 Mini",
|
|
199
|
+
value: "openai/o4-mini",
|
|
200
|
+
description: "Latest compact reasoning model."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "[REASONING] OpenAI: o4 Mini High",
|
|
204
|
+
value: "openai/o4-mini-high",
|
|
205
|
+
description: "o4 Mini with extended reasoning."
|
|
206
|
+
},
|
|
207
|
+
// ==================== ANTHROPIC MODELS ====================
|
|
208
|
+
{
|
|
209
|
+
name: "Anthropic: Claude Sonnet 4.5",
|
|
210
|
+
value: "anthropic/claude-sonnet-4.5",
|
|
211
|
+
description: "Latest Claude 4.5 Sonnet. Excellent all-around."
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: "Anthropic: Claude Sonnet 4",
|
|
215
|
+
value: "anthropic/claude-sonnet-4",
|
|
216
|
+
description: "Claude 4. Great reasoning and coding."
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "Anthropic: Claude Opus 4.5",
|
|
220
|
+
value: "anthropic/claude-opus-4.5",
|
|
221
|
+
description: "Most capable Claude 4.5. Complex tasks."
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "Anthropic: Claude Opus 4.1",
|
|
225
|
+
value: "anthropic/claude-opus-4.1",
|
|
226
|
+
description: "Claude Opus 4.1. Enhanced capabilities."
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "Anthropic: Claude Opus 4",
|
|
230
|
+
value: "anthropic/claude-opus-4",
|
|
231
|
+
description: "Claude 4 Opus. Best for nuanced tasks."
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "Anthropic: Claude Haiku 4.5",
|
|
235
|
+
value: "anthropic/claude-haiku-4.5",
|
|
236
|
+
description: "Fast Claude 4.5. High-volume tasks."
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "Anthropic: Claude 3.7 Sonnet",
|
|
240
|
+
value: "anthropic/claude-3.7-sonnet",
|
|
241
|
+
description: "Improved Claude 3.5 Sonnet. Better reasoning."
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "Anthropic: Claude 3.5 Sonnet",
|
|
245
|
+
value: "anthropic/claude-3.5-sonnet",
|
|
246
|
+
description: "Excellent capability and speed. 200K context."
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: "Anthropic: Claude 3.5 Haiku",
|
|
250
|
+
value: "anthropic/claude-3.5-haiku",
|
|
251
|
+
description: "Fast and affordable Claude."
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: "Anthropic: Claude 3 Opus",
|
|
255
|
+
value: "anthropic/claude-3-opus",
|
|
256
|
+
description: "Most capable Claude 3. Complex analysis."
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: "Anthropic: Claude 3 Haiku",
|
|
260
|
+
value: "anthropic/claude-3-haiku",
|
|
261
|
+
description: "Fastest Claude 3. Near-instant responses."
|
|
262
|
+
},
|
|
263
|
+
// ==================== GOOGLE MODELS ====================
|
|
264
|
+
{
|
|
265
|
+
name: "Google: Gemini 3 Flash Preview",
|
|
266
|
+
value: "google/gemini-3-flash-preview",
|
|
267
|
+
description: "Next-gen Gemini. High speed. 1M context."
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "Google: Gemini 3 Pro Preview",
|
|
271
|
+
value: "google/gemini-3-pro-preview",
|
|
272
|
+
description: "Gemini 3 Pro. Most capable."
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "Google: Gemini 2.5 Pro",
|
|
276
|
+
value: "google/gemini-2.5-pro",
|
|
277
|
+
description: "Most capable Gemini 2.5. Excellent reasoning."
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: "Google: Gemini 2.5 Pro Preview",
|
|
281
|
+
value: "google/gemini-2.5-pro-preview",
|
|
282
|
+
description: "Preview of Gemini 2.5 Pro."
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "Google: Gemini 2.5 Flash",
|
|
286
|
+
value: "google/gemini-2.5-flash",
|
|
287
|
+
description: "Fast Gemini 2.5 with thinking. 1M context."
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: "Google: Gemini 2.5 Flash Lite",
|
|
291
|
+
value: "google/gemini-2.5-flash-lite",
|
|
292
|
+
description: "Lightweight Gemini 2.5 Flash."
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "Google: Gemini 2.0 Flash",
|
|
296
|
+
value: "google/gemini-2.0-flash-001",
|
|
297
|
+
description: "Production Gemini 2.0. Fast with 1M context."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "Google: Gemini 2.0 Flash Lite",
|
|
301
|
+
value: "google/gemini-2.0-flash-lite-001",
|
|
302
|
+
description: "Lightweight Gemini 2.0. Very fast."
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: "Google: Gemma 3 27B",
|
|
306
|
+
value: "google/gemma-3-27b-it",
|
|
307
|
+
description: "Open-source Gemma 3. Strong performance."
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: "Google: Gemma 3 12B",
|
|
311
|
+
value: "google/gemma-3-12b-it",
|
|
312
|
+
description: "Mid-size Gemma 3. Good balance."
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: "Google: Gemma 3 4B",
|
|
316
|
+
value: "google/gemma-3-4b-it",
|
|
317
|
+
description: "Small Gemma 3. Fast and efficient."
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
name: "Google: Gemma 2 27B",
|
|
321
|
+
value: "google/gemma-2-27b-it",
|
|
322
|
+
description: "Largest Gemma 2. Strong open-source."
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "Google: Gemma 2 9B",
|
|
326
|
+
value: "google/gemma-2-9b-it",
|
|
327
|
+
description: "Efficient Gemma 2. Great quality for size."
|
|
328
|
+
},
|
|
329
|
+
// ==================== META LLAMA MODELS ====================
|
|
330
|
+
{
|
|
331
|
+
name: "Meta: Llama 4 Maverick",
|
|
332
|
+
value: "meta-llama/llama-4-maverick",
|
|
333
|
+
description: "Latest Llama 4. Frontier-class open model."
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: "Meta: Llama 4 Scout",
|
|
337
|
+
value: "meta-llama/llama-4-scout",
|
|
338
|
+
description: "Efficient Llama 4 variant."
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: "Meta: Llama 3.3 70B",
|
|
342
|
+
value: "meta-llama/llama-3.3-70b-instruct",
|
|
343
|
+
description: "Latest 70B Llama. Matches 405B on many tasks."
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: "Meta: Llama 3.2 90B Vision",
|
|
347
|
+
value: "meta-llama/llama-3.2-90b-vision-instruct",
|
|
348
|
+
description: "Multimodal Llama 3.2. Vision + text."
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: "Meta: Llama 3.2 11B Vision",
|
|
352
|
+
value: "meta-llama/llama-3.2-11b-vision-instruct",
|
|
353
|
+
description: "Compact multimodal Llama."
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: "Meta: Llama 3.2 3B",
|
|
357
|
+
value: "meta-llama/llama-3.2-3b-instruct",
|
|
358
|
+
description: "Compact Llama 3.2. Fast for simple tasks."
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: "Meta: Llama 3.2 1B",
|
|
362
|
+
value: "meta-llama/llama-3.2-1b-instruct",
|
|
363
|
+
description: "Smallest Llama 3.2. Ultra-fast."
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: "Meta: Llama 3.1 405B",
|
|
367
|
+
value: "meta-llama/llama-3.1-405b-instruct",
|
|
368
|
+
description: "Largest open model. GPT-4 class."
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: "Meta: Llama 3.1 70B",
|
|
372
|
+
value: "meta-llama/llama-3.1-70b-instruct",
|
|
373
|
+
description: "Strong 70B model. 128K context."
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
name: "Meta: Llama 3.1 8B",
|
|
377
|
+
value: "meta-llama/llama-3.1-8b-instruct",
|
|
378
|
+
description: "Efficient 8B Llama. Fast."
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: "Meta: Llama 3 70B",
|
|
382
|
+
value: "meta-llama/llama-3-70b-instruct",
|
|
383
|
+
description: "Original Llama 3 70B. Reliable."
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: "Meta: Llama 3 8B",
|
|
387
|
+
value: "meta-llama/llama-3-8b-instruct",
|
|
388
|
+
description: "Efficient Llama 3 8B."
|
|
389
|
+
},
|
|
390
|
+
// ==================== MISTRAL MODELS ====================
|
|
391
|
+
{
|
|
392
|
+
name: "Mistral: Large 2512",
|
|
393
|
+
value: "mistralai/mistral-large-2512",
|
|
394
|
+
description: "Latest Mistral Large. Strong reasoning."
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: "Mistral: Large 2411",
|
|
398
|
+
value: "mistralai/mistral-large-2411",
|
|
399
|
+
description: "Previous Mistral Large release."
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: "Mistral: Large",
|
|
403
|
+
value: "mistralai/mistral-large",
|
|
404
|
+
description: "Mistral's flagship model."
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: "Mistral: Medium 3.1",
|
|
408
|
+
value: "mistralai/mistral-medium-3.1",
|
|
409
|
+
description: "Balanced Mistral. Good quality."
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: "Mistral: Small 3.2 24B",
|
|
413
|
+
value: "mistralai/mistral-small-3.2-24b-instruct",
|
|
414
|
+
description: "Latest Mistral Small. Fast and efficient."
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: "Mistral: Small 3.1 24B",
|
|
418
|
+
value: "mistralai/mistral-small-3.1-24b-instruct",
|
|
419
|
+
description: "Previous Mistral Small release."
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "Mistral: Small Creative",
|
|
423
|
+
value: "mistralai/mistral-small-creative",
|
|
424
|
+
description: "Optimized for creative writing."
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
name: "Mistral: Nemo",
|
|
428
|
+
value: "mistralai/mistral-nemo",
|
|
429
|
+
description: "12B parameter model. Great balance."
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
name: "Mistral: Saba",
|
|
433
|
+
value: "mistralai/mistral-saba",
|
|
434
|
+
description: "Efficient Mistral model."
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: "Mistral: Mixtral 8x22B",
|
|
438
|
+
value: "mistralai/mixtral-8x22b-instruct",
|
|
439
|
+
description: "Large MoE model. High quality."
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
name: "Mistral: Mixtral 8x7B",
|
|
443
|
+
value: "mistralai/mixtral-8x7b-instruct",
|
|
444
|
+
description: "Efficient MoE model."
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: "[CODING] Mistral: Codestral 2508",
|
|
448
|
+
value: "mistralai/codestral-2508",
|
|
449
|
+
description: "Specialized for code. Multi-language."
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
name: "[CODING] Mistral: Devstral 2512",
|
|
453
|
+
value: "mistralai/devstral-2512",
|
|
454
|
+
description: "Development-focused Mistral."
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
name: "Mistral: Pixtral Large 2411",
|
|
458
|
+
value: "mistralai/pixtral-large-2411",
|
|
459
|
+
description: "Large multimodal Mistral."
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
name: "Mistral: Pixtral 12B",
|
|
463
|
+
value: "mistralai/pixtral-12b",
|
|
464
|
+
description: "Compact multimodal Mistral."
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "Mistral: Ministral 14B 2512",
|
|
468
|
+
value: "mistralai/ministral-14b-2512",
|
|
469
|
+
description: "Mid-size Ministral."
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "Mistral: Ministral 8B",
|
|
473
|
+
value: "mistralai/ministral-8b",
|
|
474
|
+
description: "Small but capable."
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: "Mistral: Ministral 3B",
|
|
478
|
+
value: "mistralai/ministral-3b",
|
|
479
|
+
description: "Tiny Mistral. Ultra-fast."
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
name: "Mistral: 7B Instruct",
|
|
483
|
+
value: "mistralai/mistral-7b-instruct",
|
|
484
|
+
description: "Classic Mistral 7B."
|
|
485
|
+
},
|
|
486
|
+
// ==================== DEEPSEEK MODELS ====================
|
|
487
|
+
{
|
|
488
|
+
name: "DeepSeek: V3.2",
|
|
489
|
+
value: "deepseek/deepseek-v3.2",
|
|
490
|
+
description: "Latest DeepSeek V3.2. Strong performance."
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: "DeepSeek: V3.2 Exp",
|
|
494
|
+
value: "deepseek/deepseek-v3.2-exp",
|
|
495
|
+
description: "Experimental DeepSeek V3.2."
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
name: "DeepSeek: Chat V3.1",
|
|
499
|
+
value: "deepseek/deepseek-chat-v3.1",
|
|
500
|
+
description: "Latest Chat V3.1 release."
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
name: "DeepSeek: Chat V3",
|
|
504
|
+
value: "deepseek/deepseek-chat",
|
|
505
|
+
description: "General chat model. Very affordable."
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: "[REASONING] DeepSeek: R1",
|
|
509
|
+
value: "deepseek/deepseek-r1",
|
|
510
|
+
description: "Advanced reasoning. Excels at math and logic."
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
name: "[REASONING] DeepSeek: R1 0528",
|
|
514
|
+
value: "deepseek/deepseek-r1-0528",
|
|
515
|
+
description: "Latest R1 release."
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
name: "[REASONING] DeepSeek: R1 Distill Llama 70B",
|
|
519
|
+
value: "deepseek/deepseek-r1-distill-llama-70b",
|
|
520
|
+
description: "R1 reasoning in Llama 70B."
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: "[REASONING] DeepSeek: R1 Distill Qwen 32B",
|
|
524
|
+
value: "deepseek/deepseek-r1-distill-qwen-32b",
|
|
525
|
+
description: "R1 reasoning in Qwen 32B."
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
name: "[REASONING] DeepSeek: R1 Distill Qwen 14B",
|
|
529
|
+
value: "deepseek/deepseek-r1-distill-qwen-14b",
|
|
530
|
+
description: "Compact R1 distillation."
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: "[REASONING] DeepSeek: Prover V2",
|
|
534
|
+
value: "deepseek/deepseek-prover-v2",
|
|
535
|
+
description: "Mathematical theorem proving."
|
|
536
|
+
},
|
|
537
|
+
// ==================== QWEN MODELS ====================
|
|
538
|
+
{
|
|
539
|
+
name: "Qwen: Qwen3 235B A22B",
|
|
540
|
+
value: "qwen/qwen3-235b-a22b",
|
|
541
|
+
description: "Largest Qwen 3. 235B total, 22B active."
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
name: "Qwen: Qwen3 Max",
|
|
545
|
+
value: "qwen/qwen3-max",
|
|
546
|
+
description: "Maximum capability Qwen 3."
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
name: "Qwen: Qwen3 32B",
|
|
550
|
+
value: "qwen/qwen3-32b",
|
|
551
|
+
description: "Strong mid-size Qwen 3."
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: "Qwen: Qwen3 30B A3B",
|
|
555
|
+
value: "qwen/qwen3-30b-a3b",
|
|
556
|
+
description: "Efficient MoE Qwen 3."
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
name: "Qwen: Qwen3 14B",
|
|
560
|
+
value: "qwen/qwen3-14b",
|
|
561
|
+
description: "Balanced Qwen 3."
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: "Qwen: Qwen3 8B",
|
|
565
|
+
value: "qwen/qwen3-8b",
|
|
566
|
+
description: "Efficient Qwen 3."
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: "[CODING] Qwen: Qwen3 Coder",
|
|
570
|
+
value: "qwen/qwen3-coder",
|
|
571
|
+
description: "Code-specialized Qwen 3."
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "[CODING] Qwen: Qwen3 Coder Flash",
|
|
575
|
+
value: "qwen/qwen3-coder-flash",
|
|
576
|
+
description: "Fast code generation."
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
name: "Qwen: Qwen Max",
|
|
580
|
+
value: "qwen/qwen-max",
|
|
581
|
+
description: "Maximum capability Qwen."
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: "Qwen: Qwen Plus",
|
|
585
|
+
value: "qwen/qwen-plus",
|
|
586
|
+
description: "Enhanced Qwen model."
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: "Qwen: Qwen Turbo",
|
|
590
|
+
value: "qwen/qwen-turbo",
|
|
591
|
+
description: "Fast Qwen model."
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
name: "Qwen: Qwen 2.5 72B",
|
|
595
|
+
value: "qwen/qwen-2.5-72b-instruct",
|
|
596
|
+
description: "Largest Qwen 2.5. 128K context."
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: "[CODING] Qwen: Qwen 2.5 Coder 32B",
|
|
600
|
+
value: "qwen/qwen-2.5-coder-32b-instruct",
|
|
601
|
+
description: "Specialized for code. Strong."
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: "Qwen: Qwen 2.5 7B",
|
|
605
|
+
value: "qwen/qwen-2.5-7b-instruct",
|
|
606
|
+
description: "Compact Qwen 2.5."
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
name: "[REASONING] Qwen: QwQ 32B",
|
|
610
|
+
value: "qwen/qwq-32b",
|
|
611
|
+
description: "Reasoning-focused Qwen."
|
|
612
|
+
},
|
|
613
|
+
// ==================== COHERE MODELS ====================
|
|
614
|
+
{
|
|
615
|
+
name: "Cohere: Command A",
|
|
616
|
+
value: "cohere/command-a",
|
|
617
|
+
description: "Latest Command series. Enterprise performance."
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: "Cohere: Command R+ 08-2024",
|
|
621
|
+
value: "cohere/command-r-plus-08-2024",
|
|
622
|
+
description: "August 2024 release of Command R+."
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
name: "Cohere: Command R 08-2024",
|
|
626
|
+
value: "cohere/command-r-08-2024",
|
|
627
|
+
description: "August 2024 release of Command R."
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
name: "Cohere: Command R7B 12-2024",
|
|
631
|
+
value: "cohere/command-r7b-12-2024",
|
|
632
|
+
description: "Compact Command R. December 2024."
|
|
633
|
+
},
|
|
634
|
+
// ==================== XAI (GROK) MODELS ====================
|
|
635
|
+
{
|
|
636
|
+
name: "xAI: Grok 4",
|
|
637
|
+
value: "x-ai/grok-4",
|
|
638
|
+
description: "Latest Grok 4. Top performance."
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
name: "xAI: Grok 4 Fast",
|
|
642
|
+
value: "x-ai/grok-4-fast",
|
|
643
|
+
description: "Fast Grok 4 variant."
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
name: "xAI: Grok 4.1 Fast",
|
|
647
|
+
value: "x-ai/grok-4.1-fast",
|
|
648
|
+
description: "Enhanced Grok 4.1 Fast."
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
name: "xAI: Grok 3",
|
|
652
|
+
value: "x-ai/grok-3",
|
|
653
|
+
description: "Grok 3. Strong reasoning."
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
name: "xAI: Grok 3 Beta",
|
|
657
|
+
value: "x-ai/grok-3-beta",
|
|
658
|
+
description: "Beta Grok 3 features."
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
name: "xAI: Grok 3 Mini",
|
|
662
|
+
value: "x-ai/grok-3-mini",
|
|
663
|
+
description: "Compact Grok 3."
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
name: "xAI: Grok 3 Mini Beta",
|
|
667
|
+
value: "x-ai/grok-3-mini-beta",
|
|
668
|
+
description: "Beta Grok 3 Mini."
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
name: "[CODING] xAI: Grok Code Fast 1",
|
|
672
|
+
value: "x-ai/grok-code-fast-1",
|
|
673
|
+
description: "Fast code generation."
|
|
674
|
+
},
|
|
675
|
+
// ==================== OTHER PROVIDERS ====================
|
|
676
|
+
{
|
|
677
|
+
name: "NVIDIA: Llama 3.1 Nemotron 70B",
|
|
678
|
+
value: "nvidia/llama-3.1-nemotron-70b-instruct",
|
|
679
|
+
description: "NVIDIA-optimized Llama 3.1."
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: "NVIDIA: Llama 3.3 Nemotron Super 49B V1.5",
|
|
683
|
+
value: "nvidia/llama-3.3-nemotron-super-49b-v1.5",
|
|
684
|
+
description: "Optimized 49B model."
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
name: "NVIDIA: Nemotron 3 Nano 30B",
|
|
688
|
+
value: "nvidia/nemotron-3-nano-30b-a3b",
|
|
689
|
+
description: "Efficient MoE architecture."
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
name: "Microsoft: Phi-4",
|
|
693
|
+
value: "microsoft/phi-4",
|
|
694
|
+
description: "Small but mighty. 14B params."
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
name: "Microsoft: Phi-4 Reasoning Plus",
|
|
698
|
+
value: "microsoft/phi-4-reasoning-plus",
|
|
699
|
+
description: "Phi-4 with enhanced reasoning."
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "Amazon: Nova Premier",
|
|
703
|
+
value: "amazon/nova-premier-v1",
|
|
704
|
+
description: "Top-tier AWS model."
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
name: "Amazon: Nova Pro",
|
|
708
|
+
value: "amazon/nova-pro-v1",
|
|
709
|
+
description: "AWS's capable model."
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
name: "Amazon: Nova Lite",
|
|
713
|
+
value: "amazon/nova-lite-v1",
|
|
714
|
+
description: "Efficient AWS model."
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
name: "Amazon: Nova Micro",
|
|
718
|
+
value: "amazon/nova-micro-v1",
|
|
719
|
+
description: "Smallest AWS model."
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
name: "[SEARCH] Perplexity: Sonar Deep Research",
|
|
723
|
+
value: "perplexity/sonar-deep-research",
|
|
724
|
+
description: "Deep web research. Multi-step search."
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
name: "[SEARCH] Perplexity: Sonar Pro",
|
|
728
|
+
value: "perplexity/sonar-pro",
|
|
729
|
+
description: "Advanced search-augmented model."
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
name: "[SEARCH] Perplexity: Sonar",
|
|
733
|
+
value: "perplexity/sonar",
|
|
734
|
+
description: "Search-augmented responses."
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: "Moonshot: Kimi K2",
|
|
738
|
+
value: "moonshotai/kimi-k2",
|
|
739
|
+
description: "Moonshot's Kimi K2 model."
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
name: "Moonshot: Kimi K2 Thinking",
|
|
743
|
+
value: "moonshotai/kimi-k2-thinking",
|
|
744
|
+
description: "Kimi K2 with reasoning."
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
name: "NousResearch: Hermes 4 405B",
|
|
748
|
+
value: "nousresearch/hermes-4-405b",
|
|
749
|
+
description: "Fine-tuned Llama. Enhanced capabilities."
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
name: "NousResearch: Hermes 4 70B",
|
|
753
|
+
value: "nousresearch/hermes-4-70b",
|
|
754
|
+
description: "Fine-tuned 70B model."
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
name: "Inflection: Inflection 3 Pi",
|
|
758
|
+
value: "inflection/inflection-3-pi",
|
|
759
|
+
description: "Conversational AI. Empathetic."
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
name: "AI21: Jamba Large 1.7",
|
|
763
|
+
value: "ai21/jamba-large-1.7",
|
|
764
|
+
description: "Mamba-based. 256K context."
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
name: "AI21: Jamba Mini 1.7",
|
|
768
|
+
value: "ai21/jamba-mini-1.7",
|
|
769
|
+
description: "Compact Jamba."
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: "MiniMax: MiniMax M2",
|
|
773
|
+
value: "minimax/minimax-m2",
|
|
774
|
+
description: "MiniMax's M2 model."
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
name: "Inception: Mercury",
|
|
778
|
+
value: "inception/mercury",
|
|
779
|
+
description: "Inception's Mercury model."
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: "Inception: Mercury Coder",
|
|
783
|
+
value: "inception/mercury-coder",
|
|
784
|
+
description: "Code-focused Mercury."
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
name: "TNG: R1T Chimera",
|
|
788
|
+
value: "tngtech/tng-r1t-chimera",
|
|
789
|
+
description: "TNG's R1T Chimera model."
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
name: "[ROLEPLAY] Gryphe: MythoMax 13B",
|
|
793
|
+
value: "gryphe/mythomax-l2-13b",
|
|
794
|
+
description: "Popular roleplay model."
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
name: "[ROLEPLAY] Mancer: Weaver",
|
|
798
|
+
value: "mancer/weaver",
|
|
799
|
+
description: "Roleplay and narrative."
|
|
800
|
+
},
|
|
801
|
+
// ==================== FREE MODELS ====================
|
|
802
|
+
{
|
|
803
|
+
name: "[FREE] Meta: Llama 3.3 70B",
|
|
804
|
+
value: "meta-llama/llama-3.3-70b-instruct:free",
|
|
805
|
+
description: "Free tier Llama 3.3 70B."
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
name: "[FREE] Meta: Llama 3.2 3B",
|
|
809
|
+
value: "meta-llama/llama-3.2-3b-instruct:free",
|
|
810
|
+
description: "Free tier Llama 3.2 3B."
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
name: "[FREE] Meta: Llama 3.1 405B",
|
|
814
|
+
value: "meta-llama/llama-3.1-405b-instruct:free",
|
|
815
|
+
description: "Free tier Llama 3.1 405B."
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
name: "[FREE] Google: Gemini 2.0 Flash Exp",
|
|
819
|
+
value: "google/gemini-2.0-flash-exp:free",
|
|
820
|
+
description: "Free tier Gemini 2.0 Flash."
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
name: "[FREE] Google: Gemma 3 27B",
|
|
824
|
+
value: "google/gemma-3-27b-it:free",
|
|
825
|
+
description: "Free tier Gemma 3 27B."
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
name: "[FREE] Google: Gemma 3 12B",
|
|
829
|
+
value: "google/gemma-3-12b-it:free",
|
|
830
|
+
description: "Free tier Gemma 3 12B."
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
name: "[FREE] Google: Gemma 3 4B",
|
|
834
|
+
value: "google/gemma-3-4b-it:free",
|
|
835
|
+
description: "Free tier Gemma 3 4B."
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
name: "[FREE] Qwen: Qwen3 4B",
|
|
839
|
+
value: "qwen/qwen3-4b:free",
|
|
840
|
+
description: "Free tier Qwen3 4B."
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
name: "[FREE] Qwen: Qwen3 Coder",
|
|
844
|
+
value: "qwen/qwen3-coder:free",
|
|
845
|
+
description: "Free tier Qwen3 Coder."
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
name: "[FREE] Mistral: Small 3.1 24B",
|
|
849
|
+
value: "mistralai/mistral-small-3.1-24b-instruct:free",
|
|
850
|
+
description: "Free tier Mistral Small."
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
name: "[FREE] Mistral: Devstral 2512",
|
|
854
|
+
value: "mistralai/devstral-2512:free",
|
|
855
|
+
description: "Free tier Devstral."
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
name: "[FREE] Mistral: 7B Instruct",
|
|
859
|
+
value: "mistralai/mistral-7b-instruct:free",
|
|
860
|
+
description: "Free tier Mistral 7B."
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
name: "[FREE] NVIDIA: Nemotron 3 Nano 30B",
|
|
864
|
+
value: "nvidia/nemotron-3-nano-30b-a3b:free",
|
|
865
|
+
description: "Free tier NVIDIA Nemotron."
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
name: "[FREE] NVIDIA: Nemotron Nano 9B V2",
|
|
869
|
+
value: "nvidia/nemotron-nano-9b-v2:free",
|
|
870
|
+
description: "Free tier Nemotron Nano."
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
name: "[FREE] Xiaomi: MiMo V2 Flash",
|
|
874
|
+
value: "xiaomi/mimo-v2-flash:free",
|
|
875
|
+
description: "Free tier Xiaomi MiMo. 309B MoE."
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
name: "[FREE] [REASONING] AllenAI: Olmo 3.1 32B Think",
|
|
879
|
+
value: "allenai/olmo-3.1-32b-think:free",
|
|
880
|
+
description: "Free reasoning model. Chain-of-thought."
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
name: "[FREE] DeepSeek: R1 0528",
|
|
884
|
+
value: "deepseek/deepseek-r1-0528:free",
|
|
885
|
+
description: "Free tier DeepSeek R1."
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
name: "[FREE] TNG: R1T Chimera",
|
|
889
|
+
value: "tngtech/tng-r1t-chimera:free",
|
|
890
|
+
description: "Free tier TNG R1T Chimera."
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
name: "[FREE] Moonshot: Kimi K2",
|
|
894
|
+
value: "moonshotai/kimi-k2:free",
|
|
895
|
+
description: "Free tier Kimi K2."
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
name: "[FREE] Alibaba: Tongyi DeepResearch 30B",
|
|
899
|
+
value: "alibaba/tongyi-deepresearch-30b-a3b:free",
|
|
900
|
+
description: "Free tier Alibaba research model."
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
name: "[FREE] OpenAI: GPT OSS 120B",
|
|
904
|
+
value: "openai/gpt-oss-120b:free",
|
|
905
|
+
description: "Free tier OpenAI OSS 120B."
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
name: "[FREE] NousResearch: Hermes 3 405B",
|
|
909
|
+
value: "nousresearch/hermes-3-llama-3.1-405b:free",
|
|
910
|
+
description: "Free tier Hermes 3 405B."
|
|
911
|
+
}
|
|
912
|
+
],
|
|
913
|
+
default: "openai/gpt-4o-mini",
|
|
914
|
+
description: "Select a model or type any OpenRouter model ID. See https://openrouter.ai/models for all available models. Examples: 'openai/gpt-4o', 'anthropic/claude-3.5-sonnet', 'google/gemini-pro-1.5'"
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
displayName: "Messages",
|
|
918
|
+
name: "messages",
|
|
919
|
+
type: "fixedCollection",
|
|
920
|
+
typeOptions: {
|
|
921
|
+
multipleValues: true
|
|
922
|
+
},
|
|
923
|
+
default: {},
|
|
924
|
+
options: [
|
|
925
|
+
{
|
|
926
|
+
name: "message",
|
|
927
|
+
displayName: "Message",
|
|
928
|
+
values: [
|
|
59
929
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
930
|
+
displayName: "Role",
|
|
931
|
+
name: "role",
|
|
932
|
+
type: "options",
|
|
933
|
+
options: [
|
|
934
|
+
{
|
|
935
|
+
name: "System",
|
|
936
|
+
value: "system",
|
|
937
|
+
description: "System message to set behavior"
|
|
65
938
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
description: "Simple and fast default option - GPT-4o Mini",
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: "OpenAI - GPT-4o",
|
|
74
|
-
value: "openai/gpt-4o",
|
|
75
|
-
description: "OpenAI's latest GPT-4o model",
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: "OpenAI - GPT-4o Mini",
|
|
79
|
-
value: "openai/gpt-4o-mini",
|
|
80
|
-
description: "Fast and efficient GPT-4o Mini",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: "OpenAI - GPT-4 Turbo",
|
|
84
|
-
value: "openai/gpt-4-turbo",
|
|
85
|
-
description: "GPT-4 Turbo with extended context",
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: "OpenAI - GPT-4",
|
|
89
|
-
value: "openai/gpt-4",
|
|
90
|
-
description: "OpenAI GPT-4",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "OpenAI - GPT-3.5 Turbo",
|
|
94
|
-
value: "openai/gpt-3.5-turbo",
|
|
95
|
-
description: "Fast GPT-3.5 Turbo model",
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: "Anthropic - Claude 3.5 Sonnet",
|
|
99
|
-
value: "anthropic/claude-3.5-sonnet",
|
|
100
|
-
description: "Anthropic's Claude 3.5 Sonnet",
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: "Anthropic - Claude 3 Opus",
|
|
104
|
-
value: "anthropic/claude-3-opus",
|
|
105
|
-
description: "Anthropic's Claude 3 Opus",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "Anthropic - Claude 3 Sonnet",
|
|
109
|
-
value: "anthropic/claude-3-sonnet",
|
|
110
|
-
description: "Anthropic's Claude 3 Sonnet",
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: "Anthropic - Claude 3 Haiku",
|
|
114
|
-
value: "anthropic/claude-3-haiku",
|
|
115
|
-
description: "Fast Claude 3 Haiku model",
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: "Google - Gemini Pro 1.5",
|
|
119
|
-
value: "google/gemini-pro-1.5",
|
|
120
|
-
description: "Google Gemini Pro 1.5",
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
name: "Google - Gemini Pro",
|
|
124
|
-
value: "google/gemini-pro",
|
|
125
|
-
description: "Google Gemini Pro",
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: "Google - Gemini Flash 1.5",
|
|
129
|
-
value: "google/gemini-flash-1.5",
|
|
130
|
-
description: "Fast Gemini Flash 1.5",
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
name: "Meta - Llama 3.1 405B",
|
|
134
|
-
value: "meta-llama/llama-3.1-405b-instruct",
|
|
135
|
-
description: "Meta Llama 3.1 405B Instruct",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: "Meta - Llama 3.1 70B",
|
|
139
|
-
value: "meta-llama/llama-3.1-70b-instruct",
|
|
140
|
-
description: "Meta Llama 3.1 70B Instruct",
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: "Meta - Llama 3 70B",
|
|
144
|
-
value: "meta-llama/llama-3-70b-instruct",
|
|
145
|
-
description: "Meta Llama 3 70B Instruct",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
name: "Mistral AI - Mistral Large",
|
|
149
|
-
value: "mistralai/mistral-large",
|
|
150
|
-
description: "Mistral AI Large model",
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
name: "Mistral AI - Mixtral 8x7B",
|
|
154
|
-
value: "mistralai/mixtral-8x7b-instruct",
|
|
155
|
-
description: "Mistral Mixtral 8x7B Instruct",
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: "Mistral AI - Mistral 7B",
|
|
159
|
-
value: "mistralai/mistral-7b-instruct",
|
|
160
|
-
description: "Mistral 7B Instruct",
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: "Cohere - Command R+",
|
|
164
|
-
value: "cohere/command-r-plus",
|
|
165
|
-
description: "Cohere Command R+",
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: "Perplexity - Sonar",
|
|
169
|
-
value: "perplexity/sonar",
|
|
170
|
-
description: "Perplexity Sonar model",
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: "xAI - Grok Beta",
|
|
174
|
-
value: "x-ai/grok-beta",
|
|
175
|
-
description: "xAI Grok Beta",
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
default: "openai/gpt-4o-mini",
|
|
179
|
-
description: "Select a model or type any OpenRouter model ID. See https://openrouter.ai/models for all available models. Examples: 'openai/gpt-4o', 'anthropic/claude-3.5-sonnet', 'google/gemini-pro-1.5'",
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
displayName: "Messages",
|
|
183
|
-
name: "messages",
|
|
184
|
-
type: "fixedCollection",
|
|
185
|
-
typeOptions: {
|
|
186
|
-
multipleValues: true,
|
|
939
|
+
{
|
|
940
|
+
name: "User",
|
|
941
|
+
value: "user",
|
|
942
|
+
description: "User message"
|
|
187
943
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
name: "role",
|
|
197
|
-
type: "options",
|
|
198
|
-
options: [
|
|
199
|
-
{
|
|
200
|
-
name: "System",
|
|
201
|
-
value: "system",
|
|
202
|
-
description: "System message to set behavior",
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
name: "User",
|
|
206
|
-
value: "user",
|
|
207
|
-
description: "User message",
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
name: "Assistant",
|
|
211
|
-
value: "assistant",
|
|
212
|
-
description: "Assistant message (for conversation history)",
|
|
213
|
-
},
|
|
214
|
-
],
|
|
215
|
-
default: "user",
|
|
216
|
-
description: "The role of the message",
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
displayName: "Content",
|
|
220
|
-
name: "content",
|
|
221
|
-
type: "string",
|
|
222
|
-
default: "",
|
|
223
|
-
typeOptions: {
|
|
224
|
-
rows: 4,
|
|
225
|
-
},
|
|
226
|
-
description: "The content of the message",
|
|
227
|
-
},
|
|
228
|
-
],
|
|
229
|
-
},
|
|
230
|
-
],
|
|
231
|
-
description: "The messages to send to the model",
|
|
944
|
+
{
|
|
945
|
+
name: "Assistant",
|
|
946
|
+
value: "assistant",
|
|
947
|
+
description: "Assistant message (for conversation history)"
|
|
948
|
+
}
|
|
949
|
+
],
|
|
950
|
+
default: "user",
|
|
951
|
+
description: "The role of the message"
|
|
232
952
|
},
|
|
233
953
|
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
name: "temperature",
|
|
243
|
-
type: "number",
|
|
244
|
-
typeOptions: {
|
|
245
|
-
minValue: 0,
|
|
246
|
-
maxValue: 2,
|
|
247
|
-
numberStepSize: 0.1,
|
|
248
|
-
},
|
|
249
|
-
default: 1,
|
|
250
|
-
description: "Controls randomness. Lower values make output more deterministic",
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
displayName: "Max Tokens",
|
|
254
|
-
name: "max_tokens",
|
|
255
|
-
type: "number",
|
|
256
|
-
typeOptions: {
|
|
257
|
-
minValue: 1,
|
|
258
|
-
},
|
|
259
|
-
default: 2048,
|
|
260
|
-
description: "Maximum number of tokens to generate",
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
displayName: "Top P",
|
|
264
|
-
name: "top_p",
|
|
265
|
-
type: "number",
|
|
266
|
-
typeOptions: {
|
|
267
|
-
minValue: 0,
|
|
268
|
-
maxValue: 1,
|
|
269
|
-
numberStepSize: 0.1,
|
|
270
|
-
},
|
|
271
|
-
default: 1,
|
|
272
|
-
description: "Nucleus sampling: consider tokens with top_p probability mass",
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
displayName: "Frequency Penalty",
|
|
276
|
-
name: "frequency_penalty",
|
|
277
|
-
type: "number",
|
|
278
|
-
typeOptions: {
|
|
279
|
-
minValue: -2,
|
|
280
|
-
maxValue: 2,
|
|
281
|
-
numberStepSize: 0.1,
|
|
282
|
-
},
|
|
283
|
-
default: 0,
|
|
284
|
-
description: "Penalize tokens based on their frequency in the text so far",
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
displayName: "Presence Penalty",
|
|
288
|
-
name: "presence_penalty",
|
|
289
|
-
type: "number",
|
|
290
|
-
typeOptions: {
|
|
291
|
-
minValue: -2,
|
|
292
|
-
maxValue: 2,
|
|
293
|
-
numberStepSize: 0.1,
|
|
294
|
-
},
|
|
295
|
-
default: 0,
|
|
296
|
-
description: "Penalize tokens based on whether they appear in the text so far",
|
|
297
|
-
},
|
|
298
|
-
],
|
|
299
|
-
description: "Additional options for the chat completion",
|
|
300
|
-
},
|
|
301
|
-
],
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
async execute() {
|
|
305
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
306
|
-
const items = this.getInputData();
|
|
307
|
-
const returnData = [];
|
|
308
|
-
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
309
|
-
try {
|
|
310
|
-
// Get authentication type
|
|
311
|
-
const authentication = this.getNodeParameter("authentication", itemIndex);
|
|
312
|
-
// Get authentication header
|
|
313
|
-
let authHeader;
|
|
314
|
-
if (authentication === "oAuth2") {
|
|
315
|
-
// OAuth2 authentication
|
|
316
|
-
const credentials = (await this.getCredentials("agnicWalletOAuth2Api", itemIndex));
|
|
317
|
-
authHeader = `Bearer ${String(credentials.oauthTokenData.access_token)}`;
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
// API Key authentication
|
|
321
|
-
const credentials = await this.getCredentials("agnicWalletApi", itemIndex);
|
|
322
|
-
const { apiToken } = credentials;
|
|
323
|
-
authHeader = `Bearer ${String(apiToken)}`;
|
|
324
|
-
}
|
|
325
|
-
// Get model parameter (supports both dropdown selection and custom input)
|
|
326
|
-
const modelParam = this.getNodeParameter("model", itemIndex);
|
|
327
|
-
const model = modelParam === null || modelParam === void 0 ? void 0 : modelParam.trim();
|
|
328
|
-
if (!model || model === "") {
|
|
329
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Model must be specified. Enter an OpenRouter model ID (e.g., 'openai/gpt-4o' or 'anthropic/claude-3.5-sonnet'). See https://openrouter.ai/models for all available models.", { itemIndex });
|
|
330
|
-
}
|
|
331
|
-
// Get messages
|
|
332
|
-
const messagesConfig = this.getNodeParameter("messages", itemIndex, {});
|
|
333
|
-
if (!messagesConfig.message || messagesConfig.message.length === 0) {
|
|
334
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "At least one message is required", { itemIndex });
|
|
335
|
-
}
|
|
336
|
-
const messages = messagesConfig.message.map((msg) => ({
|
|
337
|
-
role: msg.role,
|
|
338
|
-
content: msg.content,
|
|
339
|
-
}));
|
|
340
|
-
// Get options
|
|
341
|
-
const options = this.getNodeParameter("options", itemIndex, {});
|
|
342
|
-
// Build request body
|
|
343
|
-
const requestBody = {
|
|
344
|
-
model: model.trim(),
|
|
345
|
-
messages,
|
|
346
|
-
};
|
|
347
|
-
if (options.temperature !== undefined) {
|
|
348
|
-
requestBody.temperature = options.temperature;
|
|
349
|
-
}
|
|
350
|
-
if (options.max_tokens !== undefined) {
|
|
351
|
-
requestBody.max_tokens = options.max_tokens;
|
|
352
|
-
}
|
|
353
|
-
if (options.top_p !== undefined) {
|
|
354
|
-
requestBody.top_p = options.top_p;
|
|
954
|
+
displayName: "Content",
|
|
955
|
+
name: "content",
|
|
956
|
+
type: "string",
|
|
957
|
+
default: "",
|
|
958
|
+
typeOptions: {
|
|
959
|
+
rows: 4
|
|
960
|
+
},
|
|
961
|
+
description: "The content of the message"
|
|
355
962
|
}
|
|
356
|
-
|
|
357
|
-
requestBody.frequency_penalty = options.frequency_penalty;
|
|
358
|
-
}
|
|
359
|
-
if (options.presence_penalty !== undefined) {
|
|
360
|
-
requestBody.presence_penalty = options.presence_penalty;
|
|
361
|
-
}
|
|
362
|
-
// Make request to AgnicPay AI Gateway
|
|
363
|
-
const apiUrl = "https://api.agnicpay.xyz/v1/chat/completions";
|
|
364
|
-
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.info(`[AgnicAI] Calling AgnicPay AI Gateway with model: ${model}`);
|
|
365
|
-
const response = await this.helpers.httpRequest({
|
|
366
|
-
method: "POST",
|
|
367
|
-
url: apiUrl,
|
|
368
|
-
headers: {
|
|
369
|
-
"Content-Type": "application/json",
|
|
370
|
-
Authorization: authHeader,
|
|
371
|
-
},
|
|
372
|
-
body: requestBody,
|
|
373
|
-
json: true,
|
|
374
|
-
});
|
|
375
|
-
// Format response
|
|
376
|
-
const formattedResponse = {
|
|
377
|
-
...response,
|
|
378
|
-
content: ((_d = (_c = (_b = response.choices) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.message) === null || _d === void 0 ? void 0 : _d.content) ||
|
|
379
|
-
((_f = (_e = response.choices) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.text) ||
|
|
380
|
-
response.content,
|
|
381
|
-
role: ((_j = (_h = (_g = response.choices) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.message) === null || _j === void 0 ? void 0 : _j.role) || "assistant",
|
|
382
|
-
};
|
|
383
|
-
returnData.push({
|
|
384
|
-
json: formattedResponse,
|
|
385
|
-
pairedItem: {
|
|
386
|
-
item: itemIndex,
|
|
387
|
-
},
|
|
388
|
-
});
|
|
963
|
+
]
|
|
389
964
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
965
|
+
],
|
|
966
|
+
description: "The messages to send to the model"
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
displayName: "Options",
|
|
970
|
+
name: "options",
|
|
971
|
+
type: "collection",
|
|
972
|
+
placeholder: "Add Option",
|
|
973
|
+
default: {},
|
|
974
|
+
options: [
|
|
975
|
+
{
|
|
976
|
+
displayName: "Temperature",
|
|
977
|
+
name: "temperature",
|
|
978
|
+
type: "number",
|
|
979
|
+
typeOptions: {
|
|
980
|
+
minValue: 0,
|
|
981
|
+
maxValue: 2,
|
|
982
|
+
numberStepSize: 0.1
|
|
983
|
+
},
|
|
984
|
+
default: 1,
|
|
985
|
+
description: "Controls randomness. Lower values make output more deterministic"
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
displayName: "Max Tokens",
|
|
989
|
+
name: "max_tokens",
|
|
990
|
+
type: "number",
|
|
991
|
+
typeOptions: {
|
|
992
|
+
minValue: 1
|
|
993
|
+
},
|
|
994
|
+
default: 2048,
|
|
995
|
+
description: "Maximum number of tokens to generate"
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
displayName: "Top P",
|
|
999
|
+
name: "top_p",
|
|
1000
|
+
type: "number",
|
|
1001
|
+
typeOptions: {
|
|
1002
|
+
minValue: 0,
|
|
1003
|
+
maxValue: 1,
|
|
1004
|
+
numberStepSize: 0.1
|
|
1005
|
+
},
|
|
1006
|
+
default: 1,
|
|
1007
|
+
description: "Nucleus sampling: consider tokens with top_p probability mass"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
displayName: "Frequency Penalty",
|
|
1011
|
+
name: "frequency_penalty",
|
|
1012
|
+
type: "number",
|
|
1013
|
+
typeOptions: {
|
|
1014
|
+
minValue: -2,
|
|
1015
|
+
maxValue: 2,
|
|
1016
|
+
numberStepSize: 0.1
|
|
1017
|
+
},
|
|
1018
|
+
default: 0,
|
|
1019
|
+
description: "Penalize tokens based on their frequency in the text so far"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
displayName: "Presence Penalty",
|
|
1023
|
+
name: "presence_penalty",
|
|
1024
|
+
type: "number",
|
|
1025
|
+
typeOptions: {
|
|
1026
|
+
minValue: -2,
|
|
1027
|
+
maxValue: 2,
|
|
1028
|
+
numberStepSize: 0.1
|
|
1029
|
+
},
|
|
1030
|
+
default: 0,
|
|
1031
|
+
description: "Penalize tokens based on whether they appear in the text so far"
|
|
1032
|
+
}
|
|
1033
|
+
],
|
|
1034
|
+
description: "Additional options for the chat completion"
|
|
1035
|
+
}
|
|
1036
|
+
]
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
static {
|
|
1040
|
+
__name(this, "AgnicAI");
|
|
1041
|
+
}
|
|
1042
|
+
async execute() {
|
|
1043
|
+
const items = this.getInputData();
|
|
1044
|
+
const returnData = [];
|
|
1045
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
1046
|
+
try {
|
|
1047
|
+
const authentication = this.getNodeParameter(
|
|
1048
|
+
"authentication",
|
|
1049
|
+
itemIndex
|
|
1050
|
+
);
|
|
1051
|
+
let authHeader;
|
|
1052
|
+
if (authentication === "oAuth2") {
|
|
1053
|
+
const credentials = await this.getCredentials(
|
|
1054
|
+
"agnicWalletOAuth2Api",
|
|
1055
|
+
itemIndex
|
|
1056
|
+
);
|
|
1057
|
+
authHeader = `Bearer ${String(credentials.oauthTokenData.access_token)}`;
|
|
1058
|
+
} else {
|
|
1059
|
+
const credentials = await this.getCredentials(
|
|
1060
|
+
"agnicWalletApi",
|
|
1061
|
+
itemIndex
|
|
1062
|
+
);
|
|
1063
|
+
const { apiToken } = credentials;
|
|
1064
|
+
authHeader = `Bearer ${String(apiToken)}`;
|
|
1065
|
+
}
|
|
1066
|
+
const modelParam = this.getNodeParameter("model", itemIndex);
|
|
1067
|
+
const model = modelParam?.trim();
|
|
1068
|
+
if (!model || model === "") {
|
|
1069
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
1070
|
+
this.getNode(),
|
|
1071
|
+
"Model must be specified. Enter an OpenRouter model ID (e.g., 'openai/gpt-4o' or 'anthropic/claude-3.5-sonnet'). See https://openrouter.ai/models for all available models.",
|
|
1072
|
+
{ itemIndex }
|
|
1073
|
+
);
|
|
1074
|
+
}
|
|
1075
|
+
const messagesConfig = this.getNodeParameter(
|
|
1076
|
+
"messages",
|
|
1077
|
+
itemIndex,
|
|
1078
|
+
{}
|
|
1079
|
+
);
|
|
1080
|
+
if (!messagesConfig.message || messagesConfig.message.length === 0) {
|
|
1081
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
1082
|
+
this.getNode(),
|
|
1083
|
+
"At least one message is required",
|
|
1084
|
+
{ itemIndex }
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
const messages = messagesConfig.message.map(
|
|
1088
|
+
(msg) => ({
|
|
1089
|
+
role: msg.role,
|
|
1090
|
+
content: msg.content
|
|
1091
|
+
})
|
|
1092
|
+
);
|
|
1093
|
+
const options = this.getNodeParameter("options", itemIndex, {});
|
|
1094
|
+
const requestBody = {
|
|
1095
|
+
model: model.trim(),
|
|
1096
|
+
messages
|
|
1097
|
+
};
|
|
1098
|
+
if (options.temperature !== void 0) {
|
|
1099
|
+
requestBody.temperature = options.temperature;
|
|
1100
|
+
}
|
|
1101
|
+
if (options.max_tokens !== void 0) {
|
|
1102
|
+
requestBody.max_tokens = options.max_tokens;
|
|
1103
|
+
}
|
|
1104
|
+
if (options.top_p !== void 0) {
|
|
1105
|
+
requestBody.top_p = options.top_p;
|
|
1106
|
+
}
|
|
1107
|
+
if (options.frequency_penalty !== void 0) {
|
|
1108
|
+
requestBody.frequency_penalty = options.frequency_penalty;
|
|
1109
|
+
}
|
|
1110
|
+
if (options.presence_penalty !== void 0) {
|
|
1111
|
+
requestBody.presence_penalty = options.presence_penalty;
|
|
1112
|
+
}
|
|
1113
|
+
const apiUrl = "https://api.agnicpay.xyz/v1/chat/completions";
|
|
1114
|
+
this.logger?.info(
|
|
1115
|
+
`[AgnicAI] Calling AgnicPay AI Gateway with model: ${model}`
|
|
1116
|
+
);
|
|
1117
|
+
const response = await this.helpers.httpRequest({
|
|
1118
|
+
method: "POST",
|
|
1119
|
+
url: apiUrl,
|
|
1120
|
+
headers: {
|
|
1121
|
+
"Content-Type": "application/json",
|
|
1122
|
+
Authorization: authHeader
|
|
1123
|
+
},
|
|
1124
|
+
body: requestBody,
|
|
1125
|
+
json: true
|
|
1126
|
+
});
|
|
1127
|
+
const formattedResponse = {
|
|
1128
|
+
...response,
|
|
1129
|
+
content: response.choices?.[0]?.message?.content || response.choices?.[0]?.text || response.content,
|
|
1130
|
+
role: response.choices?.[0]?.message?.role || "assistant"
|
|
1131
|
+
};
|
|
1132
|
+
returnData.push({
|
|
1133
|
+
json: formattedResponse,
|
|
1134
|
+
pairedItem: {
|
|
1135
|
+
item: itemIndex
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
} catch (error) {
|
|
1139
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
1140
|
+
let detailedError = errorMessage;
|
|
1141
|
+
if (error && typeof error === "object" && "response" in error) {
|
|
1142
|
+
const responseError = error;
|
|
1143
|
+
if (responseError.response?.body) {
|
|
1144
|
+
detailedError = JSON.stringify(responseError.response.body);
|
|
1145
|
+
} else if (responseError.response?.statusCode) {
|
|
1146
|
+
detailedError = `HTTP ${responseError.response.statusCode}: ${errorMessage}`;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
if (this.continueOnFail()) {
|
|
1150
|
+
returnData.push({
|
|
1151
|
+
json: {
|
|
1152
|
+
error: detailedError
|
|
1153
|
+
},
|
|
1154
|
+
pairedItem: {
|
|
1155
|
+
item: itemIndex
|
|
417
1156
|
}
|
|
1157
|
+
});
|
|
1158
|
+
continue;
|
|
418
1159
|
}
|
|
419
|
-
|
|
1160
|
+
throw new import_n8n_workflow.NodeOperationError(this.getNode(), detailedError, {
|
|
1161
|
+
itemIndex
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
420
1164
|
}
|
|
421
|
-
|
|
422
|
-
|
|
1165
|
+
return [returnData];
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1169
|
+
0 && (module.exports = {
|
|
1170
|
+
AgnicAI
|
|
1171
|
+
});
|