API Documentation

Complete guide to integrating Cheat X AI into your applications

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

Note: You need an API key to use these endpoints. Generate one from your dashboard after creating an account.

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

  1. Create an account at Register Page
  2. Login to your dashboard
  3. Navigate to API Keys section
  4. Click "Generate New API Key"
  5. Copy and save your API key securely

Using Your API Key

cURL
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!"}'
Security Warning: Never expose your API key in client-side code or public repositories. Keep it secure on your backend server.

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:

JSON Response
{ "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 reasoning
  • cheat-x-pro - GPT-4 powered
  • cheat-x-ultra - Claude 3 Opus
  • cheat-x-fast - Lightning fast
  • cheat-x-mini - Lightweight
POST /api/v1/chat

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
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

JSON
{ "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.

POST /api/v1/image

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
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

JSON
{ "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

JavaScript
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

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

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

JSON
{ "error": "Error message describing what went wrong" }

Common Errors

Invalid API Key: Make sure your API key is correctly formatted and included in the X-API-Key header.
Rate Limit Exceeded: Wait for the rate limit to reset or upgrade your account for higher limits.
Tip: Implement exponential backoff and retry logic in your application to handle temporary errors gracefully.

Need Help?

If you have questions or need assistance, join our Discord community: Join Discord

Made with ❤️ in Kerala, Thrissur, India 🇮🇳