New Realtime API voices and cache pricing

Are you using someone else’s idea of a typescript library for interacting with realtime? It may have hard-coded allowed values of the past. The same fault as OpenAI’s library - immediately obsolete forever by trying to validate inputs.

You cannot change a voice once a session has been initiated. It is likely equivalent to an initial prompt injection to make the AI follow the response pattern.

1 Like

You can easily circumvent this by coercing the type.

type asdf = "abc" | "def";
const a = "abcd" as asdf;

No fault here. It’s now very easy to know that asdf has been prepared to use a subset of strings, instead of crossing fingers. This is just a very simplified enum.

2 Likes

This is clearly a TypeScript error, which has everything to do with the client you chose to use, and has nothing to do with the actual API itself.