Installation
Install the SDK using pip:Quick Setup
Environment Variables
Set your API credentials as environment variables:Initialize the Client
Sync vs Async
The SDK provides both synchronous and asynchronous clients to fit your application’s needs.Synchronous Client
UseSullyAI for standard synchronous operations:
Asynchronous Client
UseAsyncSullyAI for async applications with asyncio:
Audio Transcriptions
Upload a File
Submit an audio file for transcription:Poll for Completion
Audio transcription is an asynchronous process. Poll until it completes: Synchronous polling:Delete a Transcription
Remove a transcription when no longer needed:Notes
Create a SOAP Note
Generate a SOAP note from a transcript:Create with Context
Provide additional context to improve note quality:Retrieve a Note
Poll for the completed note:Response Handling
Pydantic Models
All API responses are returned as Pydantic models with full type hints:Serialization Methods
Convert responses to different formats:Distinguishing Null vs Missing Fields
Usemodel_fields_set to check which fields were explicitly returned:
Error Handling
The SDK raises specific exceptions for different error conditions:Exception Classes
| Exception | Description |
|---|---|
APIError | Base class for all API errors |
AuthenticationError | Invalid or missing API credentials |
RateLimitError | Too many requests; includes retry_after |
BadRequestError | Invalid request parameters |
NotFoundError | Requested resource does not exist |
APIConnectionError | Network connectivity issues |