AI Endpoints - Speech to Text with the Gladia API
Transcribe live audio with Solaria-3 using the Gladia API and official SDKs on OVHcloud AI Endpoints, from session setup through final results
AI Endpoints is covered by the OVHcloud Public Cloud Special Conditions (see Appendix 10 – "Specific Conditions – AI Endpoints").
Objective
On AI Endpoints, use solaria-3 to transcribe live audio with the Gladia Live V2 API. The native API provides partial transcripts, final utterances and speaker labels. This guide covers session creation, audio transmission, completion and result retrieval using HTTP, WebSockets and the official Gladia SDKs.
The live solaria-3 availability described here applies to AI Endpoints; model availability may differ on Gladia SaaS.
For file transcription using the OpenAI-compatible API, see Speech to Text with the OpenAI-compatible API.
Requirements
- An AI Endpoints API key, created following Getting Started.
- A short audio recording.
- Python or Node.js for the optional SDK examples.
- For the raw protocol: cURL,
jqand a WebSocket client. - Optionally, FFmpeg to convert an existing file for the examples.
Endpoint and Authentication
Use your AI Endpoints API key, not a Gladia SaaS API key.
For native /gladia/* requests, authenticate with either x-gladia-key: <token> (supported for compatibility with the official Gladia SDKs) or the standard AI Endpoints Authorization: Bearer <token> header. For anonymous requests, omit both headers. The native API base is $AI_ENDPOINTS_BASE_URL/gladia, without /v1.
With an SDK, set its api_key (Python) or apiKey (JavaScript) to your AI Endpoints API key. The SDK sends it as x-gladia-key; no custom authorization header or placeholder key is needed.
Official SDK Examples
These examples create a session, send a short local recording at real-time pace, stop recording, wait for completion and poll the final result with a deadline. The finite timeouts are client choices, not service duration allowances. They use English source audio; adjust language_config to match your recording's language.
Prepare Audio for These Examples
For simplicity, these examples use 16 kHz, 16-bit mono PCM. This is not the only supported audio format: the session's encoding, sample rate, bit depth and channel count must match the audio you send. Python reads a WAV container; Node.js reads headerless PCM.
If needed, convert an existing recording with FFmpeg. Choose the output for your example:
Install the official gladiaio-sdk package in your Python environment:
Use a PCM 16-bit mono WAV file named audio.wav:
Always clean up a failed or abandoned session. Before retrying session creation, check whether the previous request created a session; extra sessions consume concurrency.
Native Live Protocol
1. Create a Session
This example uses 16 kHz, signed little-endian 16-bit mono PCM. Set language_config to match your audio's language; the example uses English.
Specify model: "solaria-3" explicitly in every session creation request rather than relying on the default model. Specify the format of your audio: encoding, sample rate, bit depth and channel count must match the samples you send.
A successful response is 201 and includes id and url. The returned WebSocket URL is signed: keep it unchanged and treat it as a credential. Do not log the response, URL, or SDK errors that might contain it. Do not add /gladia or /v1 to that URL.
2. Send Audio and Receive Events
Connect a WebSocket client to WEBSOCKET_URL, or use an SDK example above, which creates its own session. For the configuration above:
- Send audio as binary WebSocket messages in the encoding declared when creating the session. These examples send raw PCM samples, not a WAV container or compressed MP3 bytes; Python's
wavemodule reads the WAV container and sends only the PCM samples. - Pace audio at approximately real time. For example, 3,200 bytes represent 100 ms at 16 kHz, 16-bit mono.
- Read events concurrently with audio transmission. For
type="transcript", inspectdata.is_finalanddata.utterance.text. Partial transcripts can change: update the existing transcript with the samedata.idinstead of appending duplicates. - Once all audio has been sent, send the text message
{"type":"stop_recording"}. Continue reading until post-processing finishes and the socket closes. A final utterance is not the end of the session. Do not close the socket immediately after stopping the recording.
The Gladia live quickstart describes the raw protocol. The service restrictions in this guide take precedence over examples for Gladia SaaS.
3. Retrieve the Result
After completing the session above, retrieve its result using the same AI Endpoints API key:
The result status is one of queued, processing, done or error. If it is queued or processing, poll again with a delay and a finite deadline. Successful completion is done; stop and handle a failure if the status is error. The failed boolean in session details is not a result status. The completed transcript is in result.transcription.full_transcript.
Results are isolated by authenticated project or anonymous IP. Reuse an API key from the same project, or the same IP for anonymous access. An inaccessible or unowned resource returns 404.
Audio Intelligence
Explicitly set "model": "solaria-3" when creating a session: SDKs may default to another model, such as solaria-1. The features below are available through the native live API. audio_to_llm and summarization remain unsupported.
Configure Features and Read Their Results
Merge enabled features into a single realtime_processing object, using the field paths below. Native diarization and diarization_config remain top-level fields, as shown in Diarization and Latency. With Python SDK 2.2 or later, use a plain dictionary for Enterprise fields not represented by the typed initializer.
For example, merge these translation settings into the session creation body to translate the source audio into French:
Enable messages_config.receive_realtime_processing_events: true to receive audio-intelligence events, and keep receive_final_transcripts: true. Feature events can arrive after their source transcript; keep reading until the session ends. Apply feature configuration when creating a new session.
For concepts and configuration details, see Gladia Audio Intelligence. Some upstream examples cover pre-recorded transcription or Gladia SaaS: use the native live field placement and service restrictions in this guide. Render transcript/entity content as untrusted text, not HTML, and avoid logging personal data when using PII masking.
Diarization and Latency
Diarization assigns speaker labels to the transcript. For native live requests, add "diarization": true at the top level, optionally with "diarization_config": {"min_speakers": 2, "max_speakers": 4}. Use mono audio; speaker-count settings are hints, not guarantees.
With gladiaio-sdk>=2.2, pass a plain Python dictionary to live.start_session() to send the Enterprise diarization fields absent from LiveV2InitRequest. JavaScript accepts the same fields in the object passed to live.startSession().
In the Python SDK example above, replace the session initialization and the on_message function with the following code. Keep the rest of the example unchanged:
The SDK example above handles audio pacing and waits for final results after stop_recording(). Do not pass diarization as a keyword to the typed initializer.
Diarization distinguishes voices, not real-world identities, and increases processing latency, especially for final results. Word-level speaker labels are more precise than a single utterance label when several speakers occur in an utterance.
Quotas and Errors
The native live limit is the wall-clock session duration, measured from session creation with POST /gladia/v2/live, not from opening the WebSocket and not from the amount of audio sent. For example, opening an anonymous session's WebSocket 20 seconds after creation leaves only 40 seconds for streaming audio. At expiry, the service gracefully stops recording with stop_recording, allowing final transcripts to be produced. The client must stop sending audio and keep reading until processing finishes and the socket closes.
maximum_duration_without_endpointing controls when an utterance is finalized; it does not change the session duration limit. Users behind one NAT share an anonymous identity. Several API keys in one project do not create separate project quotas. Closing a live session releases its concurrency slot; result GET requests do not create sessions.
Native multi-channel usage is measured as audio duration multiplied by channel count.
Current Service Restrictions
Only the live routes listed here are available, not the full Gladia API.
Troubleshooting
Start with short audio samples.
Go Further
- AI Endpoints - Speech to Text with the OpenAI-compatible API
- AI Endpoints - Getting Started
- Gladia live quickstart — protocol reference, subject to the restrictions above.
Feedback
Share questions and feedback on the OVHcloud Discord server, in the #ai-endpoints channel.
Join our community of users.