n8n-nodes-g4f
Version:
An n8n node to interact with the g4f (GPT-4-Free) API.
50 lines • 1.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.G4fApi = void 0;
class G4fApi {
constructor() {
this.name = 'g4fApi';
this.displayName = 'G4f API';
this.documentationUrl = 'https://github.com/xtekky/gpt4free';
this.properties = [
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: 'http://localhost:6969',
placeholder: 'http://localhost:6969',
required: true,
description: 'The root URL of your g4f API. Do not include /v1 or other paths.',
},
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: {
password: true,
},
default: '',
description: 'API Key (Bearer Token) for your g4f service. Can be left empty if your endpoint requires no authentication.',
},
{
displayName: 'Organization',
name: 'organization',
type: 'string',
default: '',
description: 'The organization ID to use for the API call (optional)',
},
];
this.test = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/v1/providers',
headers: {
'Accept': 'application/json',
'Authorization': '={{$credentials.apiKey ? `Bearer ${$credentials.apiKey}` : ""}}',
},
},
};
}
}
exports.G4fApi = G4fApi;
//# sourceMappingURL=G4fApi.credentials.js.map