Build with xuss.ai
Seamlessly integrate the world's most advanced Large Language Models directly into your applications. Our API is designed to be incredibly simple to implement while offering unmatched power and speed.
You can obtain and buy API tokens from telegram bot t.me/ZTHSBot
Available Models
xuss-pro
Pro
The flagship model designed for complex reasoning tasks. Optimized for safety and high accuracy.
CTX: 256k
Safety: Standard
xuss-unc
Uncensored
An unrestricted, raw model specifically designed for security research and creative writing.
CTX: 256k
Safety: None
Get Models List
GET /v1/models<?php
$url = "https://api.xuss.us/v1/models";
$apiKey = "GET_FROM_@ZTHSBOT";
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>Chat Completion
POST /v1/chat/completions<?php
$url = "https://api.xuss.us/v1/chat/completions";
$apiKey = "GET_FROM_@ZTHSBOT";
$data = [
"model" => "xuss-pro",
"messages" => [
["role" => "system", "content" => "You are a helpful assistant."],
["role" => "user", "content" => "Explain how a buffer overflow works."]
],
"temperature" => 0.7
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer $apiKey"],
CURLOPT_POSTFIELDS => json_encode($data)
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>Streaming
stream: true<?php
$url = "https://api.xuss.us/v1/chat/completions";
$apiKey = "GET_FROM_@ZTHSBOT";
$data = [
"model" => "xuss-pro",
"messages" => [["role" => "user", "content" => "Count to 10."]],
"stream" => true
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer $apiKey"],
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_WRITEFUNCTION => function($ch, $chunk) {
echo $chunk; // Output immediately
flush();
return strlen($chunk);
}
]);
curl_exec($ch);
curl_close($ch);
?>JSON Mode
<?php
$url = "https://api.xuss.us/v1/chat/completions";
$apiKey = "GET_FROM_@ZTHSBOT";
$data = [
"model" => "xuss-pro",
"messages" => [
[
"role" => "user",
"content" => "What is the best cheese? Return product and location in JSON format."
]
],
// Enforce JSON object response
"response_format" => ["type" => "json_object"]
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer $apiKey"],
CURLOPT_POSTFIELDS => json_encode($data)
]);
echo curl_exec($ch);
curl_close($ch);
?>Vision (Multimodal)
<?php
// 1. Prepare Image
$imgData = base64_encode(file_get_contents('image.jpg'));
$base64 = "data:image/jpeg;base64," . $imgData;
// 2. Setup Request
$url = "https://api.xuss.us/v1/chat/completions";
$apiKey = "GET_FROM_@ZTHSBOT";
$data = [
"model" => "xuss-pro",
"messages" => [[
"role" => "user",
"content" => [
["type" => "text", "text" => "What's in this image?"],
["type" => "image_url", "image_url" => ["url" => $base64]]
]
]]
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer $apiKey"],
CURLOPT_POSTFIELDS => json_encode($data)
]);
echo curl_exec($ch);
curl_close($ch);
?>Function Calling
<?php
// CONFIGURATION
$url = "https://api.xuss.us/v1/chat/completions";
$apiKey = "GET_FROM_@ZTHSBOT";
// 1. DEFINE TOOLS AND MESSAGES
$tools = [
[
"type" => "function",
"function" => [
"name" => "get_stock_price",
"description" => "Get current stock price",
"parameters" => [
"type" => "object",
"properties" => ["ticker" => ["type" => "string"]],
"required" => ["ticker"]
]
]
]
];
$messages = [
["role" => "user", "content" => "What is the price of Apple stock?"]
];
// 2. SEND FIRST REQUEST (Ask AI what it needs)
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer $apiKey"],
CURLOPT_POSTFIELDS => json_encode([
"model" => "xuss-pro",
"messages" => $messages,
"tools" => $tools
])
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
$aiMessage = $response['choices'][0]['message'];
// 3. CHECK IF AI WANTS TO USE A TOOL
if (isset($aiMessage['tool_calls'])) {
// Add AI's request to our history
$messages[] = $aiMessage;
// Loop through the tools the AI wants to call
foreach ($aiMessage['tool_calls'] as $toolCall) {
$functionName = $toolCall['function']['name'];
$arguments = json_decode($toolCall['function']['arguments'], true);
// --- EXECUTE YOUR LOGIC HERE ---
// (In a real app, you would query a database or API here)
$price = "150.00";
// --------------------------------
// Add the RESULT to history
$messages[] = [
"role" => "tool",
"tool_call_id" => $toolCall['id'],
"name" => $functionName,
"content" => $price
];
}
// 4. SEND FINAL REQUEST (With the tool results)
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer $apiKey"],
CURLOPT_POSTFIELDS => json_encode([
"model" => "xuss-pro",
"messages" => $messages,
"tools" => $tools
])
]);
$finalResponse = json_decode(curl_exec($ch), true);
curl_close($ch);
// OUTPUT: "The current price of Apple is $150.00."
echo $finalResponse['choices'][0]['message']['content'];
}
?>Errors & Status
| Code | Meaning |
|---|---|
| 200 | OK. Request successful. |
| 401 | Unauthorized. Check your API Key. |
| 429 | Rate limit exceeded. Slow down. |
Error Response Format
{
"error": "Invalid API Key provided.",
"code": "invalid_api_key"
}