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

# Python SDK

> Install and use the Arga Python SDK

## Installation

```bash theme={null}
uv add arga-py-sdk
```

## Quick start

```python theme={null}
from arga_sdk import Arga

client = Arga(api_key="arga_sk_...")

# Start an ad hoc browser test run
run = client.test_runs.create(
    prompt="Test checkout with Stripe",
    start_url="https://staging.myapp.com",
    twins=["stripe"],
)

# Wait for completion
detail = client.test_runs.wait(run.id, timeout=300)
print(detail.status, detail.artifacts_json)
```

## Async usage

Every method is available in async form via `AsyncArga`:

```python theme={null}
import asyncio
from arga_sdk import AsyncArga

async def main():
    async with AsyncArga(api_key="arga_sk_...") as client:
        run = await client.test_runs.create(
            prompt="Smoke test",
            start_url="https://staging.myapp.com",
        )
        detail = await client.test_runs.wait(run.id)
        print(detail.status)

asyncio.run(main())
```

## Reference

<CardGroup cols={2}>
  <Card title="Runs" icon="play" href="/sdks/python/runs">
    Use the canonical sandbox, twin, saved-test, and test-run resources, plus legacy runs when needed.
  </Card>

  <Card title="Twins" icon="clone" href="/sdks/python/twins">
    Use both canonical twin runs and legacy twin quickstart helpers.
  </Card>

  <Card title="Scenarios" icon="database" href="/sdks/python/scenarios">
    Create reusable seed configs and use them to seed short-lived twin runs.
  </Card>

  <Card title="Errors and clients" icon="triangle-alert" href="/sdks/python/errors">
    Handle SDK errors and use sync or async context managers.
  </Card>

  <Card title="Examples" icon="code" href="/sdks/python/examples">
    Run production-style scripts from the Python SDK repository.
  </Card>
</CardGroup>

## Source

[github.com/ArgaLabs/arga-python-sdk](https://github.com/ArgaLabs/arga-python-sdk)
