All API requests to SM-AI-MODELS must be authenticated using an API key. This ensures only authorized clients can access the Text-to-Speech and Speech Recognition services.
On-Premise Deployments: If your instance is deployed within a private network without authentication enabled, you may skip API key headers. Check with your system administrator.
API Key
Include your API key in the Authorization header of every request:
Code
Authorization: Bearer YOUR_API_KEY
Alternatively, you can use the X-API-Key header:
Code
X-API-Key: YOUR_API_KEY
Obtaining Your API Key
Contact your Unicode Solutions account manager or system administrator to receive your API credentials. Each API key is scoped to your organization and may include:
Rate limit tier — Determines requests per minute
Service access — TTS only, ASR only, or both
Voice access — Which voices are available to your key
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key. Include your key in the Authorization header.", "request_id": "req_abc123" }}
gRPC Authentication
For gRPC connections, pass the API key as metadata:
Code
import grpcmetadata = [('authorization', f'Bearer {API_KEY}')]channel = grpc.insecure_channel('YOUR_HOST:50051')# Include metadata in every RPC callresponse = stub.Synthesize(request, metadata=metadata)