Package Module

Universe API Wrapper using official Universe API package.

TIP

To use @mgalacyber/universeapi, you'll need to install Node.js

@mgalacyber/universeapi requires Node v16.11.0 or higher.

Installation

npm install @mgalacyber/universeapi

How to use

const { UniverseClient } = require("@mgalacyber/universeapi");
const uAPI = new UniverseClient("API_TOKEN");

uAPI.[version].[features].[category](parameter)
    .then(result => {
        console.log(result);
    })
    .catch(error => {
        console.error(error.message);
    });

Example

uAPI.V1.AI.OpenAI.GPT.Text({
    model: "gpt4", // Type of model used
    version: 1, // Model version of rest api
    prompt: "What is Galaxy Universe?" // Enter Your prompt here

}).then((result) => console.log(result));

Full example code

const { UniverseClient } = require("@mgalacyber/universeapi");
const uAPI = new UniverseClient("API_TOKEN");

uAPI.V1.AI.OpenAI.GPT.Text({
    model: "gpt4", // Type of model used
    version: 1, // Model version of rest api
    prompt: "What is Galaxy Universe?" // Enter Your prompt here

}).then((result) => console.log(result));

Response

{
  "status": true,
  "code": 200,
  "speed": "string",
  "author": "string",
  "message": "string",
  "data": "object"
}

Last updated