Skip to main content
The Python SDK is frozen and not recommended for production use.profy-sdk on PyPI is still 0.1.0, which ships only OAuth and event reporting (ProfyApp) — it does not contain the unified Profy client documented on this page. Every example here targets the unreleased 1.0.0 source, so pip install profy-sdk followed by from profy import Profy raises ImportError.Until the Python SDK is published again, call the REST /v1 endpoints directly, or use the TypeScript SDK.
profy is the official Python SDK for the Profy platform, providing both async and sync clients with built-in authentication, streaming, and error handling.

Installation

The distribution is named profy-sdk; the import name is profy (from profy import Profy). Requires Python 3.9+. The SDK is built on httpx.

Quick Start

Sync Client

Client Configuration

Resource Namespaces

The SDK organizes API methods through resource namespaces:

Agents

agents.run() — Invoke an Expert

Returns an AgentRunResponse object:

agents.run_stream() — Stream an Expert Invocation

Each AgentRunChunk contains:

Chat Completions

chat.completions.create() — Chat Completion

Non-streaming:
Streaming:
ChatResponse object:

Models

models.list() — Get Model List

Error Handling

The SDK raises ProfyApiError when the API returns a 4xx/5xx status code:

Timeout Handling

agents.run() will attempt to return partial results already received on timeout (result.partial = True) rather than raising an exception directly.

Sync Client

ProfySync provides the exact same API but with synchronous methods:
ProfySync exposes the exact same resource namespaces as Profy.

Full Example: Multi-Turn Chat Bot

Next Steps

TypeScript SDK

TypeScript SDK guide

API Reference

Complete API documentation