Python
Install and configure visgate-sdk for Python 3.9+.
Installation
Requires Python 3.9+.
Synchronous Client
Or with a context manager:
Asynchronous Client
Every method on Client has an async counterpart on AsyncClient.
Configuration
| Parameter | Default | Description |
|---|---|---|
api_key | $VISGATE_API_KEY | Visgate API key |
base_url | https://visgateai.com/api/v1 | API base URL |
timeout | 120.0 | Request timeout (seconds) |
max_retries | 2 | Automatic retries for transient errors |
fal_key | None | Fal.ai BYOK key |
replicate_key | None | Replicate BYOK key |
runway_key | None | Runway BYOK key |
Features
- Sync and async —
Clientfor synchronous code,AsyncClientfor async - Automatic retries — transient errors (429, 5xx) retried with exponential backoff
- Typed exceptions — catch
AuthenticationError,RateLimitError,ProviderError, etc. - Full type hints — PEP 561 compliant with
py.typedmarker - Context managers — both clients support
with/async withfor cleanup