MVK NexuS
API Documentation
API offering several core services
Available Endpoints
This API offers several core services, categorized below. Use the sidebar navigation or search to filter.
Hex Code Color Information
Route: /color?hex=
Description: Provides detailed information about a hexadecimal color code, including RGB, HSL, CMYK values, luminosity, and names in English and Spanish.
Required parameter: hex
: The hexadecimal color code (e.g., FF5733 or #FF5733).
Request examples:
- /color?hex=FF5733
- /color?hex=%2300FF00 (Use %23 for #)
- /color?hex=0000FF
Expected response (JSON):
{
"color": {
"originalHex": "#FF0000",
"hex": "#FF0000",
"rgb": {
"string": "rgb(255, 0, 0)",
"array": [255, 0, 0]
},
"hsl": {
"string": "hsl(0, 100%, 50%)",
"array": [0, 100, 50]
},
"cmyk": [0, 100, 100, 0],
"luminosity": 0.2126,
"isLight": false,
"isDark": true,
"names": {
"english": "red",
"spanish": "rojo"
},
"requestCount": 1
}
}
Unix Timestamp to Formatted Time Conversion
Route: /'Utimestamp?unix=
Description: Converts a Unix timestamp to a human-readable date and time format.
Required parameter: unix
: The Unix timestamp in seconds.
Request examples:
- /timestamp?unix=1609459200 (January 1, 2021)
- /timestamp?unix=1640995200 (January 1, 2022)
- /timestamp?unix=1672531200 (January 1, 2023)
Expected response (Plain Text): Plain text representing the formatted date and time (e.g., `Friday, August 23, 2024 10:00:00 AM UTC`).
Unit Conversion
Route: /convertirunidad?valor=&de=&a=
Description: Converts a quantity from one unit to another.
Required parameters: valor
, de
(from), and a
(to).
Request examples:
- /convertirunidad?valor=10&de=metros&a=pies (meters to feet)
- /convertirunidad?valor=100&de=kilogramos&a=libras (kilograms to pounds)
- /convertirunidad?valor=30&de=celsius&a=fahrenheit (Celsius to Fahrenheit)
Expected response (Plain Text): Plain text representing the converted value and unit (e.g., `32.81 pies`).
Available Units
Route: /unidades
Description: Returns a list of all available units for conversion.
Request example: /unidades
Expected response: List of units available for conversion (likely JSON or plain text list).
Day Difference Between Dates
Route: /datediff?date1=&date2=
Description: Calculates the difference in days between two dates.
Required parameters: date1
and date2
in ISO format (YYYY-MM-DD).
Request examples:
- /datediff?date1=2023-01-01&date2=2024-08-21
- /datediff?date1=2022-05-15&date2=2023-05-15
- /datediff?date1=2024-02-29&date2=2025-02-28
Expected response (Plain Text): Plain text representing the number of days (e.g., `598`).
Text to Morse Code Conversion
Route: /morse?text=
Description: Converts text into Morse code.
Required parameter: text
.
Request examples:
- /morse?text=Hello
- /morse?text=SOS
- /morse?text=MVK%20NexuS (URL encode spaces)
Expected response (Plain Text): Plain text containing the Morse code representation (e.g., `.... . .-.. .-.. ---`).
Translate Text
Route: /traducir?idioma=&texto=
Description: Automatically translates text from a detected language to the specified language.
Required parameters:
idioma
(language): The target language code (e.g., 'en' for English, 'fr' for French, 'es' for Spanish).texto
(text): The text you want to translate.
Request examples:
- /traducir?idioma=en&texto=Hola%20mundo
- /traducir?idioma=fr&texto=Good%20morning
- /traducir?idioma=es&texto=I%20love%20programming
Expected response (JSON):
{
"result": "Hello world"
}
QR Code Generation
Route: /qr?text=
Description: Generates a QR code based on the provided text and returns the URL to the generated image.
Required parameter: text
: The text you want to convert into a QR code.
Request examples:
- /qr?text=https://www.example.com
- /qr?text=Contact:%20John%20Doe,%20Tel:%20123-456-7890
- /qr?text=WiFi:NetworkName;Password:SecurePassword;
Expected response (JSON):
{"qr":"https://nexus.adonis-except.xyz/public/qr_1746483998957.jpg"}
Image Search
Route: /search-images?q=
Description: Searches for images based on a provided query using Google Images. Returns up to 100 image URLs.
Required parameter: q
: The search query to find images.
Request examples:
- /search-images?q=auroras
- /search-images?q=funny+cats
- /search-images?q=mountain+landscapes
Expected response (JSON):
{
"result": [
"https://example.com/image1.jpg",
"https://example.com/image2.png",
"...",
"https://example.com/image100.gif"
]
}
Welcome Image Generation
Route: /welcome/welcome-image
Method: POST
Content-Type: application/json
Description: This endpoint generates a custom welcome image with a background, text, and user avatar. Requires an API Key sent via header. Returns the path/URL to the generated image.
Required Headers:
x-api-key
: Your API key.
Required parameters (POST - JSON Body):
background
: URL of the background image.text1
: First text to display on the image.text2
: Second text to display on the image.useravatar
: URL of the user's avatar.
Optional parameters (POST - JSON Body):
textColor
: Text color in hexadecimal format (default: white).bordeColor
(border color): Color of the avatar border and image outline in hexadecimal format (default: white).type
(number, optional): Specifies the style of the welcome image. Valid values: 1, 2, or 3.
Example POST requests (JSON):
POST /welcome/welcome-image
Content-Type: application/json
x-api-key: your_api_key_here
{
"background": "https://example.com/background.jpg",
"text1": "Welcome",
"text2": "to our server",
"useravatar": "https://example.com/avatar.png",
"textColor": "#FF0000",
"bordeColor": "#0000FF",
"type": 1
}
POST /welcome/welcome-image
Content-Type: application/json
x-api-key: your_api_key_here
{
"background": "https://example.com/space.jpg",
"text1": "Hello",
"text2": "Explorer",
"useravatar": "https://example.com/astronaut.png",
"bordeColor": "#FFFF00",
"type": 2
}
POST /welcome/welcome-image
Content-Type: application/json
x-api-key: your_api_key_here
{
"background": "https://example.com/forest.jpg",
"text1": "Welcome",
"text2": "to the adventure",
"useravatar": "https://example.com/explorer.png",
"textColor": "#00FF00",
"bordeColor": "#FF00FF",
"type": 3
}
Request Examples:
Ensure you have node-fetch
installed (e.g., npm install node-fetch@2
for CommonJS compatibility).
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/welcome/welcome-image';
const payload = {
background: "https://example.com/background.jpg",
text1: "Welcome",
text2: "to our server",
useravatar: "https://example.com/avatar.png",
textColor: "#FF0000",
bordeColor: "#0000FF",
type: 1
};
async function generateWelcomeImage() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
generateWelcomeImage();
Ensure you have node-fetch
installed (e.g., npm install node-fetch
).
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/welcome/welcome-image';
const payload = {
background: "https://example.com/background.jpg",
text1: "Welcome",
text2: "to our server",
useravatar: "https://example.com/avatar.png",
textColor: "#FF0000",
bordeColor: "#0000FF",
type: 1
};
async function generateWelcomeImage() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
generateWelcomeImage();
Ensure you have axios
installed (e.g., npm install axios
and npm install -D @types/axios
).
import axios, { AxiosError } from 'axios';
const apiKey: string = 'your_api_key_here'; // Replace with your actual API key
const url: string = 'https://nexus.adonis-except.xyz/welcome/welcome-image';
interface WelcomePayload {
background: string;
text1: string;
text2: string;
useravatar: string;
textColor?: string;
bordeColor?: string;
type?: number;
}
interface ApiResponse {
result: string;
// Add other potential response fields if known
}
interface ApiErrorResponse {
error: string;
message?: string;
}
const payload: WelcomePayload = {
background: "https://example.com/background.jpg",
text1: "Welcome",
text2: "to our server",
useravatar: "https://example.com/avatar.png",
textColor: "#FF0000",
bordeColor: "#0000FF",
type: 1
};
async function generateWelcomeImage(): Promise<void> {
try {
const response = await axios.post<ApiResponse>(url, payload, {
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
}
});
console.log('Success:', response.data);
} catch (error) {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError<ApiErrorResponse>;
if (axiosError.response) {
console.error('Error Status:', axiosError.response.status);
console.error('Error Response Data:', axiosError.response.data);
} else if (axiosError.request) {
console.error('Error: No response received. Request details:', axiosError.request);
} else {
console.error('Error setting up request:', axiosError.message);
}
} else {
console.error('An unexpected error occurred:', error);
}
}
}
generateWelcomeImage();
This example uses the browser's built-in fetch
API.
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/welcome/welcome-image';
const payload = {
background: "https://example.com/background.jpg",
text1: "Welcome",
text2: "to our server",
useravatar: "https://example.com/avatar.png",
textColor: "#FF0000",
bordeColor: "#0000FF",
type: 1
};
async function generateWelcomeImage() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
// Example: document.getElementById('resultImage').src = data.result;
} catch (error) {
console.error('Error:', error.message);
}
}
generateWelcomeImage();
curl -X POST 'https://nexus.adonis-except.xyz/welcome/welcome-image' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{
"background": "https://example.com/background.jpg",
"text1": "Welcome",
"text2": "to our server",
"useravatar": "https://example.com/avatar.png",
"textColor": "#FF0000",
"bordeColor": "#0000FF",
"type": 1
}'
Ensure you have requests
installed (e.g., pip install requests
).
import requests
import json
api_key = 'your_api_key_here' # Replace with your actual API key
url = 'https://nexus.adonis-except.xyz/welcome/welcome-image'
payload = {
"background": "https://example.com/background.jpg",
"text1": "Welcome",
"text2": "to our server",
"useravatar": "https://example.com/avatar.png",
"textColor": "#FF0000",
"bordeColor": "#0000FF",
"type": 1
}
headers = {
'Content-Type': 'application/json',
'x-api-key': api_key
}
try:
response = requests.post(url, headers=headers, data=json.dumps(payload))
response.raise_for_status() # Raises an HTTPError for bad responses (4XX or 5XX)
data = response.json()
print(f'Success: {data}')
except requests.exceptions.HTTPError as http_err:
print(f'HTTP error occurred: {http_err}')
print(f'Response content: {response.content.decode()}')
except requests.exceptions.RequestException as req_err:
print(f'Request exception occurred: {req_err}')
except Exception as err:
print(f'Other error occurred: {err}')
Uses the standard net/http
library.
require 'uri'
require 'net/http'
require 'json'
api_key = 'your_api_key_here' # Replace with your actual API key
uri = URI('https://nexus.adonis-except.xyz/welcome/welcome-image')
payload = {
background: "https://example.com/background.jpg",
text1: "Welcome",
text2: "to our server",
useravatar: "https://example.com/avatar.png",
textColor: "#FF0000",
bordeColor: "#0000FF",
type: 1
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true # Assuming HTTPS
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['x-api-key'] = api_key
request.body = payload.to_json
begin
response = http.request(request)
if response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)
puts "Success: #{data}"
else
puts "HTTP error! status: #{response.code} - #{response.body}"
end
rescue StandardError => e
puts "Error: #{e.message}"
end
Uses the standard net/http
and bytes
packages.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
apiKey := "your_api_key_here" // Replace with your actual API key
url := "https://nexus.adonis-except.xyz/welcome/welcome-image"
payload := map[string]interface{}{
"background": "https://example.com/background.jpg",
"text1": "Welcome",
"text2": "to our server",
"useravatar": "https://example.com/avatar.png",
"textColor": "#FF0000",
"bordeColor": "#0000FF",
"type": 1,
}
jsonPayload, err := json.Marshal(payload)
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
if resp.StatusCode >= 200 && resp.StatusCode < 300 {
fmt.Println("Success:", string(body))
} else {
fmt.Printf("HTTP error! status: %d - %s\n", resp.StatusCode, string(body))
}
}
Uses the cURL extension.
<?php
$apiKey = 'your_api_key_here'; // Replace with your actual API key
$url = 'https://nexus.adonis-except.xyz/welcome/welcome-image';
$payload = [
'background' => 'https://example.com/background.jpg',
'text1' => 'Welcome',
'text2' => 'to our server',
'useravatar' => 'https://example.com/avatar.png',
'textColor' => '#FF0000',
'bordeColor' => '#0000FF',
'type' => 1,
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'x-api-key: ' . $apiKey
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode >= 200 && $httpCode < 300) {
echo "Success: " . $response . "\n";
} else {
echo "HTTP error! status: " . $httpCode . " - " . $response . "\n";
}
if (curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch) . "\n";
}
curl_close($ch);
?>
Uses standard java.net.HttpURLConnection
. For production, consider libraries like OkHttp or Apache HttpClient.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONObject; // Add a JSON library like org.json or Gson
public class WelcomeImageGenerator {
public static void main(String[] args) {
String apiKey = "your_api_key_here"; // Replace
String apiUrl = "https://nexus.adonis-except.xyz/welcome/welcome-image";
JSONObject payload = new JSONObject();
payload.put("background", "https://example.com/background.jpg");
payload.put("text1", "Welcome");
payload.put("text2", "to our server");
payload.put("useravatar", "https://example.com/avatar.png");
payload.put("textColor", "#FF0000");
payload.put("bordeColor", "#0000FF");
payload.put("type", 1);
try {
URL url = new URL(apiUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json; utf-8");
conn.setRequestProperty("x-api-key", apiKey);
conn.setDoOutput(true);
try(OutputStream os = conn.getOutputStream()) {
byte[] input = payload.toString().getBytes("utf-8");
os.write(input, 0, input.length);
}
int responseCode = conn.getResponseCode();
StringBuilder response = new StringBuilder();
try(BufferedReader br = new BufferedReader(
new InputStreamReader( (responseCode >= 200 && responseCode < 300) ? conn.getInputStream() : conn.getErrorStream() , "utf-8"))) {
String responseLine = null;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
}
if (responseCode >= 200 && responseCode < 300) {
System.out.println("Success: " + response.toString());
} else {
System.out.println("HTTP error! status: " + responseCode + " - " + response.toString());
}
conn.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Uses HttpClient
from System.Net.Http
.
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
// For JSON serialization, you might need Newtonsoft.Json (Json.NET) or System.Text.Json
// Example using System.Text.Json (built-in for .NET Core 3.0+)
// using System.Text.Json;
public class WelcomeImageGenerator
{
private static readonly HttpClient client = new HttpClient();
public static async Task GenerateImageAsync()
{
var apiKey = "your_api_key_here"; // Replace
var url = "https://nexus.adonis-except.xyz/welcome/welcome-image";
var payload = new
{
background = "https://example.com/background.jpg",
text1 = "Welcome",
text2 = "to our server",
useravatar = "https://example.com/avatar.png",
textColor = "#FF0000",
bordeColor = "#0000FF",
type = 1
};
// Using System.Text.Json for serialization
var jsonPayload = System.Text.Json.JsonSerializer.Serialize(payload);
// Or using Newtonsoft.Json:
// var jsonPayload = Newtonsoft.Json.JsonConvert.SerializeObject(payload);
var request = new HttpRequestMessage(HttpMethod.Post, url)
{
Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json")
};
request.Headers.Add("x-api-key", apiKey);
try
{
HttpResponseMessage response = await client.SendAsync(request);
string responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Success: " + responseBody);
}
else
{
Console.WriteLine($"HTTP error! status: {response.StatusCode} - {responseBody}");
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"Request exception: {e.Message}");
}
}
// public static async Task Main(string[] args) // For console app
// {
// await GenerateImageAsync();
// }
}
Uses URLSession
. This is a simplified example.
import Foundation
// For a command-line tool or within an app context
func generateWelcomeImage() {
let apiKey = "your_api_key_here" // Replace
guard let url = URL(string: "https://nexus.adonis-except.xyz/welcome/welcome-image") else {
print("Invalid URL")
return
}
let payload: [String: Any] = [
"background": "https://example.com/background.jpg",
"text1": "Welcome",
"text2": "to our server",
"useravatar": "https://example.com/avatar.png",
"textColor": "#FF0000",
"bordeColor": "#0000FF",
"type": 1
]
guard let jsonData = try? JSONSerialization.data(withJSONObject: payload) else {
print("Error serializing JSON")
return
}
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue(apiKey, forHTTPHeaderField: "x-api-key")
request.httpBody = jsonData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Client error: \(error.localizedDescription)")
return
}
guard let httpResponse = response as? HTTPURLResponse else {
print("Invalid response from server")
return
}
guard let data = data else {
print("No data received")
return
}
let responseString = String(data: data, encoding: .utf8) ?? "Could not decode response"
if (200...299).contains(httpResponse.statusCode) {
print("Success (\(httpResponse.statusCode)): \(responseString)")
} else {
print("HTTP error! status: \(httpResponse.statusCode) - \(responseString)")
}
}
task.resume()
}
// To run (e.g., in a Playground or main.swift):
// generateWelcomeImage()
// RunLoop.main.run() // Keep alive for async tasks in command line tool
Uses java.net.HttpURLConnection
. For more robust solutions, consider OkHttp or Ktor Client.
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.OutputStreamWriter
import java.net.HttpURLConnection
import java.net.URL
import org.json.JSONObject // Requires org.json library
fun main() {
val apiKey = "your_api_key_here" // Replace
val apiUrl = "https://nexus.adonis-except.xyz/welcome/welcome-image"
val payload = JSONObject()
payload.put("background", "https://example.com/background.jpg")
payload.put("text1", "Welcome")
payload.put("text2", "to our server")
payload.put("useravatar", "https://example.com/avatar.png")
payload.put("textColor", "#FF0000")
payload.put("bordeColor", "#0000FF")
payload.put("type", 1)
try {
val url = URL(apiUrl)
val connection = url.openConnection() as HttpURLConnection
connection.requestMethod = "POST"
connection.setRequestProperty("Content-Type", "application/json; utf-8")
connection.setRequestProperty("Accept", "application/json")
connection.setRequestProperty("x-api-key", apiKey)
connection.doOutput = true
OutputStreamWriter(connection.outputStream).use { writer ->
writer.write(payload.toString())
writer.flush()
}
val responseCode = connection.responseCode
val inputStream = if (responseCode in 200..299) connection.inputStream else connection.errorStream
BufferedReader(InputStreamReader(inputStream)).use { reader ->
val response = reader.readText()
if (responseCode in 200..299) {
println("Success: $response")
} else {
println("HTTP error! status: $responseCode - $response")
}
}
connection.disconnect()
} catch (e: Exception) {
e.printStackTrace()
}
}
Ensure you have the http
package in your pubspec.yaml
(dependencies: http: ^1.0.0
) and run dart pub get
.
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
var apiKey = 'your_api_key_here'; // Replace
var url = Uri.parse('https://nexus.adonis-except.xyz/welcome/welcome-image');
var payload = {
'background': 'https://example.com/background.jpg',
'text1': 'Welcome',
'text2': 'to our server',
'useravatar': 'https://example.com/avatar.png',
'textColor': '#FF0000',
'bordeColor': '#0000FF',
'type': 1,
};
try {
var response = await http.post(
url,
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey,
},
body: jsonEncode(payload),
);
if (response.statusCode >= 200 && response.statusCode < 300) {
print('Success: ${response.body}');
} else {
print('HTTP error! status: ${response.statusCode} - ${response.body}');
}
} catch (e) {
print('Error: $e');
}
}
Uses the reqwest
and serde_json
crates. Add them to your Cargo.toml
: reqwest = { version = "0.11", features = ["json"] }
serde_json = "1.0"
use reqwest::Error;
use serde_json::json; // For creating JSON value
#[tokio::main]
async fn main() -> Result<(), Error> {
let api_key = "your_api_key_here"; // Replace
let url = "https://nexus.adonis-except.xyz/welcome/welcome-image";
let payload = json!({
"background": "https://example.com/background.jpg",
"text1": "Welcome",
"text2": "to our server",
"useravatar": "https://example.com/avatar.png",
"textColor": "#FF0000",
"bordeColor": "#0000FF",
"type": 1
});
let client = reqwest::Client::new();
let response = client.post(url)
.header("Content-Type", "application/json")
.header("x-api-key", api_key)
.json(&payload)
.send()
.await?;
let status = response.status();
let body = response.text().await?;
if status.is_success() {
println!("Success: {}", body);
} else {
eprintln!("HTTP error! status: {} - {}", status, body);
}
Ok(())
}
Expected response (JSON):
{
"result": "/public/generated_image_hash.png"
}
Rank/Level Card Generation
Route: /rank
Method: POST
Content-Type: application/json
Description: Generates a custom rank or level card for users, ideal for displaying progress in platforms or games. Offers multiple card styles via the type
parameter. Requires an API Key sent via header. Returns the path/URL to the generated image.
Required Headers:
x-api-key
: Your API key.
General Parameters (POST - JSON Body):
These parameters are generally accepted, but their exact effect or applicability might vary depending on the chosen card type
(see details below).
background
(string): URL or hex color for the card background (usage varies by type).username
(string): User's name to display.level
(number): User's current level.xp
(number): User's current experience points.requiredXp
(number): Experience points needed for the next level.avatar
(string): URL of the user's profile picture (avatar).status
(string, optional): User's status (e.g., "online", "idle", "dnd", "offline"). Usage varies by type, often defaults to "online".rank
(number, optional): User's position in the ranking. Displayed if provided (required for some types).color
(string, optional): Color for username text (hex format). Default and usage vary by type.border
(string/number, optional): Card/avatar border color (hex) or width (number). Usage and format vary by type.colorBar
(string, optional): Color of the progress bar (hex format). Default and usage vary by type.textcolorBar
(string, optional): Color of text inside the progress bar (hex format). Usage varies by type.tag
(string, optional): User's tag (e.g., discriminator). Usage varies by type.type
(number, optional): Specifies the style of the rank card. Valid values: 1, 2, 3, or 4. Defaults to 1 if not specified or invalid.
Rank Card Types & Specific Parameter Behavior:
The type
parameter determines the card's appearance and how other parameters are used.
Type 1

Working Parameters:
background
: URL or hexadecimal color for the card background.username
: Username displayed on the card.level
: User's current level.xp
: Current experience points.requiredXp
: Experience needed for the next level.avatar
: URL of the user's avatar image.color
: Color for the username text (hexadecimal format, default#FFFFFF
).status
: User status (e.g.,online
,dnd
, etc.), defaultonline
.border
: Card border color (hexadecimal format, default#000000
).colorBar
: Progress bar color (hexadecimal format, default#FFFFFF
).textcolorBar
: Progress bar text color (hexadecimal format, default#000000
).rank
: User rank (optional, displayed if provided).
Non-Working Parameters:
tag
: Not used in this generator type.
Type 2

Working Parameters:
username
: Username displayed on the card.level
: User's current level (displayed as "Level X").avatar
: URL of the user's avatar image.xp
: Current experience points.requiredXp
: Experience needed for the next level (used for progress calculation).status
: User status (e.g.,online
,dnd
, etc.).colorBar
: Progress bar color (used ascolor
in the underlying rankcard library, default#FFFFFF
). This often influences other elements too.rank
: User rank (optional, displayed if provided).
Non-Working Parameters:
background
: Not compatible with this generator type.color
: Not used directly for username text;colorBar
takes priority for the general color scheme.border
: Not used for defining borders in this type.textcolorBar
: Not used for the progress bar text color.tag
: Not used in this generator type.
Type 3

Working Parameters:
background
: URL or hexadecimal color for the background (if URL, used as image; if color, applied to background and optionally "bubbles").username
: Username displayed on the card.level
: User's current level.rank
: User rank (required in this type).avatar
: URL of the user's avatar image.xp
: Current experience points.requiredXp
: Experience needed for the next level.status
: User status (e.g.,online
,dnd
, etc.), defaultonline
.border
: Avatar border color (hexadecimal format, default#0CA7FF
if not specified).colorBar
: Progress bar or "bubbles" color (hexadecimal format, default#0CA7FF
).textcolorBar
: Default color for text (includes current/required XP, default#FFFFFF
).color
: Color for the username text (hexadecimal format, default#0CA7FF
).
Non-Working Parameters:
tag
: Not used in this generator type.
Type 4

Working Parameters:
background
: Hexadecimal color for the background (colors only, no URLs; default#23272A
).username
: Username displayed on the card.tag
: User tag (optional, displayed if provided).level
: User's current level.rank
: User rank (required in this type).avatar
: URL of the user's avatar image.xp
: Current experience points.requiredXp
: Experience needed for the next level.color
: Color for username text and other text elements (hexadecimal format, default#DDA0DD
).border
: Numeric width of the avatar border (in pixels, default8
if not a valid number).colorBar
: Progress bar color (hexadecimal format, default#FF69B4
).
Non-Working Parameters:
status
: Not used in this generator type.textcolorBar
: Not used directly; text color is controlled bycolor
.
Example POST requests (JSON):
Using Type 1 (default):
POST /rank
Content-Type: application/json
x-api-key: your_api_key_here
{
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
}
Explicitly requesting Type 2:
POST /rank
Content-Type: application/json
x-api-key: your_api_key_here
{
"username": "DarknessDev",
"level": 10,
"xp": 1500,
"requiredXp": 2000,
"status": "dnd",
"avatar": "https://example.com/dark_avatar.jpg",
"colorBar": "#FF5733",
"rank": 3,
"type": 2
}
Requesting Type 3 (Rank is required):
POST /rank
Content-Type: application/json
x-api-key: your_api_key_here
{
"background": "#334455",
"username": "BubbleMaster",
"color": "#0CA7FF",
"level": 20,
"xp": 4500,
"requiredXp": 5000,
"status": "idle",
"border": "#FFFF00",
"avatar": "https://example.com/bubble_avatar.png",
"rank": 1,
"colorBar": "#0CA7FF",
"textcolorBar": "#FFFFFF",
"type": 3
}
Requesting Type 4 (Rank is required):
POST /rank
Content-Type: application/json
x-api-key: your_api_key_here
{
"background": "#2C2F33",
"username": "ModernUser",
"tag": "0001",
"color": "#DDA0DD",
"level": 8,
"xp": 1200,
"requiredXp": 1500,
"border": 10,
"avatar": "https://example.com/modern_avatar.png",
"rank": 25,
"colorBar": "#FF69B4",
"type": 4
}
Request Examples:
Ensure you have node-fetch
installed (e.g., npm install node-fetch@2
).
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/rank';
const payload = {
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
// "type": 1 // Optional, defaults to 1
};
async function generateRankCard() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
generateRankCard();
Ensure you have node-fetch
installed (e.g., npm install node-fetch
).
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/rank';
const payload = {
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
// "type": 1 // Optional, defaults to 1
};
async function generateRankCard() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
generateRankCard();
Ensure you have axios
installed (e.g., npm install axios
and npm install -D @types/axios
).
import axios, { AxiosError } from 'axios';
const apiKey: string = 'your_api_key_here'; // Replace with your actual API key
const url: string = 'https://nexus.adonis-except.xyz/rank';
interface RankPayload {
background?: string; // Optional since it might not be used by all types
username: string;
level: number;
xp: number;
requiredXp: number;
avatar: string;
status?: string;
rank?: number;
color?: string;
border?: string | number;
colorBar?: string;
textcolorBar?: string;
tag?: string;
type?: number;
}
interface ApiResponse {
result: string;
// Add other potential response fields if known
}
interface ApiErrorResponse {
error: string;
message?: string;
}
const payload: RankPayload = {
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
// "type": 1 // Optional, defaults to 1
};
async function generateRankCard(): Promise<void> {
try {
const response = await axios.post<ApiResponse>(url, payload, {
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
}
});
console.log('Success:', response.data);
} catch (error) {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError<ApiErrorResponse>;
if (axiosError.response) {
console.error('Error Status:', axiosError.response.status);
console.error('Error Response Data:', axiosError.response.data);
} else if (axiosError.request) {
console.error('Error: No response received. Request details:', axiosError.request);
} else {
console.error('Error setting up request:', axiosError.message);
}
} else {
console.error('An unexpected error occurred:', error);
}
}
}
generateRankCard();
This example uses the browser's built-in fetch
API.
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/rank';
const payload = {
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
};
async function generateRankCard() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
generateRankCard();
curl -X POST 'https://nexus.adonis-except.xyz/rank' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
}'
Ensure you have requests
installed (e.g., pip install requests
).
import requests
import json
api_key = 'your_api_key_here' # Replace with your actual API key
url = 'https://nexus.adonis-except.xyz/rank'
payload = {
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
# "type": 1 # Optional, defaults to 1
}
headers = {
'Content-Type': 'application/json',
'x-api-key': api_key
}
try:
response = requests.post(url, headers=headers, data=json.dumps(payload))
response.raise_for_status()
data = response.json()
print(f'Success: {data}')
except requests.exceptions.HTTPError as http_err:
print(f'HTTP error occurred: {http_err}')
print(f'Response content: {response.content.decode()}')
except requests.exceptions.RequestException as req_err:
print(f'Request exception occurred: {req_err}')
except Exception as err:
print(f'Other error occurred: {err}')
Uses the standard net/http
library.
require 'uri'
require 'net/http'
require 'json'
api_key = 'your_api_key_here' # Replace
uri = URI('https://nexus.adonis-except.xyz/rank')
payload = {
background: "https://example.com/rank_bg.png",
username: "UserExample",
color: "#FFFFFF",
level: 5,
xp: 750,
requiredXp: 1000,
status: "online",
border: "#00FFFF",
avatar: "https://example.com/user_avatar.png",
rank: 15,
colorBar: "#00FF00",
textcolorBar: "#FFFFFF"
# type: 1 # Optional
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['x-api-key'] = api_key
request.body = payload.to_json
begin
response = http.request(request)
if response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)
puts "Success: #{data}"
else
puts "HTTP error! status: #{response.code} - #{response.body}"
end
rescue StandardError => e
puts "Error: #{e.message}"
end
Uses the standard net/http
package.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
apiKey := "your_api_key_here" // Replace
url := "https://nexus.adonis-except.xyz/rank"
payload := map[string]interface{}{
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF",
// "type": 1, // Optional
}
jsonPayload, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
if resp.StatusCode >= 200 && resp.StatusCode < 300 {
fmt.Println("Success:", string(body))
} else {
fmt.Printf("HTTP error! status: %d - %s\n", resp.StatusCode, string(body))
}
}
Uses the cURL extension.
<?php
$apiKey = 'your_api_key_here'; // Replace
$url = 'https://nexus.adonis-except.xyz/rank';
$payload = [
'background' => 'https://example.com/rank_bg.png',
'username' => 'UserExample',
'color' => '#FFFFFF',
'level' => 5,
'xp' => 750,
'requiredXp' => 1000,
'status' => 'online',
'border' => '#00FFFF',
'avatar' => 'https://example.com/user_avatar.png',
'rank' => 15,
'colorBar' => '#00FF00',
'textcolorBar' => '#FFFFFF',
// 'type' => 1 // Optional
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'x-api-key: ' . $apiKey
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode >= 200 && $httpCode < 300) {
echo "Success: " . $response . "\n";
} else {
echo "HTTP error! status: " . $httpCode . " - " . $response . "\n";
}
curl_close($ch);
?>
Uses java.net.HttpURLConnection
. Requires a JSON library (e.g., org.json).
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONObject;
public class RankCardGenerator {
public static void main(String[] args) {
String apiKey = "your_api_key_here"; // Replace
String apiUrl = "https://nexus.adonis-except.xyz/rank";
JSONObject payload = new JSONObject();
payload.put("background", "https://example.com/rank_bg.png");
payload.put("username", "UserExample");
payload.put("color", "#FFFFFF");
payload.put("level", 5);
payload.put("xp", 750);
payload.put("requiredXp", 1000);
payload.put("status", "online");
payload.put("border", "#00FFFF");
payload.put("avatar", "https://example.com/user_avatar.png");
payload.put("rank", 15);
payload.put("colorBar", "#00FF00");
payload.put("textcolorBar", "#FFFFFF");
// payload.put("type", 1); // Optional
try {
URL url = new URL(apiUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json; utf-8");
conn.setRequestProperty("x-api-key", apiKey);
conn.setDoOutput(true);
try(OutputStream os = conn.getOutputStream()) {
os.write(payload.toString().getBytes("utf-8"));
}
int responseCode = conn.getResponseCode();
StringBuilder response = new StringBuilder();
try(BufferedReader br = new BufferedReader(new InputStreamReader(
(responseCode >= 200 && responseCode < 300) ? conn.getInputStream() : conn.getErrorStream(), "utf-8"))) {
String line;
while ((line = br.readLine()) != null) {
response.append(line.trim());
}
}
System.out.println( (responseCode >= 200 && responseCode < 300) ? "Success: " : "HTTP error! status: " + responseCode + " - " + response.toString());
conn.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Uses HttpClient
. Needs JSON serialization (e.g., System.Text.Json or Newtonsoft.Json).
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
// using System.Text.Json; // For .NET Core 3.0+
// using Newtonsoft.Json; // For Json.NET
public class RankCardGenerator
{
private static readonly HttpClient client = new HttpClient();
public static async Task GenerateRankCardAsync()
{
var apiKey = "your_api_key_here"; // Replace
var url = "https://nexus.adonis-except.xyz/rank";
var payload = new {
background = "https://example.com/rank_bg.png",
username = "UserExample",
color = "#FFFFFF",
level = 5,
xp = 750,
requiredXp = 1000,
status = "online",
border = "#00FFFF",
avatar = "https://example.com/user_avatar.png",
rank = 15,
colorBar = "#00FF00",
textcolorBar = "#FFFFFF"
// type = 1 // Optional
};
var jsonPayload = System.Text.Json.JsonSerializer.Serialize(payload);
// var jsonPayload = Newtonsoft.Json.JsonConvert.SerializeObject(payload);
var request = new HttpRequestMessage(HttpMethod.Post, url) {
Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json")
};
request.Headers.Add("x-api-key", apiKey);
try {
HttpResponseMessage response = await client.SendAsync(request);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(response.IsSuccessStatusCode ? $"Success: {responseBody}" : $"HTTP error! status: {response.StatusCode} - {responseBody}");
} catch (HttpRequestException e) {
Console.WriteLine($"Request error: {e.Message}");
}
}
// public static async Task Main(string[] args) => await GenerateRankCardAsync();
}
Uses URLSession
.
import Foundation
func generateRankCard() {
let apiKey = "your_api_key_here" // Replace
guard let url = URL(string: "https://nexus.adonis-except.xyz/rank") else { return }
let payload: [String: Any] = [
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
// "type": 1 // Optional
]
guard let jsonData = try? JSONSerialization.data(withJSONObject: payload) else { return }
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue(apiKey, forHTTPHeaderField: "x-api-key")
request.httpBody = jsonData
URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error { print("Client error: \(error)"); return }
guard let httpResponse = response as? HTTPURLResponse, let data = data else { print("Invalid response"); return }
let responseString = String(data: data, encoding: .utf8) ?? ""
if (200...299).contains(httpResponse.statusCode) {
print("Success (\(httpResponse.statusCode)): \(responseString)")
} else {
print("HTTP error! status: \(httpResponse.statusCode) - \(responseString)")
}
}.resume()
}
// generateRankCard()
// RunLoop.main.run() // Keep alive for CLI
Uses java.net.HttpURLConnection
and org.json.JSONObject
.
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.OutputStreamWriter
import java.net.HttpURLConnection
import java.net.URL
import org.json.JSONObject // Add org.json dependency
fun main() {
val apiKey = "your_api_key_here" // Replace
val apiUrl = "https://nexus.adonis-except.xyz/rank"
val payload = JSONObject().apply {
put("background", "https://example.com/rank_bg.png")
put("username", "UserExample")
put("color", "#FFFFFF")
put("level", 5)
put("xp", 750)
put("requiredXp", 1000)
put("status", "online")
put("border", "#00FFFF")
put("avatar", "https://example.com/user_avatar.png")
put("rank", 15)
put("colorBar", "#00FF00")
put("textcolorBar", "#FFFFFF")
// put("type", 1) // Optional
}
try {
val connection = (URL(apiUrl).openConnection() as HttpURLConnection).apply {
requestMethod = "POST"
setRequestProperty("Content-Type", "application/json; utf-8")
setRequestProperty("x-api-key", apiKey)
doOutput = true
}
OutputStreamWriter(connection.outputStream).use { it.write(payload.toString()); it.flush() }
val stream = if (connection.responseCode in 200..299) connection.inputStream else connection.errorStream
BufferedReader(InputStreamReader(stream)).use {
val response = it.readText()
println(if (connection.responseCode in 200..299) "Success: $response" else "HTTP error! status: ${connection.responseCode} - $response")
}
connection.disconnect()
} catch (e: Exception) { e.printStackTrace() }
}
Uses the http
package (add to pubspec.yaml
).
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
var apiKey = 'your_api_key_here'; // Replace
var url = Uri.parse('https://nexus.adonis-except.xyz/rank');
var payload = {
'background': 'https://example.com/rank_bg.png',
'username': 'UserExample',
'color': '#FFFFFF',
'level': 5,
'xp': 750,
'requiredXp': 1000,
'status': 'online',
'border': '#00FFFF',
'avatar': 'https://example.com/user_avatar.png',
'rank': 15,
'colorBar': '#00FF00',
'textcolorBar': '#FFFFFF',
// 'type': 1, // Optional
};
try {
var response = await http.post(
url,
headers: {'Content-Type': 'application/json', 'x-api-key': apiKey},
body: jsonEncode(payload),
);
if (response.statusCode >= 200 && response.statusCode < 300) {
print('Success: ${response.body}');
} else {
print('HTTP error! status: ${response.statusCode} - ${response.body}');
}
} catch (e) {
print('Error: $e');
}
}
Uses reqwest
and serde_json
(add to Cargo.toml
).
use reqwest::Error;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Error> {
let api_key = "your_api_key_here"; // Replace
let url = "https://nexus.adonis-except.xyz/rank";
let payload = json!({
"background": "https://example.com/rank_bg.png",
"username": "UserExample",
"color": "#FFFFFF",
"level": 5,
"xp": 750,
"requiredXp": 1000,
"status": "online",
"border": "#00FFFF",
"avatar": "https://example.com/user_avatar.png",
"rank": 15,
"colorBar": "#00FF00",
"textcolorBar": "#FFFFFF"
// "type": 1 // Optional
});
let client = reqwest::Client::new();
let response = client.post(url)
.header("Content-Type", "application/json")
.header("x-api-key", api_key)
.json(&payload)
.send().await?;
let status = response.status();
let body = response.text().await?;
if status.is_success() {
println!("Success: {}", body);
} else {
eprintln!("HTTP error! status: {} - {}", status, body);
}
Ok(())
}
Expected response (JSON):
{
"result": "/public/rank_card_hash.png"
}
Error response (JSON):
{
"error": "Error generating the card"
}
Level Up Card Generation
Route: /rank/level-up
Method: POST
Content-Type: application/json
Description: Generates a level-up card showing user level progression. Requires an API Key sent via header. Returns the path/URL to the generated image.
Required Headers:
x-api-key
: Your API key.
Required parameters (POST - JSON Body):
avatar
(string): URL of the user's avatar image.backround
(string): Background color (HEX) or image URL.username
(string): Username to display on the card.levels
(array or object): Previous and new level information (e.g.,[10, 11]
or{"old": 10, "new": 11}
).
Optional parameters (POST - JSON Body):
border
(string): Card border color in HEX format.avatarBorder
(string): Avatar border color in HEX format.opacity
(number): Overlay opacity value (0-1).
Example POST requests (JSON):
POST /rank/level-up
Content-Type: application/json
x-api-key: your_api_key_here
{
"avatar": "https://example.com/imagen-avatar.png",
"backround": "#070d19",
"username": "JuanPerez",
"levels": [10, 11],
"border": "#FF0000",
"avatarBorder": "#00FF00",
"opacity": 0.8
}
POST /rank/level-up
Content-Type: application/json
x-api-key: your_api_key_here
{
"avatar": "https://example.com/imagen-avatar.png",
"backround": "https://example.com/fondo.jpg",
"username": "JuanPerez",
"levels": { "old": 10, "new": 11 },
"border": "#FF0000"
}
Request Examples:
Ensure you have node-fetch
installed (e.g., npm install node-fetch@2
).
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/rank/level-up';
const payload = {
"avatar": "https://example.com/imagen-avatar.png",
"backround": "#070d19", // Note: "backround" seems to be a typo in original API spec, adjust if it's "background"
"username": "JuanPerez",
"levels": [10, 11],
"border": "#FF0000",
"avatarBorder": "#00FF00",
"opacity": 0.8
};
async function generateLevelUpCard() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
generateLevelUpCard();
Ensure you have node-fetch
installed (e.g., npm install node-fetch
).
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/rank/level-up';
const payload = {
"avatar": "https://example.com/imagen-avatar.png",
"backround": "#070d19", // Note: "backround" typo
"username": "JuanPerez",
"levels": [10, 11],
"border": "#FF0000",
"avatarBorder": "#00FF00",
"opacity": 0.8
};
async function generateLevelUpCard() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
generateLevelUpCard();
Ensure you have axios
installed (e.g., npm install axios
and npm install -D @types/axios
).
import axios, { AxiosError } from 'axios';
const apiKey: string = 'your_api_key_here'; // Replace with your actual API key
const url: string = 'https://nexus.adonis-except.xyz/rank/level-up';
interface LevelUpPayload {
avatar: string;
backround: string; // Note: "backround" might be a typo in API spec, usually "background"
username: string;
levels: number[] | { old: number; new: number };
border?: string;
avatarBorder?: string;
opacity?: number;
}
interface ApiResponse {
result: string;
}
interface ApiErrorResponse {
error: string;
message?: string;
}
const payload: LevelUpPayload = {
"avatar": "https://example.com/imagen-avatar.png",
"backround": "#070d19", // Note: "backround" typo
"username": "JuanPerez",
"levels": [10, 11],
"border": "#FF0000",
"avatarBorder": "#00FF00",
"opacity": 0.8
};
async function generateLevelUpCard(): Promise<void> {
try {
const response = await axios.post<ApiResponse>(url, payload, {
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
}
});
console.log('Success:', response.data);
} catch (error) {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError<ApiErrorResponse>;
if (axiosError.response) {
console.error('Error Status:', axiosError.response.status);
console.error('Error Response Data:', axiosError.response.data);
} else if (axiosError.request) {
console.error('Error: No response received. Request details:', axiosError.request);
} else {
console.error('Error setting up request:', axiosError.message);
}
} else {
console.error('An unexpected error occurred:', error);
}
}
}
generateLevelUpCard();
This example uses the browser's built-in fetch
API.
const apiKey = 'your_api_key_here';
const url = 'https://nexus.adonis-except.xyz/rank/level-up';
const payload = {
"avatar": "https://example.com/imagen-avatar.png",
"backround": "#070d19", // Note: "backround" typo
"username": "JuanPerez",
"levels": [10, 11],
"border": "#FF0000",
"avatarBorder": "#00FF00",
"opacity": 0.8
};
async function generateLevelUpCard() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP error ${response.status}`);
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
generateLevelUpCard();
curl -X POST 'https://nexus.adonis-except.xyz/rank/level-up' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{
"avatar": "https://example.com/imagen-avatar.png",
"backround": "#070d19",
"username": "JuanPerez",
"levels": [10, 11],
"border": "#FF0000",
"avatarBorder": "#00FF00",
"opacity": 0.8
}'
Ensure you have requests
installed (e.g., pip install requests
).
import requests
import json
api_key = 'your_api_key_here' # Replace with your actual API key
url = 'https://nexus.adonis-except.xyz/rank/level-up'
payload = {
"avatar": "https://example.com/imagen-avatar.png",
"backround": "#070d19", # Note: "backround" typo
"username": "JuanPerez",
"levels": [10, 11],
"border": "#FF0000",
"avatarBorder": "#00FF00",
"opacity": 0.8
}
headers = {
'Content-Type': 'application/json',
'x-api-key': api_key
}
try:
response = requests.post(url, headers=headers, data=json.dumps(payload))
response.raise_for_status()
data = response.json()
print(f'Success: {data}')
except requests.exceptions.HTTPError as http_err:
print(f'HTTP error occurred: {http_err}')
print(f'Response content: {response.content.decode()}')
except Exception as err:
print(f'Other error occurred: {err}')
Uses the standard net/http
library.
require 'uri'
require 'net/http'
require 'json'
api_key = 'your_api_key_here' # Replace
uri = URI('https://nexus.adonis-except.xyz/rank/level-up')
payload = {
avatar: "https://example.com/imagen-avatar.png",
backround: "#070d19", # Note: "backround" typo
username: "JuanPerez",
levels: [10, 11],
border: "#FF0000",
avatarBorder: "#00FF00",
opacity: 0.8
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['x-api-key'] = api_key
request.body = payload.to_json
begin
response = http.request(request)
data = JSON.parse(response.body)
if response.is_a?(Net::HTTPSuccess)
puts "Success: #{data}"
else
puts "HTTP error! status: #{response.code} - #{data}"
end
rescue StandardError => e
puts "Error: #{e.message}"
end
Uses the standard net/http
package.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
apiKey := "your_api_key_here" // Replace
url := "https://nexus.adonis-except.xyz/rank/level-up"
payload := map[string]interface{}{
"avatar": "https://example.com/imagen-avatar.png",
"backround": "#070d19", // Note: "backround" typo
"username": "JuanPerez",
"levels": []int{10, 11},
"border": "#FF0000",
"avatarBorder": "#00FF00",
"opacity": 0.8,
}
jsonPayload, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil { fmt.Println("Error:", err); return }
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
if resp.StatusCode >= 200 && resp.StatusCode < 300 {
fmt.Println("Success:", string(body))
} else {
fmt.Printf("HTTP error! status: %d - %s\n", resp.StatusCode, string(body))
}
}
Uses the cURL extension.
<?php
$apiKey = 'your_api_key_here'; // Replace
$url = 'https://nexus.adonis-except.xyz/rank/level-up';
$payload = [
'avatar' => 'https://example.com/imagen-avatar.png',
'backround' => '#070d19', // Note: "backround" typo
'username' => 'JuanPerez',
'levels' => [10, 11],
'border' => '#FF0000',
'avatarBorder' => '#00FF00',
'opacity' => 0.8,
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'x-api-key: ' . $apiKey]
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo ($httpCode >= 200 && $httpCode < 300) ? "Success: $response\n" : "HTTP error! status: $httpCode - $response\n";
curl_close($ch);
?>
Uses java.net.HttpURLConnection
and a JSON library (e.g., org.json).
import java.io.*; import java.net.*; import org.json.*;
public class LevelUpCard {
public static void main(String[] args) {
String apiKey = "your_api_key_here"; // Replace
String apiUrl = "https://nexus.adonis-except.xyz/rank/level-up";
JSONObject payload = new JSONObject();
payload.put("avatar", "https://example.com/imagen-avatar.png");
payload.put("backround", "#070d19"); // Note: "backround" typo
payload.put("username", "JuanPerez");
payload.put("levels", new JSONArray(new int[]{10, 11}));
payload.put("border", "#FF0000");
payload.put("avatarBorder", "#00FF00");
payload.put("opacity", 0.8);
try {
HttpURLConnection conn = (HttpURLConnection) new URL(apiUrl).openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json; utf-8");
conn.setRequestProperty("x-api-key", apiKey);
conn.setDoOutput(true);
try(OutputStream os = conn.getOutputStream()) { os.write(payload.toString().getBytes("utf-8")); }
int code = conn.getResponseCode();
try(BufferedReader br = new BufferedReader(new InputStreamReader( (code>=200&&code<300)?conn.getInputStream():conn.getErrorStream() ))) {
System.out.println(((code>=200&&code<300)?"Success: ":"HTTP error! status:"+code+" - ")+br.readLine());
}
conn.disconnect();
} catch (Exception e) { e.printStackTrace(); }
}
}
Uses HttpClient
. Requires JSON serialization.
using System; using System.Net.Http; using System.Text; using System.Threading.Tasks;
// using System.Text.Json; // Or Newtonsoft.Json;
public class LevelUpCard {
private static readonly HttpClient client = new HttpClient();
public static async Task GenerateAsync() {
var apiKey = "your_api_key_here"; // Replace
var url = "https://nexus.adonis-except.xyz/rank/level-up";
var payload = new { avatar = "https://example.com/imagen-avatar.png", backround = "#070d19", /* Note: "backround" typo */ username = "JuanPerez", levels = new[] { 10, 11 }, border = "#FF0000", avatarBorder = "#00FF00", opacity = 0.8 };
var json = System.Text.Json.JsonSerializer.Serialize(payload);
var req = new HttpRequestMessage(HttpMethod.Post, url) { Content = new StringContent(json, Encoding.UTF8, "application/json") };
req.Headers.Add("x-api-key", apiKey);
try {
var res = await client.SendAsync(req);
Console.WriteLine(res.IsSuccessStatusCode ? $"Success: {await res.Content.ReadAsStringAsync()}" : $"HTTP error! status: {res.StatusCode} - {await res.Content.ReadAsStringAsync()}");
} catch (Exception e) { Console.WriteLine($"Error: {e.Message}"); }
}
// public static async Task Main(string[] args) => await GenerateAsync();
}
Uses URLSession
.
import Foundation
func generateLevelUpCard() {
let apiKey = "your_api_key_here" // Replace
guard let url = URL(string: "https://nexus.adonis-except.xyz/rank/level-up") else { return }
let payload: [String: Any] = [ "avatar": "https://example.com/imagen-avatar.png", "backround": "#070d19", /* Note: "backround" typo */ "username": "JuanPerez", "levels": [10, 11], "border": "#FF0000", "avatarBorder": "#00FF00", "opacity": 0.8 ]
guard let jsonData = try? JSONSerialization.data(withJSONObject: payload) else { return }
var request = URLRequest(url: url); request.httpMethod = "POST"
request.allHTTPHeaderFields = ["Content-Type": "application/json", "x-api-key": apiKey]; request.httpBody = jsonData
URLSession.shared.dataTask(with: request) { data, res, err in
if let err = err { print("Error: \(err)"); return }
guard let httpRes = res as? HTTPURLResponse, let data = data, let str = String(data: data, encoding: .utf8) else { return }
print( (200...299).contains(httpRes.statusCode) ? "Success: \(str)" : "HTTP error! status: \(httpRes.statusCode) - \(str)" )
}.resume()
}
// generateLevelUpCard(); RunLoop.main.run()
Uses java.net.HttpURLConnection
and org.json.JSONObject
.
import java.io.*; import java.net.*; import org.json.* // Add org.json dependency
fun main() {
val apiKey = "your_api_key_here" // Replace
val payload = JSONObject().apply {
put("avatar", "https://example.com/imagen-avatar.png"); put("backround", "#070d19") /* Note: "backround" typo */
put("username", "JuanPerez"); put("levels", JSONArray(listOf(10, 11)))
put("border", "#FF0000"); put("avatarBorder", "#00FF00"); put("opacity", 0.8)
}
try {
val conn = (URL("https://nexus.adonis-except.xyz/rank/level-up").openConnection() as HttpURLConnection).apply {
requestMethod = "POST"; setRequestProperty("Content-Type", "application/json; utf-8"); setRequestProperty("x-api-key", apiKey); doOutput = true
}
OutputStreamWriter(conn.outputStream).use { it.write(payload.toString()); it.flush() }
val stream = if (conn.responseCode in 200..299) conn.inputStream else conn.errorStream
BufferedReader(InputStreamReader(stream)).use { println(if (conn.responseCode in 200..299) "Success: ${it.readText()}" else "HTTP error! status: ${conn.responseCode} - ${it.readText()}") }
conn.disconnect()
} catch (e: Exception) { e.printStackTrace() }
}
Uses the http
package.
import 'dart:convert'; import 'package:http/http.dart' as http;
void main() async {
var apiKey = 'your_api_key_here'; // Replace
var url = Uri.parse('https://nexus.adonis-except.xyz/rank/level-up');
var payload = {'avatar': 'https://example.com/imagen-avatar.png', 'backround': '#070d19', /* Note: "backround" typo */ 'username': 'JuanPerez', 'levels': [10, 11], 'border': '#FF0000', 'avatarBorder': '#00FF00', 'opacity': 0.8 };
try {
var res = await http.post(url, headers: {'Content-Type': 'application/json', 'x-api-key': apiKey}, body: jsonEncode(payload));
print( (res.statusCode >= 200 && res.statusCode < 300) ? 'Success: ${res.body}' : 'HTTP error! status: ${res.statusCode} - ${res.body}' );
} catch (e) { print('Error: $e'); }
}
Uses reqwest
and serde_json
.
use reqwest::Error; use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Error> {
let apiKey = "your_api_key_here"; // Replace
let payload = json!({"avatar": "https://example.com/imagen-avatar.png", "backround": "#070d19", /* Note: "backround" typo */ "username": "JuanPerez", "levels": [10, 11], "border": "#FF0000", "avatarBorder": "#00FF00", "opacity": 0.8});
let client = reqwest::Client::new();
let res = client.post("https://nexus.adonis-except.xyz/rank/level-up")
.header("Content-Type", "application/json").header("x-api-key", apiKey)
.json(&payload).send().await?;
let status = res.status(); let body = res.text().await?;
if status.is_success() { println!("Success: {}", body); } else { eprintln!("HTTP error! status: {} - {}", status, body); }
Ok(())
}
Expected response (JSON):
{
"result": "/public/level_up_hash.png"
}
ChatGPT Interaction
Route: /chatgpt
Method: POST
Content-Type: application/json
Description: Sends text to the ChatGPT API and receives a generated response. Requires an API Key sent via header.
Required Headers:
x-api-key
: Your API key.
Required parameters (POST - JSON Body):
text
: The user's input text.userID
: A unique identifier for the user.
Optional parameters (POST - JSON Body):
personality
: Defines the personality of the AI (e.g., "happy", "professor").longitud
(length): Desired approximate length of the response.systemInstruction
: Specific instructions for the AI's behavior or context.model
: The specific model to use. Available models:gpt-3.5-turbo
,gpt-3.5-turbo-0301
,gpt-3.5-turbo-0613
,gpt-3.5-turbo-16k
,gpt-4
,gpt-4-32k
,gpt-4-turbo
,gpt-4.1
,gpt-4.1-mini
,gpt-4.1-nano
,gpt-4o-mini
,o3-mini
. Default:gpt-4o-mini
.
Example POST requests:
POST /chatgpt
Content-Type: application/json
x-api-key: your_api_key_here
{
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation"
}
POST /chatgpt
Content-Type: application/json
x-api-key: your_api_key_here
{
"text": "Explain the theory of relativity",
"userID": "67890",
"personality": "professor",
"longitud": 1000,
"systemInstruction": "advanced physics class",
"model": "gpt-4-turbo"
}
Request Examples:
Ensure you have node-fetch
installed (e.g., npm install node-fetch@2
).
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/chatgpt';
const payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation"
};
async function callChatGPT() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
callChatGPT();
Ensure you have node-fetch
installed (e.g., npm install node-fetch
).
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const url = 'https://nexus.adonis-except.xyz/chatgpt';
const payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation"
};
async function callChatGPT() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`HTTP error! status: ${response.status} - ${errorText}`);
}
const data = await response.json();
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
callChatGPT();
Ensure you have axios
installed (e.g., npm install axios
and npm install -D @types/axios
).
import axios, { AxiosError } from 'axios';
const apiKey: string = 'your_api_key_here'; // Replace with your actual API key
const url: string = 'https://nexus.adonis-except.xyz/chatgpt';
interface ChatGPT_Payload {
text: string;
userID: string;
personality?: string;
longitud?: number;
systemInstruction?: string;
model?: string;
}
interface ApiResponse {
result: string; // Or a more specific type based on actual AI response
}
interface ApiErrorResponse {
error: string;
message?: string;
}
const payload: ChatGPT_Payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation"
};
async function callChatGPT(): Promise<void> {
try {
const response = await axios.post<ApiResponse>(url, payload, {
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
}
});
console.log('Success:', response.data);
} catch (error) {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError<ApiErrorResponse>;
if (axiosError.response) {
console.error('Error Status:', axiosError.response.status);
console.error('Error Response Data:', axiosError.response.data);
} else if (axiosError.request) {
console.error('Error: No response received. Request details:', axiosError.request);
} else {
console.error('Error setting up request:', axiosError.message);
}
} else {
console.error('An unexpected error occurred:', error);
}
}
}
callChatGPT();
This example uses the browser's built-in fetch
API.
const apiKey = 'your_api_key_here';
const url = 'https://nexus.adonis-except.xyz/chatgpt';
const payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation"
};
async function callChatGPT() {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(payload)
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP error ${response.status}`);
console.log('Success:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
callChatGPT();
curl -X POST 'https://nexus.adonis-except.xyz/chatgpt' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation"
}'
Ensure you have requests
installed (e.g., pip install requests
).
import requests
import json
api_key = 'your_api_key_here' # Replace with your actual API key
url = 'https://nexus.adonis-except.xyz/chatgpt'
payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation"
}
headers = {
'Content-Type': 'application/json',
'x-api-key': api_key
}
try:
response = requests.post(url, headers=headers, data=json.dumps(payload))
response.raise_for_status()
data = response.json()
print(f'Success: {data}')
except requests.exceptions.HTTPError as http_err:
print(f'HTTP error occurred: {http_err} - {response.text}')
except Exception as err:
print(f'Other error occurred: {err}')
Uses the standard net/http
library.
require 'uri'
require 'net/http'
require 'json'
api_key = 'your_api_key_here' # Replace
uri = URI('https://nexus.adonis-except.xyz/chatgpt')
payload = {
text: "Hello, how are you?",
userID: "12345",
personality: "happy",
longitud: 500,
systemInstruction: "casual conversation"
}
http = Net::HTTP.new(uri.host, uri.port); http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'; request['x-api-key'] = api_key
request.body = payload.to_json
begin
response = http.request(request)
data = JSON.parse(response.body)
if response.is_a?(Net::HTTPSuccess) then puts "Success: #{data}"
else puts "HTTP error! status: #{response.code} - #{data}" end
rescue StandardError => e then puts "Error: #{e.message}" end
Uses the standard net/http
package.
package main
import ("bytes"; "encoding/json"; "fmt"; "io/ioutil"; "net/http")
func main() {
apiKey := "your_api_key_here" // Replace
urlPath := "https://nexus.adonis-except.xyz/chatgpt"
payload := map[string]interface{}{
"text": "Hello, how are you?", "userID": "12345", "personality": "happy",
"longitud": 500, "systemInstruction": "casual conversation",
}
jsonPayload, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", urlPath, bytes.NewBuffer(jsonPayload))
req.Header.Set("Content-Type", "application/json"); req.Header.Set("x-api-key", apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil { fmt.Println("Error:", err); return }
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
if resp.StatusCode >= 200 && resp.StatusCode < 300 { fmt.Println("Success:", string(body))
} else { fmt.Printf("HTTP error! status: %d - %s\n", resp.StatusCode, string(body)) }
}
Uses the cURL extension.
<?php
$apiKey = 'your_api_key_here'; // Replace
$url = 'https://nexus.adonis-except.xyz/chatgpt';
$payload = [ "text" => "Hello, how are you?", "userID" => "12345", "personality" => "happy", "longitud" => 500, "systemInstruction" => "casual conversation" ];
$ch = curl_init($url);
curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'x-api-key: ' . $apiKey] ]);
$response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo ($httpCode >= 200 && $httpCode < 300) ? "Success: $response\n" : "HTTP error! status: $httpCode - $response\n";
curl_close($ch);
?>
Uses java.net.HttpURLConnection
and a JSON library (e.g., org.json).
import java.io.*; import java.net.*; import org.json.*;
public class ChatGPTClient {
public static void main(String[] args) {
String apiKey = "your_api_key_here"; // Replace
JSONObject payload = new JSONObject();
payload.put("text", "Hello, how are you?"); payload.put("userID", "12345");
payload.put("personality", "happy"); payload.put("longitud", 500);
payload.put("systemInstruction", "casual conversation");
try {
HttpURLConnection c = (HttpURLConnection) new URL("https://nexus.adonis-except.xyz/chatgpt").openConnection();
c.setRequestMethod("POST"); c.setRequestProperty("Content-Type", "application/json; utf-8");
c.setRequestProperty("x-api-key", apiKey); c.setDoOutput(true);
try(OutputStream o = c.getOutputStream()){ o.write(payload.toString().getBytes("utf-8")); }
int code = c.getResponseCode();
try(BufferedReader br = new BufferedReader(new InputStreamReader((code>=200&&code<300)?c.getInputStream():c.getErrorStream()))){
System.out.println(((code>=200&&code<300)?"Success: ":"HTTP error! "+code+" - ")+br.readLine());
} c.disconnect();
} catch (Exception e) { e.printStackTrace(); }
}
}
Uses HttpClient
. Requires JSON serialization.
using System; using System.Net.Http; using System.Text; using System.Threading.Tasks;
// using System.Text.Json; // Or Newtonsoft.Json;
public class ChatGPTClient {
private static readonly HttpClient cl = new HttpClient();
public static async Task CallAsync() {
var apiKey = "your_api_key_here"; // Replace
var payload = new { text="Hello", userID="12345", personality="happy", longitud=500, systemInstruction="casual"};
var json = System.Text.Json.JsonSerializer.Serialize(payload);
var req = new HttpRequestMessage(HttpMethod.Post, "https://nexus.adonis-except.xyz/chatgpt") { Content = new StringContent(json, Encoding.UTF8, "application/json") };
req.Headers.Add("x-api-key", apiKey);
try {
var res = await cl.SendAsync(req);
Console.WriteLine(res.IsSuccessStatusCode ? $"Success: {await res.Content.ReadAsStringAsync()}" : $"HTTP error! {res.StatusCode} - {await res.Content.ReadAsStringAsync()}");
} catch (Exception e) { Console.WriteLine($"Error: {e.Message}"); }
}
// public static async Task Main(string[] args) => await CallAsync();
}
Uses URLSession
.
import Foundation
func callChatGPT() {
let apiKey = "your_api_key_here" // Replace
guard let url = URL(string: "https://nexus.adonis-except.xyz/chatgpt") else { return }
let payload: [String: Any] = ["text":"Hello", "userID":"12345", "personality":"happy", "longitud":500, "systemInstruction":"casual"]
guard let jsonData = try? JSONSerialization.data(withJSONObject: payload) else { return }
var req = URLRequest(url: url); req.httpMethod = "POST"
req.allHTTPHeaderFields = ["Content-Type":"application/json", "x-api-key":apiKey]; req.httpBody = jsonData
URLSession.shared.dataTask(with: req) { data, res, err in
if let err = err { print("Error: \(err)"); return }
guard let httpRes=res as? HTTPURLResponse, let data=data, let str=String(data:data, encoding:.utf8) else { return }
print( (200...299).contains(httpRes.statusCode) ? "Success: \(str)" : "HTTP error! \(httpRes.statusCode) - \(str)" )
}.resume()
}
// callChatGPT(); RunLoop.main.run()
Uses java.net.HttpURLConnection
and org.json.JSONObject
.
import java.io.*; import java.net.*; import org.json.* // Add org.json dependency
fun main() {
val apiKey = "your_api_key_here" // Replace
val payload = JSONObject().apply {
put("text", "Hello"); put("userID", "12345"); put("personality", "happy")
put("longitud", 500); put("systemInstruction", "casual conversation")
}
try {
val c = (URL("https://nexus.adonis-except.xyz/chatgpt").openConnection() as HttpURLConnection).apply {
requestMethod = "POST"; setRequestProperty("Content-Type", "application/json; utf-8")
setRequestProperty("x-api-key", apiKey); doOutput = true
}
OutputStreamWriter(c.outputStream).use{it.write(payload.toString()); it.flush()}
val stream = if (c.responseCode in 200..299) c.inputStream else c.errorStream
BufferedReader(InputStreamReader(stream)).use{println(if(c.responseCode in 200..299) "Success: ${it.readText()}" else "HTTP error! ${c.responseCode} - ${it.readText()}")}
c.disconnect()
} catch (e: Exception) { e.printStackTrace() }
}
Uses the http
package.
import 'dart:convert'; import 'package:http/http.dart' as http;
void main() async {
var apiKey = 'your_api_key_here'; // Replace
var url = Uri.parse('https://nexus.adonis-except.xyz/chatgpt');
var payload = {"text":"Hello", "userID":"12345", "personality":"happy", "longitud":500, "systemInstruction":"casual"};
try {
var res = await http.post(url, headers:{'Content-Type':'application/json','x-api-key':apiKey}, body:jsonEncode(payload));
print( (res.statusCode >= 200 && res.statusCode < 300) ? 'Success: ${res.body}' : 'HTTP error! ${res.statusCode} - ${res.body}' );
} catch (e) { print('Error: $e'); }
}
Uses reqwest
and serde_json
.
use reqwest::Error; use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Error> {
let apiKey = "your_api_key_here"; // Replace
let payload = json!({"text":"Hello", "userID":"12345", "personality":"happy", "longitud":500, "systemInstruction":"casual"});
let client = reqwest::Client::new();
let res = client.post("https://nexus.adonis-except.xyz/chatgpt")
.header("Content-Type", "application/json").header("x-api-key", apiKey)
.json(&payload).send().await?;
let s = res.status(); let b = res.text().await?;
if s.is_success() { println!("Success: {}", b); } else { eprintln!("HTTP error! {}: {}", s, b); }
Ok(())
}
Expected response (JSON):
{
"result": "Respuesta de la IA"
}
Gemini Interaction
Route: /gemini
Method: POST
Content-Type: application/json
Description: Sends text to the Gemini API and receives a generated response. Can also analyze images and videos if provided. Requires an API Key sent via header.
Required Headers:
x-api-key
: Your API key.
Required parameters (POST - JSON Body):
text
: The user's input text.userID
: A unique identifier for the user.
Optional parameters (POST - JSON Body):
personality
: Defines the personality of the AI.longitud
(length): Desired approximate length of the response.systemInstruction
: Specific instructions for the AI's behavior.model
: The specific Gemini model to use (e.g., "gemini-1.5-flash", "gemini-pro").image
(string or array of strings): URL(s) of image(s) (e.g., .PNG, .JPG, .GIF) or video(s) (e.g., .MP4) to send to the AI for analysis. Send a single URL as a string, or multiple URLs as an array of strings.
Example POST requests:
POST /gemini
Content-Type: application/json
x-api-key: your_api_key_here
{
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation",
"model": "gemini-1.5-flash"
}
POST /gemini
Content-Type: application/json
x-api-key: your_api_key_here
{
"text": "Describe the objects in these images.",
"userID": "13579",
"image": [
"https://example.com/image1.png",
"https://example.com/image2.gif",
"https://example.com/video.mp4"
]
}
Request Examples:
Ensure you have node-fetch
installed (e.g., npm install node-fetch@2
).
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here'; // Replace
const url = 'https://nexus.adonis-except.xyz/gemini';
const payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation",
"model": "gemini-1.5-flash"
};
async function callGemini() {
try {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
body: JSON.stringify(payload)
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP error ${response.status}`);
console.log('Success:', data);
} catch (error) { console.error('Error:', error.message); }
}
callGemini();
Ensure you have node-fetch
installed (e.g., npm install node-fetch
).
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here'; // Replace
const url = 'https://nexus.adonis-except.xyz/gemini';
const payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation",
"model": "gemini-1.5-flash"
};
async function callGemini() {
try {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
body: JSON.stringify(payload)
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP error ${response.status}`);
console.log('Success:', data);
} catch (error) { console.error('Error:', error.message); }
}
callGemini();
Ensure you have axios
installed.
import axios, { AxiosError } from 'axios';
const apiKey: string = 'your_api_key_here'; // Replace
const url: string = 'https://nexus.adonis-except.xyz/gemini';
interface GeminiPayload {
text: string;
userID: string;
personality?: string;
longitud?: number;
systemInstruction?: string;
model?: string;
image?: string | string[];
}
interface ApiResponse { result: string; }
interface ApiErrorResponse { error: string; message?: string; }
const payload: GeminiPayload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation",
"model": "gemini-1.5-flash"
};
async function callGemini(): Promise<void> {
try {
const response = await axios.post<ApiResponse>(url, payload, {
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey }
});
console.log('Success:', response.data);
} catch (error) {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError<ApiErrorResponse>;
if (axiosError.response) console.error('Error Data:', axiosError.response.data);
else console.error('Error:', axiosError.message);
} else { console.error('Unexpected error:', error); }
}
}
callGemini();
Uses browser's fetch
API.
const apiKey = 'your_api_key_here'; // Replace
const url = 'https://nexus.adonis-except.xyz/gemini';
const payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation",
"model": "gemini-1.5-flash"
};
async function callGemini() {
try {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
body: JSON.stringify(payload)
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP error ${response.status}`);
console.log('Success:', data);
} catch (error) { console.error('Error:', error.message); }
}
callGemini();
curl -X POST 'https://nexus.adonis-except.xyz/gemini' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation",
"model": "gemini-1.5-flash"
}'
Uses requests
library.
import requests
import json
api_key = 'your_api_key_here' # Replace
url = 'https://nexus.adonis-except.xyz/gemini'
payload = {
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"systemInstruction": "casual conversation",
"model": "gemini-1.5-flash"
}
headers = {'Content-Type': 'application/json', 'x-api-key': api_key}
try:
response = requests.post(url, headers=headers, data=json.dumps(payload))
response.raise_for_status()
print(f'Success: {response.json()}')
except requests.exceptions.HTTPError as e:
print(f'HTTP error: {e} - {response.text}')
except Exception as e:
print(f'Error: {e}')
Uses standard net/http
.
require 'uri'; require 'net/http'; require 'json'
api_key = 'your_api_key_here'; uri = URI('https://nexus.adonis-except.xyz/gemini')
payload = {text:"Hello", userID:"12345", model:"gemini-1.5-flash"}
http=Net::HTTP.new(uri.host,uri.port); http.use_ssl=true
req=Net::HTTP::Post.new(uri.request_uri)
req['Content-Type']='application/json'; req['x-api-key']=api_key; req.body=payload.to_json
begin
res=http.request(req); data=JSON.parse(res.body)
puts res.is_a?(Net::HTTPSuccess) ? "Success: #{data}" : "HTTP error! #{res.code} - #{data}"
rescue => e; puts "Error: #{e.message}" end
Uses standard net/http
.
package main; import ("bytes";"encoding/json";"fmt";"io/ioutil";"net/http")
func main(){
apiKey:="your_api_key_here"; url:="https://nexus.adonis-except.xyz/gemini"
p:=map[string]interface{}{"text":"Hello","userID":"12345","model":"gemini-1.5-flash"}
jp,_:=json.Marshal(p); req,_:=http.NewRequest("POST",url,bytes.NewBuffer(jp))
req.Header.Set("Content-Type","application/json");req.Header.Set("x-api-key",apiKey)
res,e:=(&http.Client{}).Do(req); if e!=nil{fmt.Println("Err:",e);return}; defer res.Body.Close()
b,_:=ioutil.ReadAll(res.Body)
if res.StatusCode>=200&&res.StatusCode<300{fmt.Println("OK:",string(b))}else{fmt.Printf("Err %d: %s\n",res.StatusCode,string(b))}
}
Uses cURL extension.
<?php
$apiKey='your_api_key_here';$url='https://nexus.adonis-except.xyz/gemini';
$p=['text'=>'Hello','userID'=>'12345','model'=>'gemini-1.5-flash'];
$ch=curl_init($url); curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_POST=>true,CURLOPT_POSTFIELDS=>json_encode($p),CURLOPT_HTTPHEADER=>['Content-Type:application/json','x-api-key:'.$apiKey]]);
$res=curl_exec($ch);$code=curl_getinfo($ch,CURLINFO_HTTP_CODE);
echo($code>=200&&$code<300)?"OK:$res\n":"Err $code:$res\n"; curl_close($ch);
?>
Uses HttpURLConnection
and org.json.
import java.io.*;import java.net.*;import org.json.*;
public class Gemini{public static void main(String[]a){
String k="your_api_key_here";JSONObject p=new JSONObject();
p.put("text","Hello");p.put("userID","12345");p.put("model","gemini-1.5-flash");
try{HttpURLConnection c=(HttpURLConnection)new URL("https://nexus.adonis-except.xyz/gemini").openConnection();
c.setRequestMethod("POST");c.setRequestProperty("Content-Type","application/json;utf-8");
c.setRequestProperty("x-api-key",k);c.setDoOutput(true);
try(OutputStream o=c.getOutputStream()){o.write(p.toString().getBytes("utf-8"));}
int co=c.getResponseCode();
try(BufferedReader r=new BufferedReader(new InputStreamReader((co>=200&&co<300)?c.getInputStream():c.getErrorStream()))){
System.out.println(((co>=200&&co<300)?"OK: ":"Err "+co+": ")+r.readLine());}c.disconnect();
}catch(Exception e){e.printStackTrace();}}}
Uses HttpClient
and System.Text.Json.
using System;using System.Net.Http;using System.Text;using System.Text.Json;using System.Threading.Tasks;
public class Gemini{static readonly HttpClient cl=new HttpClient();
public static async Task Call(){var k="your_api_key_here";var p=new{text="Hello",userID="12345",model="gemini-1.5-flash"};
var j=JsonSerializer.Serialize(p);var r=new HttpRequestMessage(HttpMethod.Post,"https://nexus.adonis-except.xyz/gemini"){Content=new StringContent(j,Encoding.UTF8,"application/json")};
r.Headers.Add("x-api-key",k);try{var R=await cl.SendAsync(r);var S=await R.Content.ReadAsStringAsync();
Console.WriteLine(R.IsSuccessStatusCode?$"OK:{S}":$"Err {R.StatusCode}:{S}");}catch(Exception e){Console.WriteLine($"Ex:{e.Message}");}}}
// public static async Task Main(string[] args) => await Call();
Uses URLSession
.
import Foundation
func callGemini(){let k="your_api_key_here";guard let u=URL(string:"https://nexus.adonis-except.xyz/gemini")else{return}
let p:[String:Any]=["text":"Hello","userID":"12345","model":"gemini-1.5-flash"]
guard let d=try?JSONSerialization.data(withJSONObject:p)else{return};var r=URLRequest(url:u);r.httpMethod="POST"
r.allHTTPHeaderFields=["Content-Type":"application/json","x-api-key":k];r.httpBody=d
URLSession.shared.dataTask(with:r){dt,rs,er in if let er=er{print("Err:\(er)");return}
guard let hr=rs as?HTTPURLResponse,let dt=dt,let s=String(data:dt,encoding:.utf8)else{return}
print((200...299).contains(hr.statusCode)?"OK:\(s)":"Err \(hr.statusCode):\(s)")}.resume()}
// callGemini(); RunLoop.main.run()
Uses HttpURLConnection
and org.json.
import java.io.*;import java.net.*;import org.json.*
fun main(){val k="your_api_key_here";val p=JSONObject().apply{put("text","Hello");put("userID","12345");put("model","gemini-1.5-flash")}
try{val c=(URL("https://nexus.adonis-except.xyz/gemini").openConnection()as HttpURLConnection).apply{requestMethod="POST";setRequestProperty("Content-Type","application/json;utf-8");setRequestProperty("x-api-key",k);doOutput=true}
OutputStreamWriter(c.outputStream).use{it.write(p.toString());it.flush()}
val s=if(c.responseCode in 200..299)c.inputStream else c.errorStream
BufferedReader(InputStreamReader(s)).use{println(if(c.responseCode in 200..299)"OK:${it.readText()}" else "Err ${c.responseCode}:${it.readText()}")}
c.disconnect()}catch(e:Exception){e.printStackTrace()}}
Uses http
package.
import 'dart:convert';import 'package:http/http.dart'as http;
void main()async{var k='your_api_key_here';var u=Uri.parse('https://nexus.adonis-except.xyz/gemini');
var p={'text':'Hello','userID':'12345','model':'gemini-1.5-flash'};
try{var r=await http.post(u,headers:{'Content-Type':'application/json','x-api-key':k},body:jsonEncode(p));
print((r.statusCode>=200&&r.statusCode<300)?'OK:${r.body}':'Err ${r.statusCode}:${r.body}');}catch(e){print('Ex:$e');}}
Uses reqwest
and serde_json
.
use reqwest::Error;use serde_json::json;
#[tokio::main]async fn main()->Result<(),Error>{let k="your_api_key_here";
let p=json!({"text":"Hello","userID":"12345","model":"gemini-1.5-flash"});
let c=reqwest::Client::new();let r=c.post("https://nexus.adonis-except.xyz/gemini")
.header("Content-Type","application/json").header("x-api-key",k).json(&p).send().await?;
let s=r.status();let b=r.text().await?;if s.is_success(){println!("OK:{}",b)}else{eprintln!("Err {}:{}",s,b)}Ok(())}
Expected response (JSON):
{
"result": "Respuesta de la IA"
}
DeepSeek Interaction
Route: /deep-ai
Method: POST
Content-Type: application/json
Description: Sends text to the DeepSeek API and receives a generated response. Requires an API Key sent via header.
Required Headers:
x-api-key
: Your API key.
Required parameters (POST - JSON Body):
text
: The user's input text.userID
: A unique identifier for the user.
Optional parameters (POST - JSON Body):
personality
: Defines the personality of the AI.longitud
(length): Desired approximate length of the response.context
: Specific context or instructions for the AI (replaces systemInstruction).
Example POST requests:
POST /deep-ai
Content-Type: application/json
x-api-key: your_api_key_here
{
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"context": "casual conversation"
}
Request Examples:
Ensure you have node-fetch
installed.
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here';
const url = 'https://nexus.adonis-except.xyz/deep-ai';
const payload = {"text":"Hello", "userID":"12345", "context":"casual"};
async function callDeepAI() {
try {
const res = await fetch(url, {method:'POST', headers:{'Content-Type':'application/json','x-api-key':apiKey}, body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
callDeepAI();
Ensure you have node-fetch
installed.
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here';
const url = 'https://nexus.adonis-except.xyz/deep-ai';
const payload = {"text":"Hello", "userID":"12345", "context":"casual"};
async function callDeepAI() {
try {
const res = await fetch(url, {method:'POST', headers:{'Content-Type':'application/json','x-api-key':apiKey}, body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
callDeepAI();
Ensure you have axios
installed.
import axios,{AxiosError} from 'axios';
const apiKey:string='your_api_key_here'; const url:string='https://nexus.adonis-except.xyz/deep-ai';
interface Payload{text:string;userID:string;personality?:string;longitud?:number;context?:string;}
interface APIRes{result:string;} interface APIErr{error:string;message?:string;}
const payload:Payload={"text":"Hello","userID":"12345","context":"casual"};
async function callDeepAI():Promise<void>{try{const res=await axios.post<APIRes>(url,payload,{headers:{'Content-Type':'application/json','x-api-key':apiKey}});
console.log('Success:',res.data);}catch(e){if(axios.isAxiosError(e)){const ae=e as AxiosError<APIErr>;
if(ae.response)console.error('ErrData:',ae.response.data);else console.error('Err:',ae.message);}else console.error('UnxErr:',e);}}
callDeepAI();
Uses browser's fetch
API.
const apiKey = 'your_api_key_here';
const url = 'https://nexus.adonis-except.xyz/deep-ai';
const payload = {"text":"Hello", "userID":"12345", "context":"casual"};
async function callDeepAI() {
try {
const res = await fetch(url, {method:'POST', headers:{'Content-Type':'application/json','x-api-key':apiKey}, body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
callDeepAI();
curl -X POST 'https://nexus.adonis-except.xyz/deep-ai' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{"text":"Hello","userID":"12345","context":"casual"}'
Uses requests
library.
import requests,json
apiKey='your_api_key_here';url='https://nexus.adonis-except.xyz/deep-ai'
payload={"text":"Hello","userID":"12345","context":"casual"}
headers={'Content-Type':'application/json','x-api-key':apiKey}
try:
res=requests.post(url,headers=headers,data=json.dumps(payload))
res.raise_for_status(); print(f'Success:{res.json()}')
except requests.exceptions.HTTPError as e: print(f'HTTPErr:{e}-{res.text}')
except Exception as e: print(f'Err:{e}')
Uses standard net/http
.
require 'uri';require 'net/http';require 'json'
k='your_api_key_here';u=URI('https://nexus.adonis-except.xyz/deep-ai')
p={text:"Hello",userID:"12345",context:"casual"}
h=Net::HTTP.new(u.host,u.port);h.use_ssl=true;r=Net::HTTP::Post.new(u.request_uri)
r['Content-Type']='application/json';r['x-api-key']=k;r.body=p.to_json
begin;res=h.request(r);d=JSON.parse(res.body)
puts res.is_a?(Net::HTTPSuccess)?"OK:#{d}":"Err #{res.code}:#{d}"
rescue => e;puts "Ex:#{e.message}" end
Uses standard net/http
.
package main;import("bytes";"encoding/json";"fmt";"io/ioutil";"net/http")
func main(){k:="your_api_key_here";url:="https://nexus.adonis-except.xyz/deep-ai"
p:=map[string]interface{}{"text":"Hello","userID":"12345","context":"casual"}
jp,_:=json.Marshal(p);req,_:=http.NewRequest("POST",url,bytes.NewBuffer(jp))
req.Header.Set("Content-Type","application/json");req.Header.Set("x-api-key",k)
res,e:=(&http.Client{}).Do(req);if e!=nil{fmt.Println("Ex:",e);return};defer res.Body.Close()
b,_:=ioutil.ReadAll(res.Body);if res.StatusCode>=200&&res.StatusCode<300{fmt.Println("OK:",string(b))}else{fmt.Printf("Err %d:%s\n",res.StatusCode,string(b))}}
Uses cURL extension.
<?php $k='your_api_key_here';$u='https://nexus.adonis-except.xyz/deep-ai';
$p=['text'=>'Hello','userID'=>'12345','context'=>'casual'];
$ch=curl_init($u);curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_POST=>true,CURLOPT_POSTFIELDS=>json_encode($p),CURLOPT_HTTPHEADER=>['Content-Type:application/json','x-api-key:'.$k]]);
$res=curl_exec($ch);$c=curl_getinfo($ch,CURLINFO_HTTP_CODE);
echo($c>=200&&$c<300)?"OK:$res\n":"Err $c:$res\n";curl_close($ch);?>
Uses HttpURLConnection
and org.json.
import java.io.*;import java.net.*;import org.json.*;
public class DeepAI{public static void main(String[]a){String k="your_api_key_here";
JSONObject p=new JSONObject();p.put("text","Hello");p.put("userID","12345");p.put("context","casual");
try{HttpURLConnection c=(HttpURLConnection)new URL("https://nexus.adonis-except.xyz/deep-ai").openConnection();
c.setRequestMethod("POST");c.setRequestProperty("Content-Type","application/json;utf-8");
c.setRequestProperty("x-api-key",k);c.setDoOutput(true);
try(OutputStream o=c.getOutputStream()){o.write(p.toString().getBytes("utf-8"));}int co=c.getResponseCode();
try(BufferedReader r=new BufferedReader(new InputStreamReader((co>=200&&co<300)?c.getInputStream():c.getErrorStream()))){
System.out.println(((co>=200&&co<300)?"OK:":"Err "+co+":")+r.readLine());}c.disconnect();}catch(Exception e){e.printStackTrace();}}}
Uses HttpClient
and System.Text.Json.
using System;using System.Net.Http;using System.Text;using System.Text.Json;using System.Threading.Tasks;
public class DeepAI{static readonly HttpClient cl=new HttpClient();public static async Task Call(){
var k="your_api_key_here";var p=new{text="Hello",userID="12345",context="casual"};var j=JsonSerializer.Serialize(p);
var r=new HttpRequestMessage(HttpMethod.Post,"https://nexus.adonis-except.xyz/deep-ai"){Content=new StringContent(j,Encoding.UTF8,"application/json")};
r.Headers.Add("x-api-key",k);try{var R=await cl.SendAsync(r);var S=await R.Content.ReadAsStringAsync();
Console.WriteLine(R.IsSuccessStatusCode?$"OK:{S}":$"Err {R.StatusCode}:{S}");}catch(Exception e){Console.WriteLine($"Ex:{e.Message}");}}}
// public static async Task Main(string[] args) => await Call();
Uses URLSession
.
import Foundation
func callDeepAI(){let k="your_api_key_here";guard let u=URL(string:"https://nexus.adonis-except.xyz/deep-ai")else{return}
let p:[String:Any]=["text":"Hello","userID":"12345","context":"casual"]
guard let d=try?JSONSerialization.data(withJSONObject:p)else{return};var r=URLRequest(url:u);r.httpMethod="POST"
r.allHTTPHeaderFields=["Content-Type":"application/json","x-api-key":k];r.httpBody=d
URLSession.shared.dataTask(with:r){dt,rs,er in if let er=er{print("Err:\(er)");return}
guard let hr=rs as?HTTPURLResponse,let dt=dt,let s=String(data:dt,encoding:.utf8)else{return}
print((200...299).contains(hr.statusCode)?"OK:\(s)":"Err \(hr.statusCode):\(s)")}.resume()}
// callDeepAI(); RunLoop.main.run()
Uses HttpURLConnection
and org.json.
import java.io.*;import java.net.*;import org.json.*
fun main(){val k="your_api_key_here";val p=JSONObject().apply{put("text","Hello");put("userID","12345");put("context","casual")}
try{val c=(URL("https://nexus.adonis-except.xyz/deep-ai").openConnection()as HttpURLConnection).apply{requestMethod="POST";setRequestProperty("Content-Type","application/json;utf-8");setRequestProperty("x-api-key",k);doOutput=true}
OutputStreamWriter(c.outputStream).use{it.write(p.toString());it.flush()}
val s=if(c.responseCode in 200..299)c.inputStream else c.errorStream
BufferedReader(InputStreamReader(s)).use{println(if(c.responseCode in 200..299)"OK:${it.readText()}" else "Err ${c.responseCode}:${it.readText()}")}
c.disconnect()}catch(e:Exception){e.printStackTrace()}}
Uses http
package.
import 'dart:convert';import 'package:http/http.dart'as http;
void main()async{var k='your_api_key_here';var u=Uri.parse('https://nexus.adonis-except.xyz/deep-ai');
var p={'text':'Hello','userID':'12345','context':'casual'};
try{var r=await http.post(u,headers:{'Content-Type':'application/json','x-api-key':k},body:jsonEncode(p));
print((r.statusCode>=200&&r.statusCode<300)?'OK:${r.body}':'Err ${r.statusCode}:${r.body}');}catch(e){print('Ex:$e');}}
Uses reqwest
and serde_json
.
use reqwest::Error;use serde_json::json;
#[tokio::main]async fn main()->Result<(),Error>{let k="your_api_key_here";
let p=json!({"text":"Hello","userID":"12345","context":"casual"});
let c=reqwest::Client::new();let r=c.post("https://nexus.adonis-except.xyz/deep-ai")
.header("Content-Type","application/json").header("x-api-key",k).json(&p).send().await?;
let s=r.status();let b=r.text().await?;if s.is_success(){println!("OK:{}",b)}else{eprintln!("Err {}:{}",s,b)}Ok(())}
Expected response (JSON):
{
"result": "Respuesta de la IA"
}
Meta AI Interaction
Route: /meta-ai
Method: POST
Content-Type: application/json
Description: Sends text to the Meta AI API and receives a generated response. Requires an API Key sent via header.
Required Headers:
x-api-key
: Your API key.
Required parameters (POST - JSON Body):
text
: The user's input text.userID
: A unique identifier for the user.
Optional parameters (POST - JSON Body):
personality
: Defines the personality of the AI.longitud
(length): Desired approximate length of the response.context
: Specific context or instructions for the AI (replaces systemInstruction).
Example POST requests:
POST /meta-ai
Content-Type: application/json
x-api-key: your_api_key_here
{
"text": "Hello, how are you?",
"userID": "12345",
"personality": "happy",
"longitud": 500,
"context": "casual conversation"
}
Request Examples:
Ensure you have node-fetch
installed.
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here';
const url = 'https://nexus.adonis-except.xyz/meta-ai';
const payload = {"text":"Hello", "userID":"12345", "context":"casual"};
async function callMetaAI() {
try {
const res = await fetch(url, {method:'POST', headers:{'Content-Type':'application/json','x-api-key':apiKey}, body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
callMetaAI();
Ensure you have node-fetch
installed.
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here';
const url = 'https://nexus.adonis-except.xyz/meta-ai';
const payload = {"text":"Hello", "userID":"12345", "context":"casual"};
async function callMetaAI() {
try {
const res = await fetch(url, {method:'POST', headers:{'Content-Type':'application/json','x-api-key':apiKey}, body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
callMetaAI();
Ensure you have axios
installed.
import axios,{AxiosError} from 'axios';
const apiKey:string='your_api_key_here'; const url:string='https://nexus.adonis-except.xyz/meta-ai';
interface Payload{text:string;userID:string;personality?:string;longitud?:number;context?:string;}
interface APIRes{result:string;} interface APIErr{error:string;message?:string;}
const payload:Payload={"text":"Hello","userID":"12345","context":"casual"};
async function callMetaAI():Promise<void>{try{const res=await axios.post<APIRes>(url,payload,{headers:{'Content-Type':'application/json','x-api-key':apiKey}});
console.log('Success:',res.data);}catch(e){if(axios.isAxiosError(e)){const ae=e as AxiosError<APIErr>;
if(ae.response)console.error('ErrData:',ae.response.data);else console.error('Err:',ae.message);}else console.error('UnxErr:',e);}}
callMetaAI();
Uses browser's fetch
API.
const apiKey = 'your_api_key_here';
const url = 'https://nexus.adonis-except.xyz/meta-ai';
const payload = {"text":"Hello", "userID":"12345", "context":"casual"};
async function callMetaAI() {
try {
const res = await fetch(url, {method:'POST', headers:{'Content-Type':'application/json','x-api-key':apiKey}, body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
callMetaAI();
curl -X POST 'https://nexus.adonis-except.xyz/meta-ai' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{"text":"Hello","userID":"12345","context":"casual"}'
Uses requests
library.
import requests,json
apiKey='your_api_key_here';url='https://nexus.adonis-except.xyz/meta-ai'
payload={"text":"Hello","userID":"12345","context":"casual"}
headers={'Content-Type':'application/json','x-api-key':apiKey}
try:
res=requests.post(url,headers=headers,data=json.dumps(payload))
res.raise_for_status(); print(f'Success:{res.json()}')
except requests.exceptions.HTTPError as e: print(f'HTTPErr:{e}-{res.text}')
except Exception as e: print(f'Err:{e}')
Uses standard net/http
.
require 'uri';require 'net/http';require 'json'
k='your_api_key_here';u=URI('https://nexus.adonis-except.xyz/meta-ai')
p={text:"Hello",userID:"12345",context:"casual"}
h=Net::HTTP.new(u.host,u.port);h.use_ssl=true;r=Net::HTTP::Post.new(u.request_uri)
r['Content-Type']='application/json';r['x-api-key']=k;r.body=p.to_json
begin;res=h.request(r);d=JSON.parse(res.body)
puts res.is_a?(Net::HTTPSuccess)?"OK:#{d}":"Err #{res.code}:#{d}"
rescue => e;puts "Ex:#{e.message}" end
Uses standard net/http
.
package main;import("bytes";"encoding/json";"fmt";"io/ioutil";"net/http")
func main(){k:="your_api_key_here";url:="https://nexus.adonis-except.xyz/meta-ai"
p:=map[string]interface{}{"text":"Hello","userID":"12345","context":"casual"}
jp,_:=json.Marshal(p);req,_:=http.NewRequest("POST",url,bytes.NewBuffer(jp))
req.Header.Set("Content-Type","application/json");req.Header.Set("x-api-key",k)
res,e:=(&http.Client{}).Do(req);if e!=nil{fmt.Println("Ex:",e);return};defer res.Body.Close()
b,_:=ioutil.ReadAll(res.Body);if res.StatusCode>=200&&res.StatusCode<300{fmt.Println("OK:",string(b))}else{fmt.Printf("Err %d:%s\n",res.StatusCode,string(b))}}
Uses cURL extension.
<?php $k='your_api_key_here';$u='https://nexus.adonis-except.xyz/meta-ai';
$p=['text'=>'Hello','userID'=>'12345','context'=>'casual'];
$ch=curl_init($u);curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_POST=>true,CURLOPT_POSTFIELDS=>json_encode($p),CURLOPT_HTTPHEADER=>['Content-Type:application/json','x-api-key:'.$k]]);
$res=curl_exec($ch);$c=curl_getinfo($ch,CURLINFO_HTTP_CODE);
echo($c>=200&&$c<300)?"OK:$res\n":"Err $c:$res\n";curl_close($ch);?>
Uses HttpURLConnection
and org.json.
import java.io.*;import java.net.*;import org.json.*;
public class MetaAI{public static void main(String[]a){String k="your_api_key_here";
JSONObject p=new JSONObject();p.put("text","Hello");p.put("userID","12345");p.put("context","casual");
try{HttpURLConnection c=(HttpURLConnection)new URL("https://nexus.adonis-except.xyz/meta-ai").openConnection();
c.setRequestMethod("POST");c.setRequestProperty("Content-Type","application/json;utf-8");
c.setRequestProperty("x-api-key",k);c.setDoOutput(true);
try(OutputStream o=c.getOutputStream()){o.write(p.toString().getBytes("utf-8"));}int co=c.getResponseCode();
try(BufferedReader r=new BufferedReader(new InputStreamReader((co>=200&&co<300)?c.getInputStream():c.getErrorStream()))){
System.out.println(((co>=200&&co<300)?"OK:":"Err "+co+":")+r.readLine());}c.disconnect();}catch(Exception e){e.printStackTrace();}}}
Uses HttpClient
and System.Text.Json.
using System;using System.Net.Http;using System.Text;using System.Text.Json;using System.Threading.Tasks;
public class MetaAI{static readonly HttpClient cl=new HttpClient();public static async Task Call(){
var k="your_api_key_here";var p=new{text="Hello",userID="12345",context="casual"};var j=JsonSerializer.Serialize(p);
var r=new HttpRequestMessage(HttpMethod.Post,"https://nexus.adonis-except.xyz/meta-ai"){Content=new StringContent(j,Encoding.UTF8,"application/json")};
r.Headers.Add("x-api-key",k);try{var R=await cl.SendAsync(r);var S=await R.Content.ReadAsStringAsync();
Console.WriteLine(R.IsSuccessStatusCode?$"OK:{S}":$"Err {R.StatusCode}:{S}");}catch(Exception e){Console.WriteLine($"Ex:{e.Message}");}}}
// public static async Task Main(string[] args) => await Call();
Uses URLSession
.
import Foundation
func callMetaAI(){let k="your_api_key_here";guard let u=URL(string:"https://nexus.adonis-except.xyz/meta-ai")else{return}
let p:[String:Any]=["text":"Hello","userID":"12345","context":"casual"]
guard let d=try?JSONSerialization.data(withJSONObject:p)else{return};var r=URLRequest(url:u);r.httpMethod="POST"
r.allHTTPHeaderFields=["Content-Type":"application/json","x-api-key":k];r.httpBody=d
URLSession.shared.dataTask(with:r){dt,rs,er in if let er=er{print("Err:\(er)");return}
guard let hr=rs as?HTTPURLResponse,let dt=dt,let s=String(data:dt,encoding:.utf8)else{return}
print((200...299).contains(hr.statusCode)?"OK:\(s)":"Err \(hr.statusCode):\(s)")}.resume()}
// callMetaAI(); RunLoop.main.run()
Uses HttpURLConnection
and org.json.
import java.io.*;import java.net.*;import org.json.*
fun main(){val k="your_api_key_here";val p=JSONObject().apply{put("text","Hello");put("userID","12345");put("context","casual")}
try{val c=(URL("https://nexus.adonis-except.xyz/meta-ai").openConnection()as HttpURLConnection).apply{requestMethod="POST";setRequestProperty("Content-Type","application/json;utf-8");setRequestProperty("x-api-key",k);doOutput=true}
OutputStreamWriter(c.outputStream).use{it.write(p.toString());it.flush()}
val s=if(c.responseCode in 200..299)c.inputStream else c.errorStream
BufferedReader(InputStreamReader(s)).use{println(if(c.responseCode in 200..299)"OK:${it.readText()}" else "Err ${c.responseCode}:${it.readText()}")}
c.disconnect()}catch(e:Exception){e.printStackTrace()}}
Uses http
package.
import 'dart:convert';import 'package:http/http.dart'as http;
void main()async{var k='your_api_key_here';var u=Uri.parse('https://nexus.adonis-except.xyz/meta-ai');
var p={'text':'Hello','userID':'12345','context':'casual'};
try{var r=await http.post(u,headers:{'Content-Type':'application/json','x-api-key':k},body:jsonEncode(p));
print((r.statusCode>=200&&r.statusCode<300)?'OK:${r.body}':'Err ${r.statusCode}:${r.body}');}catch(e){print('Ex:$e');}}
Uses reqwest
and serde_json
.
use reqwest::Error;use serde_json::json;
#[tokio::main]async fn main()->Result<(),Error>{let k="your_api_key_here";
let p=json!({"text":"Hello","userID":"12345","context":"casual"});
let c=reqwest::Client::new();let r=c.post("https://nexus.adonis-except.xyz/meta-ai")
.header("Content-Type","application/json").header("x-api-key",k).json(&p).send().await?;
let s=r.status();let b=r.text().await?;if s.is_success(){println!("OK:{}",b)}else{eprintln!("Err {}:{}",s,b)}Ok(())}
Expected response (JSON):
{
"result": "Respuesta de la IA"
}
AI Image Analysis (Vision)
Route: /vision
Method: POST
Content-Type: application/json
Description: This endpoint analyzes an image using artificial intelligence and provides a description based on the image content. Requires a Nexus API Key.
Required Headers:
x-api-key
: Your Nexus API Key.
Required Body Parameters (JSON):
url
: The URL of the image to be analyzed.prompt
: Text to guide the image analysis.userID
: A unique identifier for the user making the request.
Request examples:
POST /vision
Content-Type: application/json
x-api-key: your_nexus_api_key
{
"url": "https://example.com/image.jpg",
"prompt": "Describe everything you see in the image.",
"userID": "user123"
}
Request Examples:
Ensure you have node-fetch
installed.
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here';
const apiUrl = 'https://nexus.adonis-except.xyz/vision';
const payload = {"url":"https://example.com/image.jpg","prompt":"Describe.","userID":"user123"};
async function analyzeImage() {
try {
const res = await fetch(apiUrl, {method:'POST',headers:{'Content-Type':'application/json','x-api-key':apiKey},body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
analyzeImage();
Ensure you have node-fetch
installed.
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here';
const apiUrl = 'https://nexus.adonis-except.xyz/vision';
const payload = {"url":"https://example.com/image.jpg","prompt":"Describe.","userID":"user123"};
async function analyzeImage() {
try {
const res = await fetch(apiUrl, {method:'POST',headers:{'Content-Type':'application/json','x-api-key':apiKey},body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
analyzeImage();
Ensure you have axios
installed.
import axios,{AxiosError} from 'axios';
const apiKey:string='your_api_key_here'; const apiUrl:string='https://nexus.adonis-except.xyz/vision';
interface VisionPayload{url:string;prompt:string;userID:string;}
interface APIRes{result:string;} interface APIErr{error:string;message?:string;}
const payload:VisionPayload={"url":"https://example.com/image.jpg","prompt":"Describe.","userID":"user123"};
async function analyzeImage():Promise<void>{try{const res=await axios.post<APIRes>(apiUrl,payload,{headers:{'Content-Type':'application/json','x-api-key':apiKey}});
console.log('Success:',res.data);}catch(e){if(axios.isAxiosError(e)){const ae=e as AxiosError<APIErr>;
if(ae.response)console.error('ErrData:',ae.response.data);else console.error('Err:',ae.message);}else console.error('UnxErr:',e);}}
analyzeImage();
Uses browser's fetch
API.
const apiKey = 'your_api_key_here';
const apiUrl = 'https://nexus.adonis-except.xyz/vision';
const payload = {"url":"https://example.com/image.jpg","prompt":"Describe.","userID":"user123"};
async function analyzeImage() {
try {
const res = await fetch(apiUrl, {method:'POST',headers:{'Content-Type':'application/json','x-api-key':apiKey},body:JSON.stringify(payload)});
const data = await res.json();
if (!res.ok) throw new Error(data.error || `HTTP error ${res.status}`);
console.log('Success:', data);
} catch (e) { console.error('Error:', e.message); }
}
analyzeImage();
curl -X POST 'https://nexus.adonis-except.xyz/vision' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{
"url": "https://example.com/image.jpg",
"prompt": "Describe everything you see in the image.",
"userID": "user123"
}'
Ensure you have requests
installed (e.g., pip install requests
).
import requests
import json
api_key = 'your_api_key_here' # Replace
api_url = 'https://nexus.adonis-except.xyz/vision'
payload = {
"url": "https://example.com/image.jpg",
"prompt": "Describe everything you see in the image.",
"userID": "user123"
}
headers = {
'Content-Type': 'application/json',
'x-api-key': api_key
}
try:
response = requests.post(api_url, headers=headers, data=json.dumps(payload))
response.raise_for_status()
data = response.json()
print(f'Success: {data}')
except requests.exceptions.HTTPError as http_err:
print(f'HTTP error occurred: {http_err} - {response.text}')
except Exception as err:
print(f'Other error occurred: {err}')
Uses standard net/http
library.
require 'uri'
require 'net/http'
require 'json'
api_key = 'your_api_key_here' # Replace
uri = URI('https://nexus.adonis-except.xyz/vision')
payload = {
url: "https://example.com/image.jpg",
prompt: "Describe everything you see in the image.",
userID: "user123"
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true # Assuming HTTPS is used
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-Type'] = 'application/json'
request['x-api-key'] = api_key
request.body = payload.to_json
begin
response = http.request(request)
data = JSON.parse(response.body)
if response.is_a?(Net::HTTPSuccess)
puts "Success: #{data}"
else
puts "HTTP error! status: #{response.code} - #{data}"
end
rescue StandardError => e
puts "Error: #{e.message}"
end
Uses standard net/http
package.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
apiKey := "your_api_key_here" // Replace
apiUrl := "https://nexus.adonis-except.xyz/vision"
payload := map[string]interface{}{
"url": "https://example.com/image.jpg",
"prompt": "Describe everything you see in the image.",
"userID": "user123",
}
jsonPayload, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", apiUrl, bytes.NewBuffer(jsonPayload))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
if resp.StatusCode >= 200 && resp.StatusCode < 300 {
fmt.Println("Success:", string(body))
} else {
fmt.Printf("HTTP error! status: %d - %s\n", resp.StatusCode, string(body))
}
}
Uses the cURL extension.
'https://example.com/image.jpg',
'prompt' => 'Describe everything you see in the image.',
'userID' => 'user123',
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'x-api-key: ' . $apiKey
]
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode >= 200 && $httpCode < 300) {
echo "Success: " . $response . "\n";
} else {
echo "HTTP error! status: " . $httpCode . " - " . $response . "\n";
}
curl_close($ch);
?>
Uses HttpURLConnection
and a JSON library (e.g., org.json).
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONObject; // Example: org.json, or use Gson/Jackson
public class VisionAI {
public static void main(String[] args) {
String apiKey = "your_api_key_here"; // Replace
String apiUrl = "https://nexus.adonis-except.xyz/vision";
JSONObject payload = new JSONObject();
payload.put("url", "https://example.com/image.jpg");
payload.put("prompt", "Describe everything you see in the image.");
payload.put("userID", "user123");
try {
HttpURLConnection conn = (HttpURLConnection) new URL(apiUrl).openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json; utf-8");
conn.setRequestProperty("x-api-key", apiKey);
conn.setDoOutput(true);
try(OutputStream os = conn.getOutputStream()) {
os.write(payload.toString().getBytes("utf-8"));
}
int responseCode = conn.getResponseCode();
StringBuilder response = new StringBuilder();
try(BufferedReader br = new BufferedReader(new InputStreamReader(
(responseCode >= 200 && responseCode < 300) ? conn.getInputStream() : conn.getErrorStream(), "utf-8"))) {
String line;
while ((line = br.readLine()) != null) {
response.append(line.trim());
}
}
System.out.println(((responseCode >= 200 && responseCode < 300) ? "Success: " : "HTTP error! status: " + responseCode + " - ") + response.toString());
conn.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Uses HttpClient
and System.Text.Json (or Newtonsoft.Json).
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json; // For System.Text.Json
// using Newtonsoft.Json; // For Newtonsoft.Json
using System.Threading.Tasks;
public class VisionAIClient {
private static readonly HttpClient client = new HttpClient();
public static async Task AnalyzeImageAsync() {
var apiKey = "your_api_key_here"; // Replace
var apiUrl = "https://nexus.adonis-except.xyz/vision";
var payload = new {
url = "https://example.com/image.jpg",
prompt = "Describe everything you see in the image.",
userID = "user123"
};
var jsonPayload = JsonSerializer.Serialize(payload);
// var jsonPayload = JsonConvert.SerializeObject(payload); // For Newtonsoft
var request = new HttpRequestMessage(HttpMethod.Post, apiUrl) {
Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json")
};
request.Headers.Add("x-api-key", apiKey);
try {
HttpResponseMessage response = await client.SendAsync(request);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(response.IsSuccessStatusCode ? $"Success: {responseBody}" : $"HTTP error! status: {response.StatusCode} - {responseBody}");
} catch (HttpRequestException e) {
Console.WriteLine($"Request error: {e.Message}");
}
}
// public static async Task Main(string[] args) => await AnalyzeImageAsync();
}
Uses URLSession
.
import Foundation
func analyzeImageWithVision() {
let apiKey = "your_api_key_here" // Replace
guard let url = URL(string: "https://nexus.adonis-except.xyz/vision") else { return }
let payload: [String: Any] = [
"url": "https://example.com/image.jpg",
"prompt": "Describe everything you see in the image.",
"userID": "user123"
]
guard let jsonData = try? JSONSerialization.data(withJSONObject: payload) else { return }
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.allHTTPHeaderFields = ["Content-Type": "application/json", "x-api-key": apiKey]
request.httpBody = jsonData
URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error { print("Client error: \(error.localizedDescription)"); return }
guard let httpResponse = response as? HTTPURLResponse, let data = data,
let responseString = String(data: data, encoding: .utf8) else {
print("Invalid response or data"); return
}
print((200...299).contains(httpResponse.statusCode) ? "Success: \(responseString)" : "HTTP error! \(httpResponse.statusCode): \(responseString)")
}.resume()
}
// analyzeImageWithVision()
// RunLoop.main.run() // For command-line tool execution
Uses HttpURLConnection
and org.json library.
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.OutputStreamWriter
import java.net.HttpURLConnection
import java.net.URL
import org.json.JSONObject // Add org.json dependency
fun main() {
val apiKey = "your_api_key_here" // Replace
val apiUrl = "https://nexus.adonis-except.xyz/vision"
val payload = JSONObject().apply {
put("url", "https://example.com/image.jpg")
put("prompt", "Describe everything you see in the image.")
put("userID", "user123")
}
try {
val connection = (URL(apiUrl).openConnection() as HttpURLConnection).apply {
requestMethod = "POST"
setRequestProperty("Content-Type", "application/json; utf-8")
setRequestProperty("x-api-key", apiKey)
doOutput = true
}
OutputStreamWriter(connection.outputStream, "UTF-8").use { it.write(payload.toString()); it.flush() }
val responseCode = connection.responseCode
val stream = if (responseCode in 200..299) connection.inputStream else connection.errorStream
BufferedReader(InputStreamReader(stream, "UTF-8")).use {
val responseText = it.readText()
println(if (responseCode in 200..299) "Success: $responseText" else "HTTP error! $responseCode: $responseText")
}
connection.disconnect()
} catch (e: Exception) { e.printStackTrace() }
}
Uses the http
package (add to pubspec.yaml
).
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
var apiKey = 'your_api_key_here'; // Replace
var url = Uri.parse('https://nexus.adonis-except.xyz/vision');
var payload = {
'url': 'https://example.com/image.jpg',
'prompt': 'Describe everything you see in the image.',
'userID': 'user123',
};
try {
var response = await http.post(
url,
headers: {'Content-Type': 'application/json', 'x-api-key': apiKey},
body: jsonEncode(payload),
);
print((response.statusCode >= 200 && response.statusCode < 300)
? 'Success: ${response.body}'
: 'HTTP error! ${response.statusCode}: ${response.body}');
} catch (e) {
print('Exception: $e');
}
}
Uses reqwest
and serde_json
crates (add to Cargo.toml
).
use reqwest::Error;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Error> {
let api_key = "your_api_key_here"; // Replace
let api_url = "https://nexus.adonis-except.xyz/vision";
let payload = json!({
"url": "https://example.com/image.jpg",
"prompt": "Describe everything you see in the image.",
"userID": "user123"
});
let client = reqwest::Client::new();
let response = client.post(api_url)
.header("Content-Type", "application/json")
.header("x-api-key", api_key)
.json(&payload)
.send()
.await?;
let status = response.status();
let body = response.text().await?;
if status.is_success() {
println!("Success: {}", body);
} else {
eprintln!("HTTP error! status: {} - {}", status, body);
}
Ok(())
}
Expected response (JSON): Likely a JSON object containing the analysis, similar to other AI endpoints.
{
"result": "AI-generated description of the image content."
}
AI Image Generation
Route: /image-ai
Method: POST
Content-Type: application/json
Description: This endpoint generates images using artificial intelligence based on the specified prompt and model. All optional parameters listed below are supported by all available models. Requires an API Key sent via header. Returns the path/URL to the generated image.
Required Headers:
x-api-key
: Your API key. You need to join the Discord server to get one.
Required Parameters (POST - JSON Body):
prompt
(string): The descriptive text to generate the image. Example: "Un castillo en las nubes al atardecer".
Optional Parameters (POST - JSON Body):
negative_prompt
(string, default: ""): Elements you do not want in the image. Example: "personas, texto, desenfoque".model
(string, default: "flux"): The AI model to use for image generation. Example: "flux-realism".width
(number, default: 1024): Width of the generated image in pixels. Example: 512.height
(number, default: 1024): Height of the generated image in pixels. Example: 768.seed
(number, default: null): Seed number for reproducible results. If not defined, generation is random. Example: 12345.nologo
(boolean, default: false): If true, attempts to generate the image without logos or watermarks.private
(boolean, default: false): If true, marks the image as private (depending on the storage system).enhance
(boolean, default: false): If true, applies quality enhancements to the image (depending on the model or API support).safe
(boolean, default: false): If true, applies filters to ensure the generated image is safe for all audiences.
Available models:
flux
flux-realism
flux-anime
flux-3d
flux-pro
any-dark
turbo
pimp-diffusion
magister-diffusion
dolly-mini
stable-diffusion
stable-diffusion-animation
photo3dwillit
lucid-sonic-dreams
codeformer
(Note: This model is likely for face restoration, parameter behavior might differ slightly in practice)bark
(Note: This model is primarily for audio, parameter behavior might differ significantly or it might not be a valid image model)3d-photo-inpainting
(Note: Parameter behavior might differ for this specific task)
Note: While all parameters are listed as accepted for all models, some models like codeformer
, bark
, or 3d-photo-inpainting
might have specialized purposes where certain parameters (like negative_prompt
, width
/height
in the standard sense, etc.) might not have the typical effect of standard text-to-image models.
Example POST requests (JSON):
POST /image-ai
Content-Type: application/json
x-api-key: your_api_key_here
{
"prompt": "A castle in the clouds at sunset, detailed, epic fantasy",
"model": "flux-realism",
"width": 1024,
"height": 768,
"seed": 67890,
"negative_prompt": "blurry, low quality"
}
Request Examples:
Ensure you have node-fetch
installed (e.g., npm install node-fetch@2
).
const fetch = require('node-fetch');
const apiKey = 'your_api_key_here'; // Replace
const url = 'https://nexus.adonis-except.xyz/image-ai';
const payload = {
"prompt": "A castle in the clouds at sunset, detailed, epic fantasy",
"model": "flux-realism",
"width": 1024,
"height": 768,
"seed": 67890,
"negative_prompt": "blurry, low quality"
};
async function generateAiImage() {
try {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
body: JSON.stringify(payload)
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP error ${response.status}`);
console.log('Success:', data);
} catch (error) { console.error('Error:', error.message); }
}
generateAiImage();
Ensure you have node-fetch
installed (e.g., npm install node-fetch
).
import fetch from 'node-fetch';
const apiKey = 'your_api_key_here'; // Replace
const url = 'https://nexus.adonis-except.xyz/image-ai';
const payload = {
"prompt": "A castle in the clouds at sunset, detailed, epic fantasy",
"model": "flux-realism",
"width": 1024,
"height": 768,
"seed": 67890,
"negative_prompt": "blurry, low quality"
};
async function generateAiImage() {
try {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
body: JSON.stringify(payload)
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP error ${response.status}`);
console.log('Success:', data);
} catch (error) { console.error('Error:', error.message); }
}
generateAiImage();
Ensure you have axios
installed.
import axios, { AxiosError } from 'axios';
const apiKey: string = 'your_api_key_here'; // Replace
const url: string = 'https://nexus.adonis-except.xyz/image-ai';
interface ImageAiPayload {
prompt: string;
negative_prompt?: string;
model?: string;
width?: number;
height?: number;
seed?: number;
nologo?: boolean;
private?: boolean;
enhance?: boolean;
safe?: boolean;
}
interface ApiResponse { result: string; } // URL to the generated image
interface ApiErrorResponse { error: string; message?: string; }
const payload: ImageAiPayload = {
"prompt": "A castle in the clouds at sunset, detailed, epic fantasy",
"model": "flux-realism",
"width": 1024,
"height": 768,
"seed": 67890,
"negative_prompt": "blurry, low quality"
};
async function generateAiImage(): Promise {
try {
const response = await axios.post(url, payload, {
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey }
});
console.log('Success:', response.data);
} catch (error) {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError;
if (axiosError.response) console.error('Error Data:', axiosError.response.data);
else console.error('Error:', axiosError.message);
} else { console.error('Unexpected error:', error); }
}
}
generateAiImage();
Uses browser's fetch
API.
const apiKey = 'your_api_key_here'; // Replace
const url = 'https://nexus.adonis-except.xyz/image-ai';
const payload = {
"prompt": "A castle in the clouds at sunset, detailed, epic fantasy",
"model": "flux-realism",
"width": 1024,
"height": 768,
"seed": 67890,
"negative_prompt": "blurry, low quality"
};
async function generateAiImage() {
try {
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
body: JSON.stringify(payload)
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP error ${response.status}`);
console.log('Success:', data);
// Example: document.getElementById('generatedImage').src = data.result;
} catch (error) { console.error('Error:', error.message); }
}
generateAiImage();
curl -X POST 'https://nexus.adonis-except.xyz/image-ai' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{
"prompt": "A castle in the clouds at sunset, detailed, epic fantasy",
"model": "flux-realism",
"width": 1024,
"height": 768,
"seed": 67890,
"negative_prompt": "blurry, low quality"
}'
Uses requests
library.
import requests
import json
api_key = 'your_api_key_here' # Replace
url = 'https://nexus.adonis-except.xyz/image-ai'
payload = {
"prompt": "A castle in the clouds at sunset, detailed, epic fantasy",
"model": "flux-realism",
"width": 1024,
"height": 768,
"seed": 67890,
"negative_prompt": "blurry, low quality"
}
headers = {'Content-Type': 'application/json', 'x-api-key': api_key}
try:
response = requests.post(url, headers=headers, data=json.dumps(payload))
response.raise_for_status()
print(f'Success: {response.json()}')
except requests.exceptions.HTTPError as e:
print(f'HTTP error: {e} - {response.text}')
except Exception as e:
print(f'Error: {e}')
Uses standard net/http
.
require 'uri'; require 'net/http'; require 'json'
api_key = 'your_api_key_here'; uri = URI('https://nexus.adonis-except.xyz/image-ai')
payload = {prompt:"A castle in the clouds", model:"flux-realism"} # Simplified for brevity
http=Net::HTTP.new(uri.host,uri.port); http.use_ssl=true
req=Net::HTTP::Post.new(uri.request_uri)
req['Content-Type']='application/json'; req['x-api-key']=api_key; req.body=payload.to_json
begin
res=http.request(req); data=JSON.parse(res.body)
puts res.is_a?(Net::HTTPSuccess) ? "Success: #{data}" : "HTTP error! #{res.code} - #{data}"
rescue => e; puts "Error: #{e.message}" end
Uses standard net/http
.
package main; import ("bytes";"encoding/json";"fmt";"io/ioutil";"net/http")
func main(){
apiKey:="your_api_key_here"; url:="https://nexus.adonis-except.xyz/image-ai"
p:=map[string]interface{}{"prompt":"A castle in the clouds","model":"flux-realism"}
jp,_:=json.Marshal(p); req,_:=http.NewRequest("POST",url,bytes.NewBuffer(jp))
req.Header.Set("Content-Type","application/json");req.Header.Set("x-api-key",apiKey)
res,e:=(&http.Client{}).Do(req); if e!=nil{fmt.Println("Err:",e);return}; defer res.Body.Close()
b,_:=ioutil.ReadAll(res.Body)
if res.StatusCode>=200&&res.StatusCode<300{fmt.Println("OK:",string(b))}else{fmt.Printf("Err %d: %s\n",res.StatusCode,string(b))}
}
Uses cURL extension.
'A castle in the clouds','model'=>'flux-realism'];
$ch=curl_init($url); curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_POST=>true,CURLOPT_POSTFIELDS=>json_encode($p),CURLOPT_HTTPHEADER=>['Content-Type:application/json','x-api-key:'.$apiKey]]);
$res=curl_exec($ch);$code=curl_getinfo($ch,CURLINFO_HTTP_CODE);
echo($code>=200&&$code<300)?"OK:$res\n":"Err $code:$res\n"; curl_close($ch);
?>
Uses HttpURLConnection
and org.json.
import java.io.*;import java.net.*;import org.json.*;
public class ImageAI{public static void main(String[]a){
String k="your_api_key_here";JSONObject p=new JSONObject();
p.put("prompt","A castle in the clouds");p.put("model","flux-realism");
try{HttpURLConnection c=(HttpURLConnection)new URL("https://nexus.adonis-except.xyz/image-ai").openConnection();
c.setRequestMethod("POST");c.setRequestProperty("Content-Type","application/json;utf-8");
c.setRequestProperty("x-api-key",k);c.setDoOutput(true);
try(OutputStream o=c.getOutputStream()){o.write(p.toString().getBytes("utf-8"));}
int co=c.getResponseCode();
try(BufferedReader r=new BufferedReader(new InputStreamReader((co>=200&&co<300)?c.getInputStream():c.getErrorStream()))){
System.out.println(((co>=200&&co<300)?"OK: ":"Err "+co+": ")+r.readLine());}c.disconnect();
}catch(Exception e){e.printStackTrace();}}}
Uses HttpClient
and System.Text.Json.
using System;using System.Net.Http;using System.Text;using System.Text.Json;using System.Threading.Tasks;
public class ImageAI{static readonly HttpClient cl=new HttpClient();
public static async Task Generate(){var k="your_api_key_here";var p=new{prompt="A castle in the clouds",model="flux-realism"};
var j=JsonSerializer.Serialize(p);var r=new HttpRequestMessage(HttpMethod.Post,"https://nexus.adonis-except.xyz/image-ai"){Content=new StringContent(j,Encoding.UTF8,"application/json")};
r.Headers.Add("x-api-key",k);try{var R=await cl.SendAsync(r);var S=await R.Content.ReadAsStringAsync();
Console.WriteLine(R.IsSuccessStatusCode?$"OK:{S}":$"Err {R.StatusCode}:{S}");}catch(Exception e){Console.WriteLine($"Ex:{e.Message}");}}}
// public static async Task Main(string[] args) => await Generate();
Uses URLSession
.
import Foundation
func generateImageAI(){let k="your_api_key_here";guard let u=URL(string:"https://nexus.adonis-except.xyz/image-ai")else{return}
let p:[String:Any]=["prompt":"A castle in the clouds","model":"flux-realism"]
guard let d=try?JSONSerialization.data(withJSONObject:p)else{return};var r=URLRequest(url:u);r.httpMethod="POST"
r.allHTTPHeaderFields=["Content-Type":"application/json","x-api-key":k];r.httpBody=d
URLSession.shared.dataTask(with:r){dt,rs,er in if let er=er{print("Err:\(er)");return}
guard let hr=rs as?HTTPURLResponse,let dt=dt,let s=String(data:dt,encoding:.utf8)else{return}
print((200...299).contains(hr.statusCode)?"OK:\(s)":"Err \(hr.statusCode):\(s)")}.resume()}
// generateImageAI(); RunLoop.main.run()
Uses HttpURLConnection
and org.json.
import java.io.*;import java.net.*;import org.json.*
fun main(){val k="your_api_key_here";val p=JSONObject().apply{put("prompt","A castle in the clouds");put("model","flux-realism")}
try{val c=(URL("https://nexus.adonis-except.xyz/image-ai").openConnection()as HttpURLConnection).apply{requestMethod="POST";setRequestProperty("Content-Type","application/json;utf-8");setRequestProperty("x-api-key",k);doOutput=true}
OutputStreamWriter(c.outputStream).use{it.write(p.toString());it.flush()}
val s=if(c.responseCode in 200..299)c.inputStream else c.errorStream
BufferedReader(InputStreamReader(s)).use{println(if(c.responseCode in 200..299)"OK:${it.readText()}" else "Err ${c.responseCode}:${it.readText()}")}
c.disconnect()}catch(e:Exception){e.printStackTrace()}}
Uses http
package.
import 'dart:convert';import 'package:http/http.dart'as http;
void main()async{var k='your_api_key_here';var u=Uri.parse('https://nexus.adonis-except.xyz/image-ai');
var p={'prompt':'A castle in the clouds','model':'flux-realism'};
try{var r=await http.post(u,headers:{'Content-Type':'application/json','x-api-key':k},body:jsonEncode(p));
print((r.statusCode>=200&&r.statusCode<300)?'OK:${r.body}':'Err ${r.statusCode}:${r.body}');}catch(e){print('Ex:$e');}}
Uses reqwest
and serde_json
.
use reqwest::Error;use serde_json::json;
#[tokio::main]async fn main()->Result<(),Error>{let k="your_api_key_here";
let p=json!({"prompt":"A castle in the clouds","model":"flux-realism"});
let c=reqwest::Client::new();let r=c.post("https://nexus.adonis-except.xyz/image-ai")
.header("Content-Type","application/json").header("x-api-key",k).json(&p).send().await?;
let s=r.status();let b=r.text().await?;if s.is_success(){println!("OK:{}",b)}else{eprintln!("Err {}:{}",s,b)}Ok(())}
Expected response (JSON):
{
"result": "/public/ai_image_hash.jpg"
}
Uptime
Route: /uptime
Description: Checks the status and uptime of the API.
Request example: /uptime
Expected response: Message indicating if the API is active and its uptime (likely plain text or simple JSON).
IP Information
Route: /ip?dir=
Description: Provides geographical and network information about a given IP address.
Required parameter: dir
: The IP address to look up.
Request examples:
- /ip?dir=8.8.8.8
- /ip?dir=1.1.1.1
- /ip?dir=198.51.100.0 (Example public IP)
Expected response (JSON):
{
"ip": "8.8.8.8",
"pais": "US",
"codigo_pais": "US",
"region": "No disponible",
"latitud": 37.751,
"longitud": -97.822,
"zona_horaria": "America/Chicago",
"isp": [134744064, 134744575],
"organizacion": "No disponible"
}
BDFD Functions (Bot Designer for Discord)
Route: /bdfd?funcion=
Method: GET
Description: Provides detailed information about a specific BDFD function.
Required parameter: funcion
(function): The name of the BDFD function (URL encode special characters like $ to %24).
Request examples:
- /bdfd?funcion=%24title[]
- /bdfd?funcion=%24nomention
- /bdfd?funcion=%24randomText[]
Expected response (JSON):
{"nombre":"$title","descripcion":"Añade un título a un embed.","sintaxis":"$title[Title;(Index)]","ejemplo_descripcion":"Establece 'Mensaje Importante' como título del primer embed.","ejemplo_codigo":"$nomention\n$title[Mensaje Importante;1]\n$description[Contenido...]","premium":false,"intents":0,"bdscript_version":"1 y 2","deprecated":false,"deprecated_for":null}