Introduction
Welcome to the Cheat X AI API documentation. Our API allows you to integrate powerful AI capabilities into your applications, including multi-model chat, image generation, and code analysis.
Base URL: http://45.131.64.32:25569/api/v1
Authentication
All API requests require authentication using an API key. Include your API key in the
X-API-Key header of every request.
Getting Your API Key
- Create an account at Register Page
- Login to your dashboard
- Navigate to API Keys section
- Click "Generate New API Key"
- Copy and save your API key securely
Using Your API Key
curl -X POST http://45.131.64.32:25569/api/v1/chat \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{"message": "Hello, AI!"}'
Rate Limits
API requests are rate-limited to ensure fair usage and system stability. Default limits for free accounts:
- Chat: 100 requests per hour, 1000 per day
- Image Generation: 5 requests per day
- Code Fixing: 50 requests per day
Rate Limit Headers
Every API response includes rate limit information in headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000000
Exceeding Rate Limits
When you exceed your rate limit, you'll receive a 429 Too Many Requests error:
{
"error": "Daily chat limit reached"
}
Chat API
Send messages to our AI models and receive intelligent responses.
Available Models
cheat-x-4.5- Fast and efficient (FREE)cheat-x-5- Advanced reasoningcheat-x-pro- GPT-4 poweredcheat-x-ultra- Claude 3 Opuscheat-x-fast- Lightning fastcheat-x-mini- Lightweight
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
message |
string | Required | The message to send to the AI |
model |
string | Optional | Model to use (default: cheat-x-4.5) |
Example Request
curl -X POST http://45.131.64.32:25569/api/v1/chat \
-H "Content-Type: application/json" \
-H "X-API-Key: cheatx_your_api_key_here" \
-d '{
"message": "Explain quantum computing",
"model": "cheat-x-5"
}'
Example Response
{
"success": true,
"response": "Quantum computing is a type of computation...",
"model": "cheat-x-5"
}
Image Generation API
Generate images using AI based on text descriptions.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt |
string | Required | Description of the image to generate |
options.width |
number | Optional | Image width (default: 1024) |
options.height |
number | Optional | Image height (default: 1024) |
options.style |
string | Optional | Style: realistic, anime, artistic, 3d, cyberpunk |
Example Request
curl -X POST http://45.131.64.32:25569/api/v1/image \
-H "Content-Type: application/json" \
-H "X-API-Key: cheatx_your_api_key_here" \
-d '{
"prompt": "A futuristic city at sunset",
"options": {
"width": 1920,
"height": 1080,
"style": "cyberpunk"
}
}'
Example Response
{
"success": true,
"source": "pollinations",
"url": "https://image.pollinations.ai/prompt/...",
"prompt": "A futuristic city at sunset",
"width": 1920,
"height": 1080
}
Code Examples
JavaScript / Node.js
const axios = require('axios');
const API_KEY = 'cheatx_your_api_key_here';
const BASE_URL = 'http://45.131.64.32:25569/api/v1';
async function chatWithAI(message, model = 'cheat-x-4.5') {
try {
const response = await axios.post(`${BASE_URL}/chat`, {
message: message,
model: model
}, {
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY
}
});
return response.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
throw error;
}
}
// Usage
chatWithAI('Hello, AI!')
.then(data => console.log(data.response))
.catch(err => console.error(err));
Python
import requests
API_KEY = 'cheatx_your_api_key_here'
BASE_URL = 'http://45.131.64.32:25569/api/v1'
def chat_with_ai(message, model='cheat-x-4.5'):
headers = {
'Content-Type': 'application/json',
'X-API-Key': API_KEY
}
data = {
'message': message,
'model': model
}
response = requests.post(f'{BASE_URL}/chat', json=data, headers=headers)
if response.status_code == 200:
return response.json()
else:
raise Exception(f'Error: {response.json()}')
# Usage
result = chat_with_ai('Hello, AI!')
print(result['response'])
PHP
$message,
'model' => $model
];
$ch = curl_init("$baseUrl/chat");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
"X-API-Key: $apiKey"
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Usage
$result = chatWithAI('Hello, AI!');
echo $result['response'];
?>
Error Handling
The API uses standard HTTP status codes to indicate success or failure of requests.
HTTP Status Codes
| Code | Status | Description |
|---|---|---|
200 |
OK | Request successful |
400 |
Bad Request | Invalid request parameters |
401 |
Unauthorized | Invalid or missing API key |
429 |
Too Many Requests | Rate limit exceeded |
500 |
Internal Server Error | Server-side error |
Error Response Format
{
"error": "Error message describing what went wrong"
}
Common Errors
Need Help?
If you have questions or need assistance, join our Discord community: Join Discord
Made with ❤️ in Kerala, Thrissur, India 🇮🇳