[Realtime API] Client-generated event_id not being persisted

Hi,

As per the docs client events like “response.create”, allow for the setting of a client-generated “event_id”, which is useful for correlating responses with our business logic, but the API seems to be ignoring the custom “event_id” I send and instead it always default to creating a random one server-side.

I’ve attached a screenshot of the docs where it specifies the “event_id” property for the specific event I need (“response.create”). I’ve tried having my custom IDs follow a specific format, namely being prefixed with “event_” but to no avail.

Has anyone been able to use the “event_id” property and have it be echoed back from the server?

Thanks.

3 Likes

did you find a fix for this issue ?

Use metadata property to add your custom data like

const event = {
  type: "response.create",
  response: {
   

    // Set metadata to help identify responses sent back from the model
    metadata: { topic: "classification" },
    
    // Set any other available response fields
    modalities: [ "text" ],
    instructions: prompt,
  },
};