POST /api/speech/generate
Generate speech audio from text
POST
Authentication
Not Required: No[Authorize] attribute
Public endpoint
Request Body
Text to convert to speechValidation (Lines 22-30):Constraints:
- MUST NOT be null
- MUST NOT be empty string
- Max length not enforced by controller (Groq API limits apply)
Voice identifierDefault (Line 34):
"Celeste-PlayAI" if not providedValidation: None in controllerInvalid voice: Error behavior not enforced by server contract (service-level validation)Response Format
Content-Type:audio/wav (Line 36)
Content-Disposition: attachment; filename="speech.wav" (Line 36)
Binary Data: WAV audio file bytes (Line 36)
No JSON: Success response is binary audio, not JSON
Side Effects
External API Call (Line 34):- Calls Groq text-to-speech API
- API endpoint not documented in controller
- Authentication via Groq API key (service-level)
Authorization
Public Access: No authentication required Security Risk: Anyone can generate speech- No rate limiting documented in controller
- Groq API rate limits apply
Permissions
Who Can Generate: Anyone (unauthenticated access allowed) Abuse Potential: Public endpoint could be rate-limited at infrastructure levelEdge Cases
- Null text: 400 error (Lines 22-30)
- Empty text: 400 error (Lines 22-30)
- Null voice: Uses default
"Celeste-PlayAI"(Line 34) - Invalid voice: Service-level error (not enforced by server contract)
- Very long text: Groq API limits apply (not enforced by controller)
- Special characters: Passed to Groq as-is
Error Conditions
| Code | HTTP | Cause | Controller Line |
|---|---|---|---|
INVALID_REQUEST | 400 | Text null or empty | 22-30 |
| N/A | 500 | Groq API error | 38-45 |
| N/A | 500 | Network timeout | 38-45 |
Behavioral Guarantees
Idempotency: YES- Same text + voice = same audio output
- Safe to retry
Performance Characteristics
Response Time: Not guaranteed by API contract- Implementation-defined (depends on Groq API)
- Text length correlation not enforced by server contract
Groq TTS Integration
Service (Line 11):GroqService
Method (Line 34): GenerateSpeechAsync(text, voice)
Voice Options: Not documented in controller
- Default:
"Celeste-PlayAI" - Other voices not enforced by server contract (Groq API-dependent)
Audio Format
Format: WAV (Line 36) Encoding: Not specified by API contract (Groq default) Sample Rate: Not specified by API contract Channels: Not specified by API contractRate Limiting
Controller: None Groq API: Subject to Groq rate limits- Free tier: Limited requests/minute
- Paid tier: Higher limits
Use Cases
Text-to-Speech:- Convert chat responses to audio
- Accessibility features
- Voice assistants
- Generate audio announcements
- Create voice messages
Security Implications
Public Endpoint: No authentication- Could be abused for free TTS generation
- Should implement rate limiting at infrastructure level
- No PII validation
- Groq’s data retention policies apply
- No user attribution
- No quota enforcement in controller