Skip to main content

Piopiy Python SDK

Production-ready Python SDK for Piopiy Voice Orchestrator APIs. Easily build AI voice agents, manage programmable voice calls, and orchestrate complex call flows directly from your Python applications.

Prerequisites

  • Python 3.7 or higher
  • A Piopiy account and API token (Get yours from the Piopiy Dashboard)

Installation

pip install piopiy

Quick Start

Initialize the client using your API token. We recommend storing your token in an environment variable securely.

import os
from piopiy_voice import RestClient

client = RestClient(token=os.environ.get("PIOPIY_API_TOKEN"))

Main Examples

1) AI Single Call

response = client.ai.call(
    caller_id="919999999999",
    to_number="918888888888",
    agent_id="bdd32bcb-767c-40a5-be4a-5f45eeb348a6",
)
print(response)

Example code: example/ai_agent/02_ai_call_minimal.py

2) AI Call With Failover

response = client.ai.call(
    caller_id="919999999999",
    to_number="918888888888",
    agent_id="bdd32bcb-767c-40a5-be4a-5f45eeb348a6",  # primary agent
    app_id="your_app_id",
    failover={
        "agent_id": "2f2ae3ad-7ff6-4011-b10e-9ca1f8f8d1a2",  # failover agent
        "strategy": "sequential",
        "ring_timeout_sec": 20,
        "machine_detection": True,
    },
)
print(response)

Failover rules:

  • app_id is required when failover is used.
  • failover.agent_id is required (single failover agent).
  • Failover agent must be different from primary agent_id.

Example code: example/ai_agent/04_ai_call_with_failover.py

3) Voice Direct Call

response = client.voice.call(
    caller_id="919999999999",
    to_number="918888888888",
    app_id="your_app_id",
)
print(response)

Example code: example/voice_call/01_voice_call_direct.py

4) PCMO Simple Call

from piopiy_voice import PipelineBuilder

pipeline = (
    PipelineBuilder()
    .connect(
        params={"caller_id": "919999999999"},
        endpoints=[{"type": "pstn", "number": "918888888888"}],
    )
    .build()
)

response = client.pcmo.call(
    caller_id="919999999999",
    to_number="918888888888",
    app_id="your_app_id",
    pipeline=pipeline,
)
print(response)

Example code: example/pcmo_call/02_pcmo_call_minimal.py

Other Actions And Full Docs

Extra Example Code Indexes

Metadata

Release files for piopiy 1.2.2

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

Source distribution (sdist)

Source distribution for piopiy 1.2.2
File Size Uploaded Provenance Actions
piopiy-1.2.2.tar.gz 23.2 kB Without provenance Details for piopiy-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for piopiy 1.2.2
File Interpreter ABI Platform Actions
piopiy-1.2.2-py3-none-any.whl Python 3 none any Details for piopiy-1.2.2-py3-none-any.whl

Total release size: 49.5 kB

Release files / piopiy-1.2.2.tar.gz

Download URL piopiy-1.2.2.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7718c9c8309c01e8c5a1f2f4e3ccaf477cbffc1b40384ea82b0187fdb127ad5f
BLAKE2b-256 checksum
How to use checksums
60e21f5c856650e18a1357cf8e269647d59a77d0d0614141dd6de2b25802a9d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / piopiy-1.2.2-py3-none-any.whl

Download URL piopiy-1.2.2-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffe961e06327ee59e84bd31969fcccf07fad6110dca0caaf59f1b492b5c99ff8
BLAKE2b-256 checksum
How to use checksums
15652f7f371ca22b6ee7a60cbe795b41ab77bb29f7ab32133adec1a3603a1805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for piopiy 1.2.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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