# Python SDK (/docs/sdks/python)

> The omnidimension Python package. Install with pip and start calling the API.





The `Client` class is the main entry point for the OmniDimension Python
SDK. It handles authentication, request management, and provides access
to every API domain.

## Installation [#installation]

Install the SDK from PyPI:

```bash
pip install omnidimension
```

Package details and version history live at
[pypi.org/project/omnidimension](https://pypi.org/project/omnidimension/).

## Initialization [#initialization]

Initialize the Client with your API key:

```python
import os
from omnidimension import Client

api_key = os.environ.get('OMNIDIM_API_KEY', 'your_api_key_here')
client = Client(api_key)
```

## Client structure [#client-structure]

```python
client.agent           # Agent operations
client.call            # Call operations
client.knowledge_base  # Knowledge base operations
client.phone_number    # Phone number operations
```

<Cards>
  <Card icon="<Bot />" title="Agent" href="/docs/api-reference/agents/listAgents" description="Create, retrieve, update, and delete AI voice agents." />

  <Card icon="<PhoneCall />" title="Call" href="/docs/api-reference/calls/dispatchCall" description="Manage call logs and dispatch calls to phone numbers." />

  <Card icon="<BookOpen />" title="Knowledge base" href="/docs/api-reference/knowledge-base/listKnowledgeBaseFiles" description="Upload, manage, and attach knowledge base files to agents." />

  <Card icon="<Phone />" title="Phone numbers" href="/docs/api-reference/phone-numbers/listPhoneNumbers" description="List, attach, and detach phone numbers from agents." />
</Cards>

## Error handling [#error-handling]

The SDK provides an `APIError` class for API-specific errors:

```python
import os
from omnidimension import Client, APIError

api_key = os.environ.get('OMNIDIM_API_KEY', 'your_api_key_here')
client = Client(api_key)

try:
    response = client.agent.list()
    print(response)
except APIError as e:
    print(f"API Error ({e.status_code}): {e.message}")
except Exception as e:
    print(f"Unexpected error: {str(e)}")
```

## Client parameters [#client-parameters]

<TypeTable
  type="{
  api_key: {
    description: 'Your OmniDimension API key for authentication.',
    type: 'string',
    required: true,
  },
  base_url: {
    description: 'The base URL for the API. Defaults to the production URL.',
    type: 'string',
    required: false,
  },
}"
/>
