Package Module
Universe API Wrapper using official Universe API package.
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
Was this helpful?