***

title: ai_hold
slug: /reference/python/relay/call/ai-hold
description: Put an AI agent session on hold.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ai-unhold]: /docs/server-sdks/reference/python/relay/call/ai-unhold

Put an active AI agent session on hold. The AI stops processing conversation
while the call remains active. The caller may hear hold music or silence
depending on the configuration.

<Info>
  Use [`ai_unhold()`][ai-unhold] to resume the AI session.
</Info>

## **Parameters**

<ParamField path="timeout" type="Optional[str]" toc={true}>
  Maximum hold duration. The AI session automatically resumes after this timeout.
</ParamField>

<ParamField path="prompt" type="Optional[str]" toc={true}>
  A prompt for the AI to speak before going on hold (e.g., "Please hold
  while I check on that.").
</ParamField>

## **Returns**

`dict` -- Server response confirming the AI hold.

## **Example**

```python {20}
from signalwire.relay import RelayClient

client = RelayClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
    contexts=["default"],
)

@client.on_call
async def handle_call(call):
    await call.answer()

    # Start an AI agent
    action = await call.ai(
        prompt={"text": "You are a support agent."},
    )

    # After some event, put the AI on hold
    await call.ai_hold(
        prompt="One moment please while I look that up.",
        timeout="30",
    )

    # Do some processing, then resume with ai_unhold()

client.run()
```