aikey

1.0.2 • Public • Published


OpenAI authenticator
AIKey

NodeJS library to generate OpenAI access token for ChatGPT.

Made by rhaym-tech

PrerequisitesGetting StartedUsageCredit

📦 Prerequisites 📦

🚀 Getting Started 🚀

  • Open the terminal and run the following commands
npm install aikey

Usage

Importing

ESM:

import OpenAITokenGen from "aikey";

CommonJS

async function example() {
  // To use ESM in CommonJS, you can use a dynamic import
  const { OpenAITokenGen } = await import('aikey')

  const generator = new OpenAITokenGen();

  const Access_Token = await generator.login("OpenAI email", "OpenAI password")
  console.log(Access_Token);
}

Print the Access Token

import OpenAITokenGen from "aikey";

  const generator = new OpenAITokenGen();

  const Access_Token = await generator.login("OpenAI email", "OpenAI password")
  console.log(Access_Token);

Use it with ChatGPT ( ChatGPTUnofficialProxyAPI )

import { ChatGPTUnofficialProxyAPI } from 'chatgpt';
import OpenAITokenGen from 'aikey';

async function ChatGPT() {
  const generator = new OpenAITokenGen();
  const api = new ChatGPTUnofficialProxyAPI({
    accessToken: await generator.login("OpenAI email", "OpenAI password");
  })

  const response = await api.sendMessage('Hello World!')
  console.log(response.text)
}

🤝 Credits 🤝

@rhaym-tech: Project owner
@transitive-bullshit: Node.js client for ChatGPT developer
@rawandahmad698: for the reverse engineering of the protocol
OpenAIAuth Python OpenAI Authentication Library for ChatGPT
OpenAI: OpenAI API owner

Package Sidebar

Install

npm i aikey

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

6.95 kB

Total Files

5

Last publish

Collaborators

  • rhaym-tech