Edgen AI
The easiest way to start is to install our npm package.
npm install edgenaiWith yarn:
yarn add edgenaiWith pnpm:
pnpm add edgenaiNow, getting an API key is easy.
npx edgenai@latest initThis will open a browser window where you can sign up for a free account and get an API key and create a .env file waiting for you to paste the API key.
Now, in your project, you can use the API key to start using the API.
import EdgenAI from "edgenai";
// We recommend you ONLY do this in your backend
const edgenai = new EdgenAI({
apiKey: process.env.EDGENAI_API_KEY,
});You can also create a token to use the API in the frontend.
const token = await edgenai.createToken({ options });Now, you can use the token to start using the API in the frontend.
const edgenai = new EdgenAI({
token: token,
});