---
title: ai.ui.ai_sdk approvals
description: Apply AI SDK UI approval responses.
type: reference
summary: Reference for ApprovalResponse, extract_approvals, and apply_approvals.
---

# ai.ui.ai_sdk approvals



Approval helpers bridge AI SDK UI tool approval responses into the hook
registry.

## APIs

* `ApprovalResponse`
* `extract_approvals`
* `apply_approvals`

```python
messages, approvals = ai.ui.ai_sdk.to_messages(ui_messages)

async with agent.run(model, messages) as stream:
    ai.ui.ai_sdk.apply_approvals(approvals)
    async for event in stream:
        ...
```

Call `apply_approvals` inside the `agent.run` context before iteration, or pass
the registry that the run uses with `registry=`.


---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)