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

# Python SDK

> Official Python client for the Operark API.

## Installation

```bash theme={null}
pip install operark
```

## Initialize

```python theme={null}
from operark import Operark

client = Operark(api_key="YOUR_API_KEY")
```

## Ask an executive

```python theme={null}
response = client.executives.CEO.ask(
    question="What's our strategy for Q2?"
)

print(response.answer)
```

## Request a governed decision

```python theme={null}
decision = client.executives.CRO.decide(
    question="Approve a new vendor without ISO 27001?"
)

print(decision.outcome, decision.rationale)
```

## Error handling

```python theme={null}
from operark import Operark, OperarkError

try:
    client.executives.CFO.ask(question="Q2 burn rate?")
except OperarkError as err:
    print(err.code, err.message)
```

<Card title="API Reference" icon="code" href="/api-reference/introduction">
  Full endpoint reference, generated from OpenAPI.
</Card>
