Talk with the OpenAI Realtime API by voice or text from TurboWarp, and let the model call functions written in blocks. The API key stays in a localhost relay.
Before you start
Start @kubohiroya/capability-proxy on 127.0.0.1 with the openai provider configured. Note the eight-digit pairing code it prints.
configure local relay [http://127.0.0.1:8787]
pair local relay with one-time code [12345678]
connect to Realtime with microphone [on]
send text [Hello!]
when assistant finishes responding
say (last assistant response)
Functions as tools
Write a define function script and choose export as tool. NAME, DESCRIPTION, and the JSON args schema must be typed directly into the hat. When the model calls the tool, read arguments with function argument and send the result with return.
define function [get_score] description [Returns the player's score.] args schema [{"type":"object","properties":{}}] export as [tool]
return (join [{"score":] (join (score) [}]))
Safety
The relay endpoint must be a loopback address. The relay token and ephemeral keys are kept in memory only.
The model chooses the arguments of exported functions. Treat them as untrusted input.
All 25 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.
configure local relay [ENDPOINT]
Sets the loopback origin of the local capability-proxy relay. Clears any previous pairing.
Block type: COMMAND. Opcode: configureRelay. Permanent link
Argument
Type
Default value
Menu choices
ENDPOINT
STRING
http://127.0.0.1:8787
pair local relay with one-time code [CODE]
Exchanges the eight-digit code printed by the relay for a session token kept only in memory.
With a compatible TurboWarp GUI, enable fixed-input forms to edit only standard literal fields. Numbers use complete finite JSON number tokens; menu fields use existing choices. Connected reporters and unavailable fields stay read-only and are never evaluated. Saving an unchanged form preserves exact existing raw values, including legacy spellings and unknown choices. Invalid drafts stay in the same editing session; cancel, project/target replacement, or block removal discards them. Disabling the GUI feature flag restores native field editing. This form does not run blocks, open network/audio/key/QR sessions, resolve names, or edit Schema arguments.