Add a speech service of your own
Adds a voice or transcriber you run. kind: openai_compatible_voice is an endpoint that answers OpenAI's /audio/speech at an https base URL (a voice only). kind: custom_speech is your own service over VoiceLayer's WebSocket protocol at a wss:// address (voice, transcriber or both). The address has to be public: a private or internal address is refused with endpoint_url_unsafe. A custom service's signing secret is in the answer once; keep it, your service uses it to check that a call comes from VoiceLayer. Then name the connection's id as connectionId on an agent's voice or transcriber.
Requires an API key with the workspace:write scope.
apiKeyAuthorizationBearer <token>A secret API key from the dashboard (Developers → API keys): vl_live_…, or vl_test_… for test mode. Each operation says which scope the key needs.
application/json- body
kind*stringOne of openai_compatible_voice, custom_speech.
"openai_compatible_voice""custom_speech"name*stringA name for the connection.
secret*stringThe key or bearer secret the service expects. Stored encrypted and never returned.
url?stringcustom_speech: the wss:// address of your service
baseUrl?stringopenai_compatible_voice: https base URL; /audio/speech is appended
model?stringopenai_compatible_voice: the model name the endpoint expects (default tts-1)
voices?array<string>openai_compatible_voice: the voice names the endpoint offers
languages?array<string>The languages the service covers, for example gu-IN; without them coverage is unknown
region?stringWhere the service processes speech, in your own words; the workspace speech region reads it
"in""eu""us"reportsLanguage?booleancustom_speech: whether the transcriber says the language it heard
budgets?custom_speech: how long a first result or first audio may take, up to 15 seconds
The connection; a custom service's signing secret is in the answer once
application/json- response
connection*signingSecret?stringcurl -X POST https://api.vlayers.ai/v1/connections/speech \ -H "Authorization: Bearer $VOICELAYER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "kind": "custom_speech", "name": "Our Gujarati speech service", "url": "wss://speech.example.com/vl", "secret": "a-long-random-secret", "languages": [ "gu-IN", "hi-IN" ], "region": "in" }'{ "connection": { "id": "0e9d8c7b-6a5f-4e3d-8c1b-0a9f8e7d6c5b", "name": "Our Gujarati speech service", "provider": "custom-speech", "status": "active", "metadata": { "kind": "custom_speech", "baseUrl": "wss://speech.example.com/vl" } }, "signingSecret": "vlss_0000000000000000000000000000000000000000000000"}