Textguardai
Classifies and detects spam in text content using advanced AI models. Offers a simple REST API for both single and batch text analysis with tiered access options and detailed confidence scoring.
Author

algorithm07-ai
No License
Quick Info
Tools 1
Last Updated 7/7/2025
Actions
Tags
textguardai ai api ai textguardai spam text textguardai classifies
TextGuard AI
TextGuard AI is a powerful text classification and spam detection API that uses advanced AI models to analyze and classify text content. It provides a simple REST API interface for both single text analysis and batch processing.
Features
- Text classification and spam detection
- Batch processing support
- Tiered API access (Free, Basic, Premium)
- Rate limiting and usage tracking
- Detailed analysis with confidence scores
- Easy integration with existing applications
Installation
- Clone the repository:
git clone https://github.com/yourusername/textguard-ai.git
cd textguard-ai
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
Create a
.env
file in the root directory with the following variables:
DEEPSEEK_API_KEY=your_deepseek_api_key_here
FREE_API_KEY=free_key
BASIC_API_KEY=basic_key
PREMIUM_API_KEY=premium_key
Usage
- Start the server:
python -m src.api.main
- The API will be available at
http://localhost:8000
API Endpoints
GET /
: Root endpoint with API informationGET /health
: Health check endpointGET /tools
: List available tools and their parametersPOST /classify
: Classify a single textPOST /batch_classify
: Classify multiple textsGET /usage
: Get usage statistics
Example Requests
- Single Text Classification:
curl -X POST "http://localhost:8000/classify" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"text": "Your text here", "analysis_type": "spam"}'
- Batch Classification:
curl -X POST "http://localhost:8000/batch_classify" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"texts": ["Text 1", "Text 2"], "analysis_type": "spam"}'
API Tiers
Free Tier
- 100 requests per day
- Maximum batch size: 10 texts
- Basic analysis
Basic Tier
- 1,000 requests per day
- Maximum batch size: 50 texts
- Detailed analysis
Premium Tier
- 10,000 requests per day
- Maximum batch size: 100 texts
- Advanced analysis with priority processing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.