Client class provides synchronous access to all Avala API resources. It handles authentication, rate limiting, retries, and connection management.
Initialization
Create a client instance with your API key:Parameters
Your Avala API key. If not provided, the SDK will attempt to read from the
AVALA_API_KEY environment variable.Override the default API base URL. Useful for testing or using a different API environment.
Request timeout in seconds. Controls how long to wait for a response before raising a timeout error.
Maximum number of retry attempts for failed requests. The SDK automatically retries on network errors and 5xx server errors.
Context Manager
The recommended way to use the client is as a context manager, which ensures proper cleanup:Manual Cleanup
If you’re not using a context manager, make sure to callclose() when done:
Resource Access
The client provides access to all API resources through dedicated properties defined inavala/_client.py:42-57:
Available Resources
All resources are initialized when the client is created:agents- AI agent managementannotation_issues- Annotation quality issuesauto_label_jobs- Automated labeling jobsconsensus- Consensus annotation trackingdatasets- Dataset managementexports- Data export operationsfleet- Fleet managementinference_providers- AI model provider configurationorganizations- Organization settingsprojects- Project managementquality_targets- Quality metrics and targetsslices- Dataset slicing and filteringstorage_configs- Storage configurationtasks- Task managementwebhooks- Webhook configurationwebhook_deliveries- Webhook delivery logs
Rate Limit Information
Access rate limit information from the last API response:The
rate_limit_info property returns a dictionary containing rate limit headers from the most recent API response. It may be empty if no requests have been made yet.Thread Safety
Next Steps
AsyncClient
Learn about the async client for concurrent operations
Error Handling
Handle API errors gracefully