For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Ask AIPlaygroundLoginFree API Key
HomeAPI ReferenceVoice AgentSpeech-to-TextText-to-SpeechIntelligenceSelf-Hosted Deployments
HomeAPI ReferenceVoice AgentSpeech-to-TextText-to-SpeechIntelligenceSelf-Hosted Deployments
  • Get Started
    • Overview
    • Build a Voice Agent
    • Feature Overview
    • Template Apps
  • Configure
    • Overview
    • STT Models
    • LLM Models
    • TTS Models
    • Media Inputs & Outputs
    • Prompting Voice Agents
    • Multilingual Voice Agents
    • Maintaining Context
    • Reusable Agent Configurations
  • Build
    • Multi-Agent Architecture
  • Connect
  • Controls
      • Overview
      • Settings
      • Update Speak
      • Update Think
      • Update Prompt
      • Inject Agent
      • Inject User
      • Agent Keep Alive
  • Optimize
    • Voice Agent TTS Controls
    • Message Flow
    • Audio & Playback
    • Audio Preprocessing & Barge-In
    • Adaptive Echo Cancellation
  • Resources
    • SDKs
    • UI Components
    • API Reference
LogoLogo
Ask AIPlaygroundLoginFree API Key
On this page
  • When to use it
  • Example payload
ControlsInputs: Client Messages

Agent Keep Alive

Send periodic KeepAlive messages to prevent the WebSocket from timing out during long silences.

Was this page helpful?
Previous

Outputs: Server Events

Server messages you will receive from the Agent server.
Next
Built with
Voice Agent

KeepAlive is a JSON message you send to the server to keep an idle WebSocket open. The server closes connections that go silent, so when you stop streaming audio for an extended period, send KeepAlive to hold the session.

Most agent conversations do not need KeepAlive. You will normally stream microphone audio continuously so the user can speak at any moment.

When to use it

Send KeepAlive only during a period when the client is not sending audio. While idle, send one KeepAlive every 8 seconds.

Example payload

JSON
1{
2 "type": "KeepAlive"
3}

The server does not respond to KeepAlive.