AI Tools Directory API Reference
Complete REST API documentation for the AI Tools Directory backend â built on Cloudflare Workers, Hono, and D1. All endpoints return JSON.
⥠Environments
| Production | https://ai-tools-backend.workers.dev/api |
| Local Dev | http://localhost:8787/api |
| Health | GET /health |
đ Authentication
Most endpoints require a valid JWT access token. Tokens are issued after login or email verification and expire in 15 minutes. Refresh tokens last 30 days.
Option 1 â Authorization Header (recommended)
Authorization: Bearer <access_token>
Option 2 â Cookie (browser clients)
access_token=<access_token>
401 Unauthorized without a valid token. Admin-only endpoints return 403 Forbidden for non-admin users.
Error Format
All errors follow a consistent JSON envelope regardless of the error type.
{
"success": false,
"errorCode": "VALIDATION_ERROR",
"message": "Validation failed",
"errors": [ // present for validation errors only
{ "field": "email", "message": "Invalid email address" }
]
}
HTTP Status Codes
API Modules
Authentication
Register, login, email OTP verification, Google OAuth, token refresh, and logout.
Subscription & Payments
Stripe-powered plans, checkout sessions, direct card payment, plan upgrades, billing portal, and invoices.
Users
User profiles, password change, bookmarks, and admin user management.
Tools
Full CRUD for AI tool listings â create, list, search, review, rate, bookmark, upvote, bulk import.
AI for Lawyers
Specialized lawyer tool listing with practice area, compliance, and functional filters.
AI for Real Estate
Real estate tool listing with property type, functional, and compliance standard filters.
AI for Videos
Video AI tool listing filtered by generation method, use case, and production stage.
Tool Ranking Strategy
How tools are ordered â rank score formula, featured section rules, CDN cache TTLs, scheduling, and cold-start handling for new publishers.
Homepage Listing & Promotion
Slot-layer architecture, new tool step-down fade, paid promotion (flat-fee slots), dedicated homepage route design, and cache strategy.