> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Serve an Agent over AG-UI

> Mount one Agent on AgentOS's AG-UI interface and expose its response as an AG-UI server-sent event stream.

```python basic.py theme={null}
"""
Serve an Agent over AG-UI
=========================

Mount one Agent on AgentOS's AG-UI interface and expose its response as an
AG-UI server-sent event stream.

Prerequisites: OPENAI_API_KEY
Run: .venvs/demo/bin/python cookbook/05_agent_os/16_agui/basic.py
Try: GET http://localhost:7777/status, then POST an AG-UI request to /agui
"""

from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from agno.os import AgentOS
from agno.os.interfaces.agui import AGUI

# ---------------------------------------------------------------------------
# Create AG-UI AgentOS
# ---------------------------------------------------------------------------

db = SqliteDb(
    id="agui-basic-db",
    db_file="tmp/agui_basic.db",
)

assistant = Agent(
    id="agui-assistant",
    name="AG-UI Assistant",
    model=OpenAIResponses(id="gpt-5.5"),
    db=db,
    instructions="Answer clearly and concisely.",
)

agent_os = AgentOS(
    id="agui-basic-os",
    description="A minimal AgentOS with one AG-UI interface.",
    agents=[assistant],
    interfaces=[AGUI(agent=assistant)],
)
app = agent_os.get_app()

# ---------------------------------------------------------------------------
# Run AG-UI Server
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    agent_os.serve(app=app)
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[agui,os]" openai
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `basic.py`, then run:

    ```bash theme={null}
    python basic.py
    ```
  </Step>
</Steps>

Full source: [cookbook/05\_agent\_os/16\_agui/basic.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/05_agent_os/16_agui/basic.py)
