HeroPrompt
Back to docs
API Reference

API Endpoints Reference

Complete reference for all HeroPrompt API endpoints.

Updated 2026-02-15

API Endpoints Reference

Complete reference for all HeroPrompt API endpoints.

Base URL

  • Production: https://heroprompt.store/api or 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 OAuth

Categories & Prompts

List Categories

http
GET /api/categories

Returns all categories with subcategories and metadata.

Get Category

http
GET /api/categories/{category_id}

List Prompts in Category

http
GET /api/categories/{category_id}/prompts

Search Prompts

http
GET /api/search?q=query

Skills (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/modes

Returns available modes:

  • enhance — Enhance & Clarify
  • structured — Structured Format
  • chain-of-thought — Chain of Thought
  • few-shot — Few-Shot Examples
  • model-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

FeatureFreeStarterProLifetime
Prompts per day10UnlimitedUnlimitedUnlimited
Optimizer per day310UnlimitedUnlimited
API access
Skills access
CLI tokens (max)0135

For complete API documentation, see API.md.