
Unlisted
Like
readback-api
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v11View latest version
This is a wrapper API for the LemonFox AI speech generation service. It simplifies the interface by only exposing the essential parameters while handling authentication and configuration internally.
LEMONFOX_API_KEY- Your LemonFox API keyREVENUECAT_API_KEY- Your RevenueCat API key for subscription verificationADMIN_ACCESS_KEY- Admin bypass key for development/testing
Update the REVENUECAT_PROJECT_ID constant in /backend/index.ts with your actual RevenueCat project ID.
All API endpoints (except /health) require authentication via the Authorization header:
Authorization: Bearer YOUR_ADMIN_ACCESS_KEY
Authorization: Bearer CUSTOMER_ID
or
Authorization: Customer CUSTOMER_ID
The API will verify the customer has active entitlements via RevenueCat before allowing access.
Generates speech from text using the LemonFox AI service.
Request Body:
{ "voice": "sarah", "input": "Text to convert to speech" }
Response:
{ "audio": "_base_64_encoded_audio_here", "word_timestamps": [ { "word": "Hello!", "start": 0.275, "end": 0.7 } ] }
Error Response:
{ "error": "Error message", "details": "Additional error details (optional)" }
Health check endpoint that returns the service status.
Response:
{ "status": "ok", "timestamp": "2024-01-01T00:00:00.000Z" }
The API automatically configures:
response_format: Always set to "mp3"word_timestamps: Always set to true
Only voice and input parameters need to be provided by the client.