Create a realtime client secret
Creates a short-lived client secret for opening a
Realtime Voice API session from a web page. Call this
endpoint from your server with your API key, then give the returned
value and url to the page. The page never receives your API key.
The page opens url with two WebSocket subprotocols,
empirio.realtime.v1 and empirio-token.<value>:
A client secret works only for the model it was created for. It can
open sessions until expires_at, and a session that is already open
continues after that time. Sessions bill to your account and appear in
usage under the API key that created the secret. Deactivating or
deleting that key stops its client secrets from opening new sessions.
Creating a client secret counts as one request toward your account
rate limit.
Authentication
Pass your EmpirioLabs API key as a bearer token. The Anthropic-style
x-api-key header is also accepted on every endpoint.
Request
The realtime model the secret is for. Required unless session.model is set.
Accepted for clients that send the model as session.model. Other session settings are refused here; the page sends them in a session.update event after the socket opens.
Response
The client secret. The page offers it as the empirio-token.<value> subprotocol.
The session the secret is for: a realtime session with its model, or, for a live transcription model, a transcription session with the model in audio.input.transcription.model. Send the session settings in a session.update event after the socket opens.
