Base URL: http://localhost:3000
All protected endpoints require a Bearer token:
Authorization: Bearer <your-jwt-token>Get token via /api/auth/register or /api/auth/login.
Register a new user.
Request:
{
"email": "user@example.com",
"password": "secure_password",
"name": "John Doe"
}Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "uuid",
"email": "user@example.com",
"name": "John Doe",
"plan": "free",
"creditsRemaining": 5
}
}Login existing user.
Request:
{
"email": "user@example.com",
"password": "secure_password"
}Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "uuid",
"email": "user@example.com",
"name": "John Doe",
"plan": "free",
"creditsRemaining": 5
}
}Get current user info.
Headers:
Authorization: Bearer <token>
Response:
{
"id": "uuid",
"email": "user@example.com",
"name": "John Doe",
"plan": "free",
"creditsRemaining": 5,
"createdAt": "2026-03-07T10:00:00Z"
}Upload PDF and get pricing estimate.
Headers:
Authorization: Bearer <token>
Content-Type: multipart/form-data
Request:
curl -X POST http://localhost:3000/api/upload \
-H "Authorization: Bearer <token>" \
-F "file=@report.pdf"Response:
{
"reportId": "uuid",
"filename": "report.pdf",
"pageCount": 12,
"tier": "medium",
"priceCents": 299,
"priceFormatted": "$2.99",
"currency": "USD",
"status": "pending",
"message": "Ready for processing. Confirm payment to start."
}Tiers:
short(1-5 pages): $0.99medium(6-15 pages): $2.99long(16-50 pages): $4.99enterprise(51+ pages): Custom pricing (contact sales)
Confirm payment and start processing.
Headers:
Authorization: Bearer <token>
Request:
{
"language": "auto", // or "tr", "en", "es", etc.
"tone": "professional" // or "casual", "storytelling"
}Response:
{
"reportId": "uuid",
"status": "processing",
"message": "Processing started. Check status endpoint for updates."
}Languages:
auto: Auto-detect from text (default)tr: Turkishen: Englishes: Spanishfr: Frenchde: German
Tones:
professional: Clear, formal podcast stylecasual: Conversational, friendly stylestorytelling: Dramatic, narrative style
List user's reports.
Headers:
Authorization: Bearer <token>
Query Parameters:
limit(optional, default: 20): Number of reports to returnoffset(optional, default: 0): Pagination offset
Response:
{
"reports": [
{
"id": "uuid",
"filename": "report.pdf",
"pageCount": 12,
"tier": "medium",
"status": "completed",
"audioUrl": "/api/reports/uuid/download",
"createdAt": "2026-03-07T10:00:00Z",
"completedAt": "2026-03-07T10:05:00Z"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"hasMore": false
}
}Get report details and status.
Headers:
Authorization: Bearer <token>
Response:
{
"id": "uuid",
"filename": "report.pdf",
"pageCount": 12,
"tier": "medium",
"status": "completed",
"audioUrl": "/api/reports/uuid/download",
"audioSize": 3451234,
"audioDurationSeconds": 180,
"processingTimeMs": 45000,
"aiCostCents": 5,
"ttsCostCents": 0,
"errorMessage": null,
"createdAt": "2026-03-07T10:00:00Z",
"completedAt": "2026-03-07T10:05:00Z"
}Status values:
pending: Uploaded, waiting for payment confirmationprocessing: AI script generation + TTS in progresscompleted: Audio file ready for downloadfailed: Processing failed (see errorMessage)
Download generated audio file.
Headers:
Authorization: Bearer <token>
Response:
- Content-Type:
audio/mpeg - File download stream
Example:
curl -X GET http://localhost:3000/api/reports/:reportId/download \
-H "Authorization: Bearer <token>" \
-o podcast.mp3Delete report and audio file.
Headers:
Authorization: Bearer <token>
Response:
{
"message": "Report deleted successfully"
}Enable public sharing (generate share link).
Headers:
Authorization: Bearer <token>
Response:
{
"shareToken": "abc123...",
"shareUrl": "http://localhost:3000/listen/abc123...",
"message": "Public sharing enabled"
}Disable public sharing.
Headers:
Authorization: Bearer <token>
Response:
{
"message": "Public sharing disabled"
}Get listen statistics.
Headers:
Authorization: Bearer <token>
Response:
{
"totalListens": 42,
"lastListenedAt": "2026-03-07T15:30:00Z",
"isPublic": true,
"shareToken": "abc123...",
"recentListens": [
{
"listenedAt": "2026-03-07T15:30:00Z",
"ipAddress": "192.168.1.***",
"country": "TR",
"city": "Istanbul"
}
]
}Public endpoint - Stream/download podcast (no auth required).
Response:
- Content-Type:
audio/mpeg - Streams audio file
- Tracks listen event
Example:
# Open in browser or media player
open http://localhost:3000/listen/abc123...
# Download
curl http://localhost:3000/listen/abc123... -o podcast.mp3Check API and database health.
Response:
{
"status": "healthy",
"timestamp": "2026-03-07T10:00:00Z",
"database": {
"healthy": true,
"timestamp": "2026-03-07T10:00:00.123Z"
},
"version": "0.1.0"
}curl -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "password123",
"name": "Test User"
}'Save the returned token.
curl -X POST http://localhost:3000/api/upload \
-H "Authorization: Bearer <token>" \
-F "file=@report.pdf"Save the returned reportId.
curl -X POST http://localhost:3000/api/upload/<reportId>/confirm \
-H "Authorization: Bearer <token>"curl -X GET http://localhost:3000/api/reports/<reportId> \
-H "Authorization: Bearer <token>"Wait until status is completed.
curl -X GET http://localhost:3000/api/reports/<reportId>/download \
-H "Authorization: Bearer <token>" \
-o podcast.mp3All errors follow this format:
{
"error": "Error type",
"message": "Detailed error message"
}Common HTTP Status Codes:
400: Bad request (missing parameters, invalid input)401: Unauthorized (missing/invalid token)403: Forbidden (accessing someone else's resource)404: Not found409: Conflict (e.g., email already exists)500: Internal server error
(Not implemented yet)
Future: 100 requests/minute per user.
(Not implemented yet)
Future: Webhook notifications when report processing completes.