# Trouble Loading Previous Messages with Realtime API

**URL:** https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576
**Category:** API
**Tags:** realtime
**Created:** [December 10, 2024, 11:59pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576 "2024-12-10T23:59:17Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![ibiscp](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ibiscp/32/472115_2.png) [@ibiscp](https://community.openai.com/u/ibiscp)
#### Post date: [December 10, 2024, 11:59pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/1 "2024-12-10T23:59:17Z")

</div>

Hi everyone,

I’m having trouble loading previous messages into the Realtime API. Has anyone successfully managed to do this?

Here’s the sequence of events I’m sending:

```json
{
  "type": "session.update",
  "session": {
    "modalities": ["text", "audio"],
    "instructions": "Assist the user.",
    "voice": "ash",
    "input_audio_format": "pcm16",
    "output_audio_format": "pcm16",
    "input_audio_transcription": {"model": "whisper-1"},
    "turn_detection": null,
    "temperature": 0.8
  }
}
{
  "type": "conversation.item.create",
  "item": {
    "type": "message",
    "status": "completed",
    "role": "system",
    "content": [{"type": "input_text", "text": "Say hi to the user."}]
  }
}
{
  "type": "conversation.item.create",
  "item": {
    "type": "message",
    "status": "completed",
    "role": "assistant",
    "content": [{"type": "text", "text": "Hello, how can I assist you today?"}]
  }
}
{
  "type": "conversation.item.create",
  "item": {
    "type": "message",
    "status": "completed",
    "role": "user",
    "content": [{"type": "text", "input_text": "Hello, can you tell me a joke?"}]
  }
}
{
  "type": "conversation.item.create",
  "item": {
    "type": "message",
    "status": "completed",
    "role": "system",
    "content": [{"type": "input_text", "text": "The user interupted the conversation, continue from where you stopped."}]
  }
}

```

After this I send a `response.create` message:

```json
{
    "type": "response.create", "response": {"modalities": ["text", "audio"]},
}

```

The issue I’m experiencing is that sometimes I only get text responses without audio, or I encounter errors for some messages. I’ve been unable to get it working reliably.

If anyone has insights, tips, or a working example, I’d greatly appreciate your help!

Thanks in advance!

---

<div class="post-metadata">

### Author: ![j0rdan](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/j0rdan/32/487316_2.png) [@j0rdan](https://community.openai.com/u/j0rdan)
#### Post date: [December 11, 2024, 8:18am UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/2 "2024-12-11T08:18:14Z")

</div>

> [@ibiscp](#):
>
> ```auto
> {
> "type": "conversation.item.create",
> "item": {
> "type": "message",
> "status": "completed",
> "role": "user",
> "content": [{"type": "text", "input_text": "Hello, can you tell me a joke?"}]
> }
> }
> 
> ```

When role is `user`, your content part type must be`input_text`. Also the other key must be `text` instead of `input_text`:

```auto
[{"type": "input_text", "text": "Hello, can you tell me a joke?"}]

```

Also, make sure to catch and log any `error` event you receive as it’s very easy to miss them.

> [@ibiscp](#):
>
> sometimes I only get text responses without audio

That is a known issue, I haven’t been able to get it to work reliably either. The model tends to drop out of voice mode when you construct the conversation history with text messages.  
One thing you could do, is to get the model to generate a summary of the conversation at the end of a session and send that in your next session. This is a gimmicky workaround though. It only works when the conversation ends gracefully (e.g. you don’t get disconnected from the session). It might help you get started until we get an official fix for this.

---

<div class="post-metadata">

### Author: ![ibiscp](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ibiscp/32/472115_2.png) [@ibiscp](https://community.openai.com/u/ibiscp)
#### Post date: [December 11, 2024, 4:55pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/3 "2024-12-11T16:55:23Z")

</div>

You are right, that was an error while writing the question here, in my code it is correct.

Do we have any contact with OpenAI team regarding this issue?

---

<div class="post-metadata">

### Author: ![edwinarbus](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/edwinarbus/32/455108_2.png) [@edwinarbus](https://community.openai.com/u/edwinarbus)
#### Post date: [December 12, 2024, 5:40pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/4 "2024-12-12T17:40:47Z")

</div>

Sorry about this. This is a bug we’re currently looking into (reminder, the Realtime API is still in beta 😅). One workaround is to **add an audio message** as your first user message, before the other history, which might help coax the model to respond with audio as well.

---

<div class="post-metadata">

### Author: ![ibiscp](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ibiscp/32/472115_2.png) [@ibiscp](https://community.openai.com/u/ibiscp)
#### Post date: [December 12, 2024, 8:08pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/5 "2024-12-12T20:08:49Z")

</div>

Thank you for your response! I gave that approach a try by adding a 1-second silent audio as a user message before the others, but unfortunately, it didn’t work. I believe the best solution would be the one suggested by @j0rdan summarizing the previous conversation and including it as context.

---

<div class="post-metadata">

### Author: ![Foxalabs](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/foxalabs/32/738355_2.png) [@Foxalabs](https://community.openai.com/u/Foxalabs)
#### Post date: [December 12, 2024, 8:42pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/6 "2024-12-12T20:42:50Z")

</div>

Can confirm this works in a couple of use cases I am involved with!

---

<div class="post-metadata">

### Author: ![j0rdan](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/j0rdan/32/487316_2.png) [@j0rdan](https://community.openai.com/u/j0rdan)
#### Post date: [December 16, 2024, 9:58am UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/7 "2024-12-16T09:58:48Z")

</div>

Thanks for the clarification. I tried your suggested workaround, but it doesn’t work reliably (I saw it work a couple of times, but nowhere near a reliable amount of times to make it viable).  
If the conversation history is quite long, there will be a lot of assistant messages of type `text`, which I think misguides the model to respond with text from that point onward.  
Looking forward to any further updates on this.

---

<div class="post-metadata">

### Author: ![killiandunne](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/killiandunne/32/539605_2.png) [@killiandunne](https://community.openai.com/u/killiandunne)
#### Post date: [January 20, 2025, 8:39pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/8 "2025-01-20T20:39:51Z")

</div>

Hey any update here? This has caused me literal days of frustration - any suggestions or fixes would be hugely appreciated

---

<div class="post-metadata">

### Author: ![ibiscp](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ibiscp/32/472115_2.png) [@ibiscp](https://community.openai.com/u/ibiscp)
#### Post date: [January 21, 2025, 6:28pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/9 "2025-01-21T18:28:22Z")

</div>

I tried it today again and it is still not working.

---

<div class="post-metadata">

### Author: ![dima7711](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/dima7711/32/613108_2.png) [@dima7711](https://community.openai.com/u/dima7711)
#### Post date: [May 16, 2025, 9:14am UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/10 "2025-05-16T09:14:44Z")

</div>

The bug still exists. Are there any plans to fix it?

---

<div class="post-metadata">

### Author: ![alexred20](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/alexred20/32/388536_2.png) [@alexred20](https://community.openai.com/u/alexred20)
#### Post date: [June 24, 2025, 7:35pm UTC](https://community.openai.com/t/trouble-loading-previous-messages-with-realtime-api/1050576/11 "2025-06-24T19:35:24Z")

</div>

@edwinarbus any progress on fixing this? It was highlighted 6 months ago and completely breaks the calls in our app. It happens frequently across our userbase. We’ll attempt a workaround but it’s far from ideal. FYI we use the mini model as standard is too expensive.
