Routing

Smart Routing

Overview

(Beta) The slng.ai platform now supports Smart Routing, a powerful beta feature that automatically selects the most relevant Text-to-Speech (TTS) model for your request — based on your preferences, usage context, and regional requirements.

This allows developers to simply call the base endpoint (/tts) and let our routing engine handle the complexity of model selection, quality optimization, and compliance.

Key Features

  • Automatic Model Selection
  • Org-Level Preferences
  • Request-Based Overrides
  • Quality Score Ranking
  • Pricing Limit Per Transaction Type
  • Cloning Support Routing
  • Low-Latency Regional Execution

How It Works

When a request is sent to:

Code(bash)
POST https://api.slng.ai/tts

Our system will automatically:

  1. Parse your org-level preset (e.g. default region, model types, compliance tags).
  2. Consider request-specific arguments (e.g. language, region, voice cloning, pricing limits).
  3. Score available models using a live quality score.
  4. Route the request to the best available model for the job.
  5. Return the synthesized voice output.

Example Request

Code(json)
POST /tts Content-Type: application/json { "text": "Welcome to slng.ai smart routing!", "language": "en-US", "region": "EU", "pricing_limit_per_request": 0.002, "enable_cloning": true }

Sample cURL

Code(bash)
curl -X POST https://api.slng.ai/tts \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "Hello from slng smart routing", "language": "en-US", "region": "us-west", "enable_cloning": true, "pricing_limit_per_request": 0.003 }'

Request Parameters

FieldTypeDescription
textstringThe text you want to convert to speech
languagestringPreferred language/dialect code (e.g., en-US, es-ES)
regionstringPreferred execution region (e.g., EU, us-west)
pricing_limit_per_requestfloatOptional price cap per request (in USD) by transaction type (e.g., TTS)
enable_cloningbooleanWhether cloned voice models can be used (if available)

Smart Routing Logic

The routing engine uses the following priorities:

  1. Org-level preferences (set in the dashboard)
  2. Request parameters (language, region, cloning)
  3. Live quality scores (model reliability and latency)
  4. Pricing limits per transaction type (if specified)
  5. Availability (GPU pool, load)

Benefits

  • 🔧 No manual model selection needed
  • ⚡️ Low latency via closest region
  • 🎯 Cloning support where relevant
  • 💵 Price control via per-request pricing limits
  • Enterprise-grade fallback options

Limitations (Beta)

  • Routing logic is still being tuned; feedback is welcome
  • Not all regions support all cloning models
  • Quality scoring is currently heuristic-based and evolving


Last updated: June 2025

Last modified on