Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

AHS CTI Python SDK

Python SDK for the AHS CTI Platform — initiate and control outbound calls via REST API.

Requirements: Python ≥ 3.9 · httpx ≥ 0.25


Installation

pip install ahs-cti-api-sdk

Quick Start

from ahs_cti import CtiClient

with CtiClient(base_url="https://cti.example.com", api_key="ctsk_...", tenant_id=1) as client:
    result = client.calls.dial("+919876543210")
    print(result.call_id)   # save this for end_call

    end = client.calls.end_call(
        result.call_id,
        disposition="INTERESTED",
        list_comments="Customer wants a demo next week",
    )
    print(end.duration)

Credential Authentication

from ahs_cti import CtiClient

with CtiClient(base_url="https://cti.example.com", user_id="agent1", password="secret") as client:
    result = client.calls.dial("+919876543210", caller_id="AH2007C")

Async Client

import asyncio
from ahs_cti import AsyncCtiClient

async def main():
    async with AsyncCtiClient(base_url="https://cti.example.com", api_key="ctsk_...") as client:
        result = await client.calls.dial("+919876543210")
        print(result.call_id)

asyncio.run(main())

ClientConfig Reference

For full control over transport settings, use ClientConfig:

from ahs_cti import CtiClient, ClientConfig

config = ClientConfig(
    base_url="https://cti.example.com",
    timeout=15.0,
    verify_ssl=False,   # for self-signed certificates
    max_retries=5,
)

with CtiClient(config=config, api_key="ctsk_...") as client:
    result = client.calls.dial("+919876543210")
Parameter Type Default Description
base_url str required Root URL of the CTI platform
timeout float 30.0 Request timeout in seconds
verify_ssl bool True Set False for self-signed certs
max_retries int 3 Retry attempts on 5xx / network errors

Error Handling

from ahs_cti import CtiClient, CtiAuthError, CtiApiError, CtiRetryExhaustedError

with CtiClient(...) as client:
    try:
        result = client.calls.dial("+919876543210")
    except CtiAuthError:
        # Invalid or expired API key / credentials
        print("Authentication failed")
    except CtiRetryExhaustedError as e:
        # All retry attempts failed (5xx or network)
        print(f"Failed after {e.attempts} attempts: {e.last_exc}")
    except CtiApiError as e:
        # Any other API error (400, 404, 422 …)
        print(f"API error [{e.status_code}]: {e}")

Exception Hierarchy

CtiError
├── CtiAuthError          — 401 / login failure
└── CtiApiError           — 4xx / 5xx from the platform
    └── CtiRetryExhaustedError  — all retries exhausted

Retry Behaviour

The SDK automatically retries on 500, 502, 503, 504 responses and transient network errors (ConnectError, TimeoutException). Retries use exponential backoff:

Attempt Delay
1st (initial) none
2nd retry 2 s
3rd retry 4 s
4th retry 8 s

Set max_retries=0 in ClientConfig to disable retries entirely.


Self-Signed Certificates

Internal / staging servers often use self-signed TLS certificates. Pass verify_ssl=False:

client = CtiClient(base_url="https://192.168.1.10:8082", api_key="ctsk_...", verify_ssl=False)

Do not disable SSL verification in production.

Metadata

Release files for ahs-cti-api-sdk 0.1.0a7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ahs-cti-api-sdk 0.1.0a7
File Size Uploaded Provenance Actions
ahs_cti_api_sdk-0.1.0a7.tar.gz 27.2 kB With provenance Details for ahs_cti_api_sdk-0.1.0a7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ahs-cti-api-sdk 0.1.0a7
File Interpreter ABI Platform Actions
ahs_cti_api_sdk-0.1.0a7-py3-none-any.whl Python 3 none any Details for ahs_cti_api_sdk-0.1.0a7-py3-none-any.whl

Total release size: 54.3 kB

Release files / ahs_cti_api_sdk-0.1.0a7.tar.gz

Download URL ahs_cti_api_sdk-0.1.0a7.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c567be1732499c63b192f87a534eac630d9b0deb14641eb6d27cfc1671924db9
BLAKE2b-256 checksum
How to use checksums
767dc63a461fc9ca5f7f8a22e6934eefc1b8c6f7581f2560805d057fcd566514
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / ahs_cti_api_sdk-0.1.0a7-py3-none-any.whl

Download URL ahs_cti_api_sdk-0.1.0a7-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7e53cec99826c6b4aabe731d71b096f8e265ec2400111a9c31796b7c516c6d2
BLAKE2b-256 checksum
How to use checksums
5275e7348cf9cdeb29f905979503010165334113fd8348b5ccf43868c8d85bdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for ahs-cti-api-sdk 0.1.0a7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ahs_cti_api_sdk-0.1.0a7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page