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
httpx.
Quick Start
Async Client (Recommended)
Sync Client
Client Configuration
Resource Namespaces
The SDK organizes API methods through resource namespaces:Agents
agents.run() — Invoke an Expert
AgentRunResponse object:
agents.run_stream() — Stream an Expert Invocation
AgentRunChunk contains:
Chat Completions
chat.completions.create() — Chat Completion
Non-streaming:
ChatResponse object:
Models
models.list() — Get Model List
Events
events.report() — Report a Custom Event
Error Handling
The SDK raisesProfyApiError 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

