🔌 API

All browser calls go through authenticated SvelteKit routes on https://elv3.loca.zone; server routes call ElevenLabs and optional OpenRouter APIs with runtime-only secrets.

🔐 Auth

  • GET /auth: password form.
  • POST /auth: validates the configured UI password.
  • cookie: eleven3_auth, HttpOnly, HMAC-signed timestamp.
  • max_age: 30 days.
  • workspace: every non-auth route redirects to /auth without a valid cookie.

🚦 Limits

  • scope: /api/elevenlabs/*.
  • policy: 30 requests per minute per auth cookie.
  • failure: HTTP 429 JSON plus Retry-After: 60.

🎤 Voices

  • route: GET /api/voices.
  • upstream: ElevenLabs /v2/voices.
  • query: search, page, page_size.
  • response: upstream voice list and pagination metadata.
  • operator_check: authenticated GET /api/voices?page_size=1 should return at least one voice.

🗣️ Speech

  • route: POST /api/elevenlabs/tts.
  • streaming: add ?stream=true.
  • required: voice_id, text.
  • optional: model_id, output_format, speed, voice_settings.
  • default_model: eleven_v3.
  • output: audio stream with audio content type.

👥 Dialogue

  • route: POST /api/elevenlabs/dialogue.
  • streaming: add ?stream=true.
  • body: non-empty dialogue array of { voice_id, text } rows.
  • upstream_transform: browser dialogue becomes ElevenLabs inputs.

💥 SFX

  • route: POST /api/elevenlabs/sfx.
  • upstream: /v1/sound-generation.
  • required: text.
  • optional: duration_seconds, prompt_influence.
  • output: MP3 attachment named with an sfx_ timestamp.

🎨 Design

  • route: POST /api/elevenlabs/voice-design.
  • design: default action creates previews with eleven_ttv_v3.
  • save: ?action=save creates a voice from a selected preview.
  • optional_enrichment: OpenRouter labels/descriptions when configured; absence is non-fatal.

🧯 Failures

  • invalid request fields return 400.
  • missing runtime API keys return 500 without exposing secret values.
  • upstream provider errors should preserve useful status/error text where safe.