Realtime API: Is function call output stored and count towards token usage?

Hello,

I have a question regarding to function calling in Realtime API.

After calling a function, we send the result back to the agent:

event = {
            "type": "conversation.item.create",
            "item": {"type": "function_call_output", "call_id": call_id, "output": result},
        }
await websocket.send(json.dumps(event))

In the above, result is the result of this function call. For web search for example, this is typically a very long string (containing the content of several websites for example), so I’m wondering if it is stored on the server (in the case of Realtime API) and counts towards the token usage.

Thank you in advance for your replies!

All data used counts as tokens for each API call. The base model that this functionality sits on top of is “stateless” i.e. it has no memory of past events and you need to send everything the model should use as context each time.

Thanks @Foxalabs.
The Realtime API is actually stateful (hence the question).