You've probably gone crazy but yes, it is possible to add AI to Nightbot with an API that is totally free, and that's the one from Shapes.inc.
Backstory: Shapes.inc is a platform in charge of making fully customizable social AI agents so you are not using a standard AI like ChatGPT, but rather, you are adding to your chat a bot that can perfectly simulate a human or anime character.
Before to Go: ⚠️ You need to have created a shape in the Shapes.inc dashboard first in order to get API working. You can follow the official Shapes.inc wiki here, there are many advantages and models you can use (Even GPT 4o Mini it's free), this AI is fully customizable.
1. According to Shapes Inc API Developer Documentation you can setup a private server using Flask (Python) which the following code:
pyfrom flask import Flask, request, jsonifyfrom openai import OpenAI# Initialize the OpenAI client for Shapes APIopenai = OpenAI(api_key="YOUR_API_KEY_HERE", # Replace with your actual Shapes API keybase_url="https://api.shapes.inc/v1/")# Create Flask appapp = Flask(__name__)@app.route('/', methods=['GET'])def get_response():# Read the 'query' parameter from the GET requestquery = request.args.get('query')if not query:return jsonify({'error': 'No query provided'}), 400try:# Send prompt to the Shapes APIresponse = openai.chat.completions.create(model="shapesinc/YOUR_MODEL_USERNAME", # Replace with your actual model USERNAME (with no @)messages=[{"role": "user", "content": query}])# Extract the generated message contentgenerated_text = response.choices[0].message.content

