AI Tool Nest is a powerful, production-ready REST API service that provides advanced AI-powered text and image processing capabilities. Built with FastAPI and modern Python, it offers enterprise-grade features including robust authentication, rate limiting, and comprehensive monitoring.
To start using the API, you'll need to:
Below you'll find comprehensive examples for all available endpoints. Each example is standalone and can be run directly.
Check the API's health status.
Rate Limit: 5 requests per minute
import requests
url = 'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/health'
response = requests.get(url)
print(response.json())
# Example Response:
# {
# 'status': 'healthy'
# }
Register a new user account.
Rate Limit: 5 requests per minute
import requests
url = 'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/auth/register'
payload = {
'username': 'your_username',
'email': 'your_email@example.com',
'password': 'your_secure_password'
}
response = requests.post(url, json=payload)
print(response.json())
# Example Response:
# {
# 'email': 'your_email@example.com',
# 'username': 'your_username',
# 'id': 5,
# 'is_active': True
# }
Get an access token for authentication.
Rate Limit: 5 requests per minute
import requests
url = 'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/auth/login'
payload = {
'username': 'your_username',
'password': 'your_secure_password'
}
response = requests.post(url, json=payload)
print(response.json())
# Example Response:
# {
# 'access_token': 'your-jwt-token',
# 'token_type': 'bearer'
# }
# Store the access token for later use
access_token = response.json()['access_token']
Generate a new API key for accessing protected endpoints.
Rate Limit: 2 requests per minute
import requests
url = 'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/api-keys'
headers = {
'Authorization': f'Bearer {access_token}' # Use access_token from login
}
payload = {
'name': 'my_api_key'
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
# Example Response:
# {
# 'id': 2,
# 'name': 'my_api_key',
# 'key_prefix': '_66EFEuo',
# 'status': 'active',
# 'created_at': '2025-04-24T10:25:57.538980',
# 'last_used_at': None,
# 'revoked_at': None,
# 'api_key': '_66EFEuoiT-hqBx43y0bGKTcDUnHQL107MSkZ9k91A4'
# }
# Store the API key for later use
api_key = response.json()['api_key']
View all your active API keys.
Rate Limit: 10 requests per minute
import requests
url = 'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/api-keys'
headers = {
'Authorization': f'Bearer {access_token}' # Use access_token from login
}
response = requests.get(url, headers=headers)
api_keys = response.json()['api_keys']
# Print API keys in a readable format
print(f"Total API keys: {len(api_keys)}")
for key in api_keys:
print(
f"ID: {key['id']} || "
f"Name: {key['name']} || "
f"Key Prefix: {key['key_prefix']} || "
f"Status: {key['status']} || "
f"Created at: {key['created_at']} || "
f"Last Used at: {key['last_used_at']}"
)
Check usage statistics for a specific API key.
Rate Limit: 10 requests per minute
import requests
api_key_id = 123 # Replace with your API key ID
url = f'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/api-keys/{api_key_id}/usage'
headers = {
'Authorization': f'Bearer {access_token}' # Use access_token from login
}
response = requests.get(url, headers=headers)
print(response.json())
Revoke an existing API key.
Rate Limit: 2 requests per minute
import requests
api_key_id = 123 # Replace with the API key ID you want to delete
url = f'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/api-keys/{api_key_id}'
headers = {
'Authorization': f'Bearer {access_token}' # Use access_token from login
}
response = requests.delete(url, headers=headers)
print(response.json())
Generate a concise summary of provided text.
Rate Limit: 5 requests per minute
import requests
url = 'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/ai-tools/summarize'
headers = {
'X-API-Key': api_key # Use api_key from the create API key response
}
payload = {
'text': '''A Python developer is needed to join an AI project focusing on building an intelligent
chatbot and AI agent. The ideal candidate should have strong Python proficiency, experience
integrating AI/ML services and APIs, and good communication skills in English. Experience in
Python web frameworks, vector databases, SQL databases, asynchronous programming, and Docker
is also required.''',
'include_keywords': True
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Rewrite text in different styles.
Rate Limit: 5 requests per minute
import requests
url = 'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/ai-tools/paraphrase'
headers = {
'X-API-Key': api_key # Use api_key from the create API key response
}
payload = {
'text': '''A Python developer is needed to join an AI project focusing on building an intelligent
chatbot and AI agent. The ideal candidate should have strong Python proficiency, experience
integrating AI/ML services and APIs, and good communication skills in English.''',
'style': 'formal',
'intensity': 'high',
'length_option': 'longer'
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Convert images to text using URL or file upload.
Rate Limit: 5 requests per minute
import requests
# Using Image URL
url = 'https://thisisaqib.com/ai-tool-nest-api/v1/endpoints/ai-tools/image-to-text'
headers = {
'X-API-Key': api_key # Use api_key from the create API key response
}
payload = {
'image_url': 'https://example.com/path/to/your/image.jpg',
'mode': 'ocr',
'detail_level': 'standard'
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
# Using Image File
file_path = 'path/to/your/image.jpg' # Replace with your image path
with open(file_path, 'rb') as file:
files = {'image_file': (file_path, file, 'image/jpeg')}
response = requests.post(url, files=files, headers=headers, data=payload)
print(response.json())
Here's how to handle errors when making API requests:
import requests
try:
# Make your API request here
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status() # Raises an error for bad status codes
result = response.json()
print("Success:", result)
except requests.exceptions.RequestException as e:
if hasattr(e.response, 'json'):
error_detail = e.response.json()
print(f"API Error: {error_detail}")
else:
print(f"Request Error: {str(e)}")
except Exception as e:
print(f"Unexpected Error: {str(e)}")