API Endpoints Reference
Complete reference for all HeroPrompt API endpoints.
Base URL
- Production:
https://heroprompt.store/apior Railway backend URL - Development:
http://localhost:8000/api
Authentication
Most endpoints require Bearer token authentication:
http
Authorization: Bearer <jwt_token>Authentication Endpoints
Register
http
POST /api/auth/register
Content-Type: application/json
{
"email": "user@example.com",
"password": "strong_password",
"name": "Full Name"
}Login
http
POST /api/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "password"
}OAuth (GitHub/Google)
http
GET /api/auth/github # Redirects to GitHub OAuth
GET /api/auth/google # Redirects to Google OAuthCategories & Prompts
List Categories
http
GET /api/categoriesReturns all categories with subcategories and metadata.
Get Category
http
GET /api/categories/{category_id}List Prompts in Category
http
GET /api/categories/{category_id}/promptsSearch Prompts
http
GET /api/search?q=querySkills (PRO+ Required)
List Skills
http
GET /api/skills
Authorization: Bearer <token>Get Skill
http
GET /api/skills/{skill_id}
Authorization: Bearer <token>Search Skills
http
GET /api/skills/search?q=query
Authorization: Bearer <token>User Management
Current User
http
GET /api/user/me
Authorization: Bearer <token>Subscription
http
GET /api/user/subscription
Authorization: Bearer <token>Favorites
http
GET /api/user/favorites
POST /api/user/favorites {"prompt_id": "uuid"}
DELETE /api/user/favorites/{prompt_id}
Authorization: Bearer <token>CLI Tokens
Create Token
http
POST /api/user/tokens
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "My Dev Machine",
"expires_in_days": 90
}Token limits by tier:
- Free: 0 tokens
- Starter: 1 token
- Pro: 3 tokens
- Lifetime: 5 tokens
List Tokens
http
GET /api/user/tokens
Authorization: Bearer <token>Revoke Token
http
DELETE /api/user/tokens/{token_id}
Authorization: Bearer <token>Prompt Optimizer
Optimization Modes
http
GET /api/optimizer/modesReturns available modes:
enhance— Enhance & Clarifystructured— Structured Formatchain-of-thought— Chain of Thoughtfew-shot— Few-Shot Examplesmodel-specific— Model-Specific
Optimize Prompt
http
POST /api/optimizer/optimize
Authorization: Bearer <token>
Content-Type: application/json
{
"prompt": "Original prompt text",
"mode": "enhance"
}Returns streaming response (Server-Sent Events).
Daily limits:
- Free: 3/day
- Starter: 10/day
- Pro/Lifetime: Unlimited
Optimization History
http
GET /api/optimizer/history
Authorization: Bearer <token>Payments
Stripe Checkout
http
POST /api/payments/checkout
Authorization: Bearer <token>
Content-Type: application/json
{
"tier": "starter" | "pro" | "lifetime"
}PayPal Checkout
http
POST /api/payments/paypal/checkout
Authorization: Bearer <token>
Content-Type: application/json
{
"tier": "lifetime"
}Usage Limits
| Feature | Free | Starter | Pro | Lifetime |
|---|---|---|---|---|
| Prompts per day | 10 | Unlimited | Unlimited | Unlimited |
| Optimizer per day | 3 | 10 | Unlimited | Unlimited |
| API access | ❌ | ✅ | ✅ | ✅ |
| Skills access | ❌ | ❌ | ✅ | ✅ |
| CLI tokens (max) | 0 | 1 | 3 | 5 |
For complete API documentation, see API.md.