The Free AI is an npm package designed to help developers interact with the powerful AI-based image generation and question-answering functionalities provided by free-ai.xyz. This API is perfect for creating dynamic AI-driven content for websites, apps, or bots.
To get started, install the package and obtain your API key from the dashboard.
- Visit free-ai.xyz/dashboard to create an account or log in.
- Once logged in, click the generate API Key button to generate your API key.
- Use the provided API key in your application.
npm install @milcondev/free-ai
- AI Image Generation: Create stunning AI-generated images with custom prompts.
- AI Question & Chat Handling: Submit questions or chat content and receive AI-generated responses.
- Moderation Filter: Check content for appropriateness using the moderation filter API.
- Changeable AI Models: Users can specify which AI model to use based on their needs.
- Free AI Basic Model: A simplified AI chat model for basic AI-generated responses.
- Easy Integration: Simple, lightweight, and well-documented API.
const FreeAI = require('@milcondev/free-ai');
const freeAI = new FreeAI('your-api-key');
// Example of generating an image (model is optional and defaults to 'v3')
freeAI.generateImage('Prompt', 'v3')
.then(imageUrl => console.log('Generated Image URL:', imageUrl))
.catch(error => console.error('Error:', error.message));
// Example of asking a question (model is optional and defaults to 'v3')
freeAI.askQuestion('What is the population of Earth?')
.then(response => console.log('Question Response:', response))
.catch(error => console.error('Error:', error.message));
// Example of using the Free AI Basic model for a simple response
freeAI.basicAiResponse('Hello, how are you?')
.then(response => console.log('Basic AI Response:', response))
.catch(error => console.error('Error:', error.message));
// Example of checking content with the moderation filter
freeAI.checkContent('Some inappropriate content')
.then(response => console.log('Moderation Response:', response))
.catch(error => console.error('Error:', error.message));
- Description: Generates an AI-generated image based on the provided prompt and model.
-
Parameters:
-
prompt
(string): The text prompt for image generation. -
model
(string, optional): The model to use for generation (default is'v3'
). -
negativePrompt
(string, optional): A prompt to specify what should be avoided in the image.
-
- Description: Submits a question or chat content and receives a response from the AI.
-
Parameters:
-
content
(string): The question or chat content. -
model
(string, optional): The model to use for generating the response (default is'v3'
).
-
- Description: Checks the provided content for appropriateness using the moderation filter.
-
Parameters:
-
content
(string): The content to be checked.
-
- Description: Provides a simple AI-generated response using the Free AI Basic model.
-
Parameters:
-
message
(string): The message or prompt for generating the response.
-
This project is licensed under the MIT License