# Basic Client Usage (/agent-os/usage/client/basic-client)



<Steps>
  <Step title="Create a Python file">
    ```python title="basic_client.py"
    import asyncio
    import os

    from agno.client import AgentOSClient


    HEADERS = {"Authorization": f"Bearer {os.environ['OS_SECURITY_KEY']}"}

    async def main():
        # Connect to AgentOS
        client = AgentOSClient(base_url="http://localhost:7778")

        # Get AgentOS configuration
        config = await client.aget_config(headers=HEADERS)
        print(f"Connected to: {config.name or config.os_id}")
        print(f"Available agents: {[a.id for a in (config.agents or [])]}")
        print(f"Available teams: {[t.id for t in (config.teams or [])]}")
        print(f"Available workflows: {[w.id for w in (config.workflows or [])]}")

        # Get details about a specific agent
        if config.agents:
            agent_id = config.agents[0].id
            agent = await client.aget_agent(agent_id, headers=HEADERS)
            print("\nAgent Details:")
            print(f"  Name: {agent.name}")
            print(f"  Model: {agent.model}")
            print(f"  Tools: {len((agent.tools or {}).get('tools') or [])}")


    if __name__ == "__main__":
        asyncio.run(main())
    ```
  </Step>

    <Step title="Set up your virtual environment">
      <CodeBlockTabs defaultValue="Mac">
        <CodeBlockTabsList>
          <CodeBlockTabsTrigger value="Mac">
            Mac
          </CodeBlockTabsTrigger>

          <CodeBlockTabsTrigger value="Windows">
            Windows
          </CodeBlockTabsTrigger>
        </CodeBlockTabsList>

        <CodeBlockTab value="Mac">
          ```bash
          uv venv --python 3.12
          source .venv/bin/activate
          ```
        </CodeBlockTab>

        <CodeBlockTab value="Windows">
          ```bash
          uv venv --python 3.12
          .venv\Scripts\activate
          ```
        </CodeBlockTab>
      </CodeBlockTabs>
    </Step>

  <Step title="Install dependencies">
    ```bash
    uv pip install -U "agno[os]" openai
    ```
  </Step>

  <Step title="Set the server model key">
    Set this key in the terminal that starts the example server. The client sends requests to AgentOS and does not call OpenAI directly.

    <CodeBlockTabs defaultValue="Mac/Linux">
      <CodeBlockTabsList>
        <CodeBlockTabsTrigger value="Mac/Linux">
          Mac/Linux
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="Windows">
          Windows
        </CodeBlockTabsTrigger>
      </CodeBlockTabsList>

      <CodeBlockTab value="Mac/Linux">
        ```bash
        export OPENAI_API_KEY="your_openai_api_key_here"
        ```
      </CodeBlockTab>

      <CodeBlockTab value="Windows">
        ```bash
        $Env:OPENAI_API_KEY="your_openai_api_key_here"
        ```
      </CodeBlockTab>
    </CodeBlockTabs>
  </Step>

  <Step title="Start an AgentOS Server">
    Set `OS_SECURITY_KEY` in the client terminal to the same value used by the server. The code sends it as a bearer credential on each request.

    <CodeBlockTabs defaultValue="Mac/Linux">
      <CodeBlockTabsList>
        <CodeBlockTabsTrigger value="Mac/Linux">
          Mac/Linux
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="Windows">
          Windows
        </CodeBlockTabsTrigger>
      </CodeBlockTabsList>

      <CodeBlockTab value="Mac/Linux">
        ```bash
        export OS_SECURITY_KEY="your_os_security_key_here"
        ```
      </CodeBlockTab>

      <CodeBlockTab value="Windows">
        ```powershell
        $Env:OS_SECURITY_KEY="your_os_security_key_here"
        ```
      </CodeBlockTab>
    </CodeBlockTabs>

    Start the [client example server](/examples/agent-os/python-client/-server) on port 7778. It registers the agents, team, and workflow used by these client examples.
  </Step>

  <Step title="Run the Client">
    <CodeBlockTabs defaultValue="Mac">
      <CodeBlockTabsList>
        <CodeBlockTabsTrigger value="Mac">
          Mac
        </CodeBlockTabsTrigger>

        <CodeBlockTabsTrigger value="Windows">
          Windows
        </CodeBlockTabsTrigger>
      </CodeBlockTabsList>

      <CodeBlockTab value="Mac">
        ```bash
        python basic_client.py
        ```
      </CodeBlockTab>

      <CodeBlockTab value="Windows">
        ```bash
        python basic_client.py
        ```
      </CodeBlockTab>
    </CodeBlockTabs>
  </Step>
</Steps>
