Skip to main content

Client

The synchronous client for interacting with the Avala API.
from avala import Client

client = Client(api_key="your-api-key")

Initialization

api_key
str | None
default:"None"
Your Avala API key. If not provided, the client will attempt to read from the AVALA_API_KEY environment variable.
base_url
str | None
default:"None"
The base URL for the Avala API. If not provided, uses the default production API endpoint.
timeout
float
default:"30.0"
Request timeout in seconds.
max_retries
int
default:"2"
Maximum number of retry attempts for failed requests.

Resource Properties

The client provides access to all API resources through the following properties:
agents
Agents
Access to the Agents API resource.
annotation_issues
AnnotationIssues
Access to the Annotation Issues API resource.
auto_label_jobs
AutoLabelJobs
Access to the Auto Label Jobs API resource.
consensus
Consensus
Access to the Consensus API resource.
datasets
Datasets
Access to the Datasets API resource.
exports
Exports
Access to the Exports API resource.
fleet
Fleet
Access to the Fleet API resource.
inference_providers
InferenceProviders
Access to the Inference Providers API resource.
organizations
Organizations
Access to the Organizations API resource.
projects
Projects
Access to the Projects API resource.
quality_targets
QualityTargets
Access to the Quality Targets API resource.
slices
Slices
Access to the Slices API resource.
storage_configs
StorageConfigs
Access to the Storage Configs API resource.
tasks
Tasks
Access to the Tasks API resource.
webhooks
Webhooks
Access to the Webhooks API resource.
webhook_deliveries
WebhookDeliveries
Access to the Webhook Deliveries API resource.

Methods

rate_limit_info

@property
def rate_limit_info(self) -> dict[str, str | None]
Returns rate limit headers from the last API response.
rate_limit_info
dict[str, str | None]
Dictionary containing rate limit information from the most recent API response.

close

def close(self) -> None
Closes the HTTP transport and releases resources. Should be called when you’re done using the client.
client = Client(api_key="your-api-key")
try:
    # Use the client
    datasets = client.datasets.list()
finally:
    client.close()

Context Manager

The Client can be used as a context manager, which automatically handles cleanup:
with Client(api_key="your-api-key") as client:
    datasets = client.datasets.list()
    # client.close() is called automatically

Build docs developers (and LLMs) love