Skip to main content

Python server SDK for the CALL-E Developer API.

Project description

calle-ai

Python server SDK for the CALL-E Developer API.

Use this SDK from backend services, workers, and other trusted server environments. Do not expose CALL-E API keys in browser code.

Documentation

Install

Install the stable package from PyPI:

pip install calle-ai

Pin the first stable release when your deployment process requires exact package reproducibility:

pip install calle-ai==0.1.0

Use a local checkout for development and package smoke tests:

bash scripts/validate.sh

Examples

Set the API key before running call examples:

export CALLE_API_KEY="calle_test_key"
export CALLE_BASE_URL="https://api.heycall-e.com"
export CALLE_EXAMPLE_PHONE="+14155550100"

Run the create-and-wait example from a local checkout:

uv run python examples/create_and_wait.py

Run the webhook receiver example:

export CALLE_WEBHOOK_SECRET="whsec_test_key"
uv run python examples/webhook_server.py

The webhook receiver listens on POST /calle/webhook and verifies CALL-E-Timestamp and CALL-E-Signature against the raw request body.

Quickstart

import os
from calle import CalleClient

client = CalleClient(
    api_key=os.environ["CALLE_API_KEY"],
    base_url="https://api.heycall-e.com",
)

call = client.calls.create_and_wait(
    task="Call the recipient and ask whether they can attend Friday lunch in San Francisco.",
    recipient={"phone": "+14155550100", "region": "US", "locale": "en-US"},
    result_schema={
        "type": "object",
        "required": ["can_attend"],
        "properties": {
            "can_attend": {"type": "string", "enum": ["yes", "no", "unknown"]},
        },
        "additionalProperties": False,
    },
    metadata={"workflow_run_id": "wf_123"},
    idempotency_key="wf_123_friday_lunch",
)

print(call["status"], call["structured_result"])

Webhook Verification

event = client.webhooks.unwrap(
    raw_body=raw_body,
    headers=headers,
    secret=os.environ["CALLE_WEBHOOK_SECRET"],
)

Release

This repository publishes the Python distribution calle-ai. Application code imports it as calle.

See RELEASE.md for the release checklist, GitHub Actions workflow, and post-publish install smoke test.

Prerequisites:

  • Create a PyPI API token and add it to this repository as the GitHub Actions secret PYPI_API_TOKEN.
  • Keep the package version in pyproject.toml unique before each publish.

Manual stable PyPI publish:

  1. Open the Publish Python package GitHub Actions workflow.
  2. Run it from main with repository pypi and auth token.
  3. Verify install in a temporary environment:
python -m venv .venv
. .venv/bin/activate
pip install calle-ai==0.1.0
python -c 'from calle import CalleClient; print(CalleClient)'

The first stable version is 0.1.0. Do not reuse a previously published PyPI version.

Project Documents

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calle_ai-0.1.0.tar.gz (73.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

calle_ai-0.1.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file calle_ai-0.1.0.tar.gz.

File metadata

  • Download URL: calle_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 73.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for calle_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2aed7a8c26f076cf0b81e321648f1210be646a8646a4e06f31326a44355e5055
MD5 dc066735b7f414fbffd5f278b0e9b3af
BLAKE2b-256 73d167e92489354a551b1497e25f5d6e8aef836b95a98c8f2eeebe70fe30ff8e

See more details on using hashes here.

File details

Details for the file calle_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: calle_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for calle_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd127875ab88a3575ef4820504f9b4c70962bb7e3b56b7011e4b38a41d5612d4
MD5 f182c89429d22bec85c1f436ff150f92
BLAKE2b-256 a42ff6a5d1b631d670e8a4b0696f4752dd104fcb6dd0bfaa547fc6b4917cbaf6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page