• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
tr3ntg

tr3ntg

readback-api

API for readback.
Unlisted
Like
readback-api
Home
Code
3
backend
3
README.md
main.tsx
Branches
2
Pull requests
Remixes
History
Environment variables
7
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
6/15/2025
Viewing readonly version of main branch: v14
View latest version
README.md

Speech API Wrapper

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.

Setup

Required Environment Variables

  1. LEMONFOX_API_KEY - Your LemonFox API key
  2. REVENUECAT_API_KEY - Your RevenueCat API key for subscription verification
  3. ADMIN_ACCESS_KEY - Admin bypass key for development/testing

Configuration

Update the REVENUECAT_PROJECT_ID constant in /backend/index.ts with your actual RevenueCat project ID.

Authentication

All API endpoints (except /health) require authentication via the Authorization header:

Admin Access

Authorization: Bearer YOUR_ADMIN_ACCESS_KEY

Customer Access

Authorization: Bearer CUSTOMER_ID

or

Authorization: Customer CUSTOMER_ID

The API will verify the customer has active entitlements via RevenueCat before allowing access.

Endpoints

POST /api/speech

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)"
}

GET /health

Health check endpoint that returns the service status.

Response:

{
  "status": "ok",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Configuration

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.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.