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

# Async

> The same surface on AsyncClient — for pipelines and FastAPI.

`AsyncClient` is the async twin of `Client` — same surface, `await`ed. It's the
native form (the sync client wraps it on a background event loop), so reach for
it in asyncio programs, FastAPI handlers, and pipelines.

```python theme={null}
import asyncio
from cosmon_agent_sdk import AsyncClient

async def main() -> None:
    async with AsyncClient() as client:
        print(await client.run("What can you do?", agent="nexus").text())

asyncio.run(main())
```

Streaming is `async for`, and one process can drive several runs at once — useful
behind an HTTP endpoint:

```python theme={null}
from fastapi import FastAPI
from cosmon_agent_sdk import AsyncClient

app = FastAPI()

@app.post("/analyze")
async def analyze(part_path: str) -> dict[str, str]:
    async with AsyncClient() as client:
        answer = await client.run(
            "Run a static structural study and report peak von Mises.",
            agent="solidworks",
            attachments=[part_path],
        ).text()
    return {"result": answer}
```

<Card title="Reference: async" icon="code" href="/sdk/python-reference#async">
  The full `AsyncClient` / `AsyncRun` / `AsyncSession` surface.
</Card>
