Routing
Cost Controls
Overview
(Beta)
slng.ai now supports Cost Caps, allowing developers to control the maximum amount they spend per TTS or STT transaction. This feature is ideal for teams managing budget-sensitive applications, pay-as-you-go systems, or building on behalf of customers with tiered usage.
You can set a pricing_limit_per_request
value in your API call, and our Smart Routing engine will automatically select the best available model within your defined cost ceiling.
Key Features
- Per-Request Cost Control
- Org-Level Defaults Coming Soon
- Smart Routing + Cost Filtering
- Works with All Supported Models
- Protects Against Unexpected Overages
How It Works
When you include a pricing_limit_per_request
value in your request, slng.ai will:
- Filter out all models whose estimated per-request cost exceeds your limit.
- Score the remaining models based on quality, latency, and regional fit.
- Execute using the best model that fits within the cap.
- If no models qualify, return a graceful error.
Example Request
Code(json)
Sample cURL
Code(bash)
Request Parameters (Cost Caps)
Field | Type | Description |
---|---|---|
pricing_limit_per_request | float | The maximum amount (in USD) you're willing to spend for this request. |
Use Cases
- 💸 Budget-Constrained Apps: Stay under a predictable spend per user or transaction
- 🧪 Experimentation: Test cheaper models without sacrificing user experience
- 💼 Reseller Mode: Offer tiered pricing to your own users based on request limits
Behavior
- If your cost cap is too low, your request will return:
Code(json)
-
If Smart Routing is used with a cost cap, it will rank models within the cap only.
-
If combined with regional routing, both filters apply.
Limitations (Beta)
- Costs are estimated and may vary slightly based on response length
- Cloning may increase cost and reduce availability under strict caps
- No support yet for monthly or org-level spend caps (coming soon)
Quick Links
Last updated: June 2025
Last modified on