Skip to main content

voxbridge

CI PyPI Python Docs License: MIT

voxbridge is a Python SDK that puts one typed VoiceClient over the Vapi and Retell voice-agent platforms. Create agents, place outbound calls, verify and parse webhooks, and answer tool calls with the same code on either provider; switching is a config string. Both sync and async are supported, every model keeps the untouched provider payload under .raw, and a capability a provider lacks raises NotSupported instead of silently doing nothing.

Install

pip install voxbridge-sdk

Requires Python 3.12+. Runtime dependencies are httpx and pydantic only. The distribution is named voxbridge-sdk; the package you import is voxbridge.

Quickstart

Set the provider and its key, then build the client from the environment:

export VOICE_PROVIDER=vapi        # or retell
export VAPI_API_KEY=...           # or RETELL_API_KEY
export FROM_NUMBER=+15557654321   # your caller number
import os

from voxbridge import Agent, VoiceClient

with VoiceClient.from_env() as client:
    agent = client.create_agent(Agent(
        name="Front desk",
        system_prompt="You are a friendly receptionist. Keep answers short.",
        model="gpt-4o",
        voice="openai:alloy",          # "<tts-provider>:<voiceId>"
        first_message="Hi, how can I help?",
    ))
    call = client.create_call(
        agent.id, "+15551234567", from_number=os.environ["FROM_NUMBER"]
    )
    print(call.id, call.status)

Outbound calls need a caller number (from_number) on both providers: Retell raises ValueError without it; on Vapi pass an E.164 number (looked up among your Vapi phone numbers) or a phone-number id. The explicit form takes the same options:

from voxbridge import VoiceClient

client = VoiceClient(provider="retell", api_key="key_...", webhook_secret="key_...")

Every agent/call method has an a-prefixed async twin (await client.acreate_call(...)); parse_webhook, verify_signature and tool_response are sync. See the quickstart guide for agents with tools, async usage and more.

Configuration

Setting Constructor kwarg Environment variable Default
Provider provider VOICE_PROVIDER required
API key api_key VAPI_API_KEY / RETELL_API_KEY required
Webhook secret webhook_secret VAPI_WEBHOOK_SECRET / RETELL_WEBHOOK_SECRET Vapi: none (unsigned accepted); Retell: the API key
Replay window (Retell only) webhook_max_age RETELL_WEBHOOK_MAX_AGE 300 seconds; None disables
HTTP timeout timeout none 30 seconds

Keyword arguments to from_env(**overrides) win over environment values. Empty variables count as unset. voxbridge does not load .env files itself; see the configuration guide.

Webhooks and tools

parse_webhook verifies the request and returns one normalized event; tool_response builds the reply a provider expects for a tool call.

from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse

from voxbridge import SignatureError, ToolCall, VoiceClient

app = FastAPI()
client = VoiceClient.from_env()


@app.post("/tools")
async def tools(request: Request) -> JSONResponse:
    try:
        event = client.parse_webhook(request.headers, await request.body())
    except SignatureError:
        return JSONResponse({"error": "invalid signature"}, status_code=401)
    if isinstance(event, ToolCall) and event.name == "book_appointment":
        return JSONResponse(client.tool_response(event, {"booked": event.arguments.get("day")}))
    return JSONResponse({"error": "unknown tool"}, status_code=400)

Vapi is unauthenticated unless you set VAPI_WEBHOOK_SECRET. Without a secret, anyone who finds your URL can post fake events or trigger your tools. Retell is verified by default with your API key.

A fuller, runnable server (webhooks and tools) is in examples/; the webhooks guide covers verification, event mapping and per-provider limits.

Error handling

All errors derive from VoxBridgeError.

Exception Raised when
AuthError the provider returns 401/403
RateLimited the provider returns 429; .retry_after is the seconds it asked you to wait, if given
ProviderError any other failed or unusable response; .status_code, .body, .provider
NotSupported the capability does not exist on the selected provider
SignatureError a webhook failed signature verification

AuthError and RateLimited are subclasses of ProviderError. Each request is retried at most once: connect errors, connect timeouts and 429s for any request, read/write timeouts, 500/502/503/504 and other transport errors for idempotent requests only, honouring Retry-After up to 10 seconds.

from voxbridge import RateLimited, VoiceClient

client = VoiceClient.from_env()
try:
    client.get_call("call_123")
except RateLimited as exc:
    print("retry in", exc.retry_after)

Vapi vs Retell

Vapi Retell
Auth header Authorization: Bearer Authorization: Bearer
Agent create 1 API call 2 API calls (LLM, then agent)
list_calls() default size 100 50 (limit up to 1000)
list_calls items carry a transcript yes no, use get_call
Webhook verification only if you set a secret always, HMAC-SHA256 with the API key by default
Replay protection not available yes, webhook_max_age (default 300s)
Tool-call reply {"results": [{"toolCallId", "result"}]}, single-line string the result itself as the response body
Voice id on the wire {provider, voiceId} "<provider>-<voiceId>"
Call.from_number the Vapi phone-number id the number

Voice ids are always written "<tts-provider>:<voiceId>" (elevenlabs is normalized to 11labs), but the voice catalogs differ between providers. See providers for the full matrix and known differences.

More

License

MIT

Metadata

Release files for voxbridge-sdk 0.1.0

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

Source distribution (sdist)

Source distribution for voxbridge-sdk 0.1.0
File Size Uploaded Provenance Actions
voxbridge_sdk-0.1.0.tar.gz 55.1 kB With provenance Details for voxbridge_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for voxbridge-sdk 0.1.0
File Interpreter ABI Platform Actions
voxbridge_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for voxbridge_sdk-0.1.0-py3-none-any.whl

Total release size: 83.2 kB

Release files / voxbridge_sdk-0.1.0.tar.gz

Download URL voxbridge_sdk-0.1.0.tar.gz
Size 55.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d47edda2c92b8a5f0e5c1cfa864c426b9cb68e590dade3e25a8213ee4a57982c
BLAKE2b-256 checksum
How to use checksums
9c298329a56c7cd47ae3ce25845ce8ffb1b7a1a9e1137bab568721e16e15b676
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 Nov 12, 2026.

Transparency log

Release files / voxbridge_sdk-0.1.0-py3-none-any.whl

Download URL voxbridge_sdk-0.1.0-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5aa9c2c88ccbb4b4c2ff222fcb7b498e82eb92c7f265ef552d88dd69e383dc19
BLAKE2b-256 checksum
How to use checksums
2d008ca2ee15cd671c2fd1f4201e62dbf719924845d9cf1bee84ac11280fe2e8
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 Nov 12, 2026.

Transparency log

Security for voxbridge-sdk 0.1.0

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 voxbridge_sdk-0.1.0.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 Nov 12, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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