Authenticate with a temporary token
Authenticate with a temporary token
If you need to authenticate on the client, you can avoid exposing your API key by using temporary authentication tokens. You should generate this token on your server and pass it to the client.
Python SDK
Python
JavaScript SDK
JavaScript
To generate a temporary token, call StreamingClient.create_temporary_token()
.
Use the expires_in_seconds
parameter to specify the duration for which the token will remain valid. Optionally, use the max_session_duration_seconds
parameter to specify the desired maximum duration for the session started using this token.
expires_in_seconds
must be a value between 1
and 600
seconds. If specified, max_session_duration_seconds
must be a value between 60
and 10800
seconds (defaults to maximum session duration of 3 hours).The client should retrieve the token from the server and use the token to authenticate the transcriber.
Each token has a one-time use restriction and can only be used for a single session. Any usage associated with a temporary token will be attributed to the API key that generated it.
Python SDK
Python
JavaScript SDK
JavaScript
To use it, specify the token
parameter when initializing the StreamingClient
.