Realtime API: “Tool call ID … not found in conversation” after sending function_call_output via response.create

I’m experimenting with the Realtime API (text-only, gpt-4o-mini-realtime-preview).

My flow is roughly:

  1. I receive response.function_call_arguments.done
{
  "type": "response.function_call_arguments.done",
  "name": "add",
  "call_id": "call_I63LY4m3iJCJ6g4H",
  "arguments": "{\"a\":2,\"b\":3}"
}
  1. I execute the tool locally (2 + 3 = 5).

  2. I try to send the result and ask the model for the next assistant response in one WebSocket message:

{
  "type": "response.create",
  "response": { 
    "modalities": ["text"],
    "input": [
      {
        "type": "function_call_output",
        "call_id": "call_I63LY4m3iJCJ6g4H",
        "output": "{\"result\":5}"
      }
    ]
  }
}
  1. The server immediately replies:

error
Tool call ID ‘call_I63LY4m3iJCJ6g4H’ not found in conversation.

Things to note

  • I temporarily commented out all session.update / session.updated handling to see whether the call_id issue was session-related. Likewise, after routing to a different agent I skipped the extra session.update as a test to check if the session state was influencing the call_id pairing.

  • If I revert to the classic two-step flow

(1) conversation.item.create with function_call_output, then

(2) separate response.create,

everything works—so the tool call ID is valid in the server’s history.

Questions

  1. Is there a minimal, working example of sending function_call_output in a single response.create message?
  2. Does skipping session.update after switching agents invalidate the conversation state in a way that breaks tool-call pairing?

Any pointers or sample payloads would be greatly appreciated!

Thanks in advance.