Basic Configuration
ImportCorsaClient and configure it with your API URL and token:
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
base_url | str | — | Base URL for the Corsa API. |
token | str | — | API token for authentication. Sent as Authorization: Bearer <token>. |
timeout | float | None | Request timeout in seconds. |
headers | dict[str, str] | {} | Additional HTTP headers to include on every request. |
raise_on_unexpected_status | bool | True | Raise UnexpectedStatus for undocumented HTTP status codes. |
httpx_args | dict[str, Any] | {} | Extra keyword arguments passed to the underlying httpx client. |
Custom Headers and Timeout
Async Client
For async applications, useAsyncCorsaClient:
Context Managers
Both clients support context managers for automatic cleanup:Direct Module Access
For full control over the HTTP response (status code, headers, raw body), use the generated API modules directly with the underlyingAuthenticatedClient: