Is there a way to close a session with the Realtime API?
For example, I want to talk with a agent using the Reatime API for 15 mn. After the delay: close the session automatically.
Is there a way to close a session with the Realtime API?
For example, I want to talk with a agent using the Reatime API for 15 mn. After the delay: close the session automatically.
Is this WebRTC or sockets?
The session is in your control especially with websockets(if properly implemented) by setting timeouts in both client and server side code.
However with WebRTC, you need to set the expires_at
config for the client_secret
for the session.
Also, since the connection is directly between the OpenAI API and the client, when using WebRTC , the only way to automatically terminate it is to set the timeout logic in the client side code to close the session upon timeout.
Thank you for the idea to add a “expires_at” parameter.