Skip to main content

Official Python SDK for the Protoface API.

Project description

protoface-sdk

Official Python SDK for the Protoface API.

Install protoface-sdk and import protoface_sdk.

Installation

pip install protoface-sdk

Or with uv:

uv add protoface-sdk

Requires Python 3.10+ and a Protoface API key.

Quickstart

import os

from protoface_sdk import ProtofaceClient

with ProtofaceClient(api_key=os.environ["PROTOFACE_API_KEY"]) as client:
    status = client.get_status()
    avatars = client.avatars.list(limit=10)

    print(status.status.value)
    print([avatar.id for avatar in avatars.data])

Resources

client.sessions.create(session_request, idempotency_key=...)
client.sessions.create_livekit(avatar_id=..., url=..., room_name=..., worker_token=...)
client.sessions.get(session_id)
client.sessions.list(status=["running"], avatar_id=..., limit=...)  # -> Page[Session]
client.sessions.end(session_id)

client.avatars.list(scope="platform", q="stock", limit=...)    # -> Page[Avatar]
client.avatars.get(avatar_id)
client.avatars.create(image=..., name=...)                     # multipart upload
client.avatars.delete(avatar_id)

client.pipecat.sessions.create(avatar_id=...)                  # Pipecat relay bootstrap

client.usage.summary(period="current_month")                   # or period_start/period_end

client.list_billing_plans()
client.get_status()

Page objects expose .data, .has_more, and .next_cursor. Pass .next_cursor back as starting_after to fetch the next page.

LiveKit sessions

client.sessions.create_livekit(...) starts the backend worker for a customer-owned LiveKit room. Your application still owns the room and mints a short-lived worker token with its own LiveKit API key and secret.

session = client.sessions.create_livekit(
    avatar_id="av_stock_001",
    url=livekit_url,
    room_name="demo-room",
    worker_token=worker_token,
)

session = session.wait_until_running(timeout=10)
print(session.id, session.status)

For framework-level realtime integrations, use the dedicated packages:

  • livekit-plugins-protoface for LiveKit Agents.
  • pipecat-protoface for Pipecat.

Errors

Every non-2xx response raises a typed ProtofaceError subclass (AuthenticationError, RateLimitError, QuotaExceededError, etc.). Switch on the stable error.code, never on error.message:

from protoface_sdk import ProtofaceError, QuotaExceededError, RateLimitError

try:
    client.sessions.create(session_request)
except RateLimitError as err:
    print("rate limited:", err.code, err.retry_after_seconds)
except QuotaExceededError as err:
    print("quota:", err.code)
except ProtofaceError as err:
    print(err.code, err.request_id, err.status)

The client retries 429, 503, and transient network failures for safe requests, and for writes that include an Idempotency-Key.

License

Apache-2.0 - see LICENSE.

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

protoface_sdk-0.1.0.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

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

protoface_sdk-0.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: protoface_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protoface_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c9bad5c781bcc9956f1010b1d74ef359c17780c4df4d44398f509ed098b87c90
MD5 a507cb3c88a5a1804290df65ae3ceda1
BLAKE2b-256 4210500045972bbebda0bae19e68fa8ae189da40bfd9391666fca9a4e756dbe0

See more details on using hashes here.

Provenance

The following attestation bundles were made for protoface_sdk-0.1.0.tar.gz:

Publisher: release.yml on protoface-ai/protoface-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: protoface_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protoface_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af3bc01bb9b2e6516c2ea763e4d367751556562edc96a96d82eb16ced6e25d72
MD5 30822845e15d8954b68e8ae0a1426ead
BLAKE2b-256 1036501c1b6e10d27a74dc134a10c9d72cdb82858d42e8465cce6a6921fb0ddb

See more details on using hashes here.

Provenance

The following attestation bundles were made for protoface_sdk-0.1.0-py3-none-any.whl:

Publisher: release.yml on protoface-ai/protoface-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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