Skip to main content

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 current stable release when your deployment process requires exact package reproducibility:

pip install calle-ai==0.7.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 a published Goal with an explicit Goal, phone, variables, and durable idempotency key:

export CALLE_GOAL_ID="<PUBLISHED_GOAL_ID>"
export CALLE_GOAL_PHONE="<AUTHORIZED_E164_PHONE>"
export CALLE_GOAL_VARIABLES='{"name":"Alex"}'
export CALLE_IDEMPOTENCY_KEY="<DURABLE_WORKFLOW_KEY>"
uv run python examples/run_goal_and_wait.py

To test against the test environment, explicitly set:

export CALLE_BASE_URL="https://test-api.heycall-e.com"

Run the webhook receiver example:

uv run python examples/webhook_server.py

The webhook receiver listens on POST /calle/webhook and processes terminal event JSON. CALL-E sends terminal events only after the post-call outcome and requested structured results are finalized.

CALL-E webhook delivery does not use a webhook secret, CALL-E-Timestamp, or CALL-E-Signature. Use the required CALL-E-Event-Id header to deduplicate at-least-once deliveries before performing side effects. The receiver example parses JSON directly and checks that this header matches the body event id.

The client.webhooks.verify and client.webhooks.unwrap methods implement the legacy signed-payload contract from SDK 0.2. They remain available for source compatibility but are deprecated and are not compatible with current unsigned CALL-E deliveries.

Quickstart

Run a reusable published Goal. The Goal owns its input and result schemas; each Run supplies only a phone number, per-Run variables, and a durable idempotency key:

import os
from calle import CalleClient

client = CalleClient(api_key=os.environ["CALLE_API_KEY"])

goal = client.goals.get("goal_delivery_confirmation")
print(goal["title"], goal["published_run_spec"]["input_schema"])

run = client.goals.run_and_wait(
    goal_id=goal["id"],
    phone="+14155550100",
    variables={
        "customer_name": "Taylor",
        "order_reference": "ORD-8472",
        "delivery_window": "July 24, 2:00-4:00 PM",
    },
    idempotency_key="delivery:ORD-8472:confirm-window:v1",
)

if run["result"] is not None:
    print(run["call_id"])
    print(run["result"])
else:
    print(run["error"])

Persist the idempotency key before the first request and reuse it for network retries. wait_for_result returns when either result or error is non-null; an execution status of completed can still be waiting for result materialization.

The generic one-shot call API remains available independently:

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 each recipient and ask whether they can attend Friday lunch in San Francisco.",
    recipients=[{"phones": ["+14155550100"], "region": "US", "locale": "en-US"}],
    result_schema={
        "type": "object",
        "required": ["completed_count"],
        "properties": {
            "completed_count": {"type": "integer"},
        },
    },
    recipient_result_schema={
        "type": "object",
        "required": ["can_attend"],
        "properties": {
            "can_attend": {"type": "string", "enum": ["yes", "no", "unknown"]},
        },
    },
    metadata={"workflow_run_id": "wf_123"},
    idempotency_key="wf_123_friday_lunch",
)

print(call["status"], call["structured_result"])
print(call["task_completed"], call["completion_confidence"], call["evidence"])
print(call["recipients"][0]["structured_result"])

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.7.0
python -c 'from calle import CalleClient; c = CalleClient(api_key="smoke"); assert callable(c.goals.run_and_wait); c.close()'

The current stable version is 0.7.0. Do not reuse a previously published PyPI version.

Project Documents

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.7.0.tar.gz (98.7 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.7.0-py3-none-any.whl (62.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for calle_ai-0.7.0.tar.gz
Algorithm Hash digest
SHA256 77e9999ffeb3a6d886b066bd951674e11fb28104d31d8fbfa8d3e03eabaf079c
MD5 2c9a69c28feefa4d54b73b023b3bfd1f
BLAKE2b-256 6fa5b35d435f7f3e3093918316f97107f332b9a146751621aed0270f570ab12a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for calle_ai-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da6c081c0c57c12a620f5f6a8003e263ec43921c7e94e3d110281985c4895dda
MD5 6bee794f80217e83a187e6635431c58d
BLAKE2b-256 65cd8fe3345da0eb9d6f315c164fdc176796c6f1225ecc413c804f6c3a8b854d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.0

2 files

0.2.0

2 files

0.1.0

2 files

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