Gpt-realtime api 401 unauthorized

I am using gpt-realtime API and it works for 2-3 times before it starts returning 403 Unauthorized error. Note that I am using ephermal key as the Bearer for the realtime endpoint that I get from the session endpoint.

One strange thing is that if I create a new API KEY and use it in the code, it again works for 2-3 times and then starts returning 403 Unauthorized.

I am having difficulty understanding this weird behavior. Note that I have no limits set and have enough balance in my account.

What must be causing this issue?

Same issue man have you found a solution?

Hi and welcome to the dev forum @Vivek7405

Ephemeral keys, as the name suggests, are short lived i.e. they are designed to expire after a short duration.

They are meant to be minted new per session.

2 Likes

Thanks man, indeed that was the issue. You saved my day!

1 Like