JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q31210F
  • License ISC

This package is a wrapper for the Mycelium-API which makes it easier for developers to use our API

Package Exports

  • mycelium-api-wrapper
  • mycelium-api-wrapper/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mycelium-api-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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)

License

This project is licensed under the ISC License