mycelium-api-wrapper

1.0.9 • Public • Published

Mycelium AI API Wrapper

A simple wrapper for the Mycelium AI API to facilitate interaction with the API.

Installation

You can install the package using npm:

npm install mycelium-api-wrapper

Usage

const mycelium = require('mycelium-api-wrapper');

async function main() {
  try {
    const catImage = await mycelium.RandomCatImage('Your-API-Token');
    console.log('Random Cat Image:', catImage);

    const duckImage = await mycelium.RandomDuckImage('Your-API-Token');
    console.log('Random Duck Image:', duckImage);
    
    const gptResponse = await mycelium.gpt('Prompt text', 'Your-API-Token');
    console.log('GPT Response:', gptResponse);

    const dalleResponse = await mycelium.dalle('DALL-E Prompt', 'Your-API-Token');
    console.log('DALL-E Response:', dalleResponse);

    const moderationResponse = await mycelium.moderateContent('Text to moderate', 'Your-API-Token');
    console.log('Moderation Response:', moderationResponse);
  } catch (error) {
    console.error('Error:', error);
  }
}

main();

Please replace 'Your-API-Token' with your actual API token in the code example.

API

RandomCatImage(token)

Fetches a random cat image URL.

RandomDuckImage(token)

Fetches a random duck image URL.

gpt(prompt, token)

Generates a response using the GPT-3.5 model.

dalle(prompt, token)

Generates an image URL using the DALL-E model.

moderateContent(text, token)

Moderates text content

register(username, email, password)

Register an account to get an api key (must be done on a residential ip)

Links

License

This project is licensed under the ISC License

Package Sidebar

Install

npm i mycelium-api-wrapper

Weekly Downloads

8

Version

1.0.9

License

ISC

Unpacked Size

9.59 kB

Total Files

12

Last publish

Collaborators

  • growtoups