Skip to main content
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

Requires Python 3.8+. 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

Events

events.report() — Report a Custom Event

The Events API only supports OAuth Tokens. Calling with an API Key will return a 401 error.

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 does not include the events namespace, since the Events API requires an OAuth Token and is typically used in async web applications.

Full Example: Multi-Turn Chat Bot

Next Steps

TypeScript SDK

TypeScript SDK guide

API Reference

Complete API documentation