API

Base URL: https://makulu.online:6003

1. Chat Endpoint – Only Text capable Endpoint

URL: /api/chat

Method: POST

Request Payload:

{
    "prompt": "Your message here",
    "conversation_id": "optional-conversation-id"
}

Parameters:

  • prompt (string): The message you want to send to the chat API.
  • conversation_id (string, optional): Identify an ongoing conversation.

Response Format:

{
    "response": "AI response here",
    "conversation_id": "the conversation ID used"
}

Example Requests:

Python Request


import requests

url = "https://makulu.online:6003/api/chat"
payload = {
    "prompt": "Hello, how can I improve my coding skills?",
    "conversation_id": "12345"
}
response = requests.post(url, json=payload)
print(response.json())
        

Bash Command

curl -X POST "https://makulu.online:6003/api/chat" \
     -H "Content-Type: application/json" \
     -d '{"prompt":"Hello, how can I improve my coding skills?", "conversation_id": "12345"}'

Java Request


import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://makulu.online:6003/api/chat");
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/json");
            conn.setDoOutput(true);

            String input = "{\"prompt\":\"Hello, how can I improve my coding skills?\", \"conversation_id\": \"12345\"}";

            try(OutputStream os = conn.getOutputStream()) {
                byte[] inputBytes = input.getBytes("utf-8");
                os.write(inputBytes, 0, inputBytes.length);           
            }
            System.out.println("Response Code: " + conn.getResponseCode());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
        

Go Request


package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://makulu.online:6003/api/chat"
    payload := map[string]interface{}{
        "prompt": "Hello, how can I improve my coding skills?",
        "conversation_id": "12345",
    }
    jsonPayload, _ := json.Marshal(payload)

    resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonPayload))
    if err != nil {
        fmt.Println(err)
    }
    defer resp.Body.Close()
    fmt.Println("Response Status:", resp.Status)
}
        

2. Ask Endpoint – Text, Mode, Image, Audio and Video capable Endpoint

URL: /api/ask

Method: POST

Request Payload:

{
    "message": "Your question here",
    "mode": "optional-mode", // e.g., "normal", "coder", etc.
    "conversation_id": "optional-conversation-id"
}

Parameters:

  • message (string): The user’s message/question.
  • mode (string, optional): The mode to use for the AI response: ( normal, informational, anti_woke, imaginative, coder, blogger )
  • conversation_id (string, optional): Identify an ongoing conversation.

Response Format:

{
    "response": "AI response here",
    "conversation_id": "the conversation ID used"
}

Example Requests:

Python Request


import requests

url = "https://makulu.online:6003/api/ask"
payload = {
    "message": "What's the best way to learn Python?",
    "mode": "coder",
    "conversation_id": "12345"
}
response = requests.post(url, json=payload)
print(response.json())
        

Bash Command

curl -X POST "https://makulu.online:6003/api/ask" \
     -H "Content-Type: application/json" \
     -d '{"message":"What\'s the best way to learn Python?", "mode": "coder", "conversation_id": "12345"}'

Java Request


import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://makulu.online:6003/api/ask");
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/json");
            conn.setDoOutput(true);

            String input = "{\"message\":\"What’s the best way to learn Python?\", \"mode\": \"coder\", \"conversation_id\": \"12345\"}";

            try(OutputStream os = conn.getOutputStream()) {
                byte[] inputBytes = input.getBytes("utf-8");
                os.write(inputBytes, 0, inputBytes.length);           
            }
            System.out.println("Response Code: " + conn.getResponseCode());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
        

Go Request


package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://makulu.online:6003/api/ask"
    payload := map[string]interface{}{
        "message": "What's the best way to learn Python?",
        "mode": "coder",
        "conversation_id": "12345",
    }
    jsonPayload, _ := json.Marshal(payload)

    resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonPayload))
    if err != nil {
        fmt.Println(err)
    }
    defer resp.Body.Close()
    fmt.Println("Response Status:", resp.Status)
}
        

Notes

  • The /chat endpoint is text only, but its snappy and fast.
  • The /ask endpoint gives Electra generaton capabilities, you can ask her to generate images, audio or videos.
  • Ensure HTTPS is used to keep requests secure.
  • Only “normal, informational and anti_woke” modes are capable of generating images, audio and videos.
  • “Conversation_id” is used to track conversation history, Replace all instances of “12345” in conversation_id with the actual ID you want to track the conversation.
  • This API can handle 100 requests per second, 6000 requests per minute, anything above that and your requests will get qeued.
  • We capped storage of conversation history at around 7000 words / 14 pages worth of text. We will adjust history storage as needed.