Skip to main content

Use a shared internal Python client today.

Until an official SDK is available, use requests or httpx with one maintained client module.
  • Base URL and key handling from environment.
  • Timeout defaults and retry policy for transient errors.
  • Error payload parsing and request ID logging.
  • Optional type hints for common response envelopes.
import os
import requests

BASE_URL = os.getenv("CALLARO_BASE_URL", "https://api.callaro.ai")
API_KEY = os.environ["CALLARO_API_KEY"]

def callaro(method, path, **kwargs):
    headers = kwargs.pop("headers", {})
    headers.setdefault("X-Api-Key", API_KEY)
    response = requests.request(method, f"{BASE_URL}{path}", headers=headers, **kwargs)
    payload = response.json()
    response.raise_for_status()
    return payload

Usage pattern

  1. Keep endpoint helpers in service modules.
  2. Use idempotency keys for sensitive mutation flows.
  3. Log request_id and error code for all non-2xx responses.
  4. Add smoke tests for campaign launch and log retrieval flows.

Maintained downloads guidance

  • Store client template in a shared internal package.
  • Pin runtime and dependency versions in lockfiles.
  • Track API changes and update wrapper before production rollout.