Skip to main content
This quickstart shows the shortest path to run an agent and wait for the result. You can use the Python package (asapi), the agentservice CLI, or (soon) Node.js.

Before you begin

  • Python 3.10+ if you use the Python client or install the CLI via pip.
  • A virtual environment (recommended):
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
Install the Python client (for the Python tab below):
pip install asapi
The PyPI project may be published as asapi or agentserviceapi; the import is asapi unless your release notes say otherwise. The CLI wheel package name is agentservice.

Run one agent (pick your surface)

Use the dropdown to switch between Python, Node.js, and CLI. The Python and CLI paths use a long-lived streaming connection (server-sent events, SSE) when the API supports it, so your process can wait for completion without polling in your own code.
Python
import asyncio
from asapi import AsapiClient

async def main():
    client = AsapiClient()
    client.set_api_key("sk_...")  # from https://sudoiq.com/settings

    result = await client.run_agent(
        agent_id="YOUR_AGENT_UUID",
        string_inputs={"1": "Hello"},
        environment="playground",
    )
    print(result.status)
    print(result.result)

asyncio.run(main())

Python: editable install

If you develop the client from a clone:
pip install -e /path/to/asapi-python

What happens under the hood

The Python run_agent / execute_agent path opens a streaming HTTP connection after starting the run; the server pushes status updates. When the model calls tools, you can supply local handlers (see Interactive runs and local tools). The CLI execute ... --wait follows the same idea: it prefers that streaming path when the bundled client supports it and only falls back internally if streaming is unavailable (see agentservice execute --help). For runs that may last hours or days, consider webhooks instead of holding a connection open — see Running agents and Webhooks.

Next steps