genos.api.health.BaseAPI
- class BaseAPI(session: Session, base_url: str, timeout: int = 30)[source]
Bases:
ABCBase class for all Genos API endpoints with token validation and error handling.
This class provides common functionality for all API endpoints, including: - Token validation and authentication error handling - Payment/credit insufficiency checking - Standardized error response handling - HTTP status code validation
Only responses with status code 200 are considered successful and will proceed to further analysis. All other status codes will raise appropriate exceptions with the received error message.
- __init__(session: Session, base_url: str, timeout: int = 30)[source]
Initialize the base API client.
- Parameters:
session (requests.Session) – Reusable HTTP session for API requests.
base_url (str) – Base URL of the Genos service.
timeout (int, optional) – Request timeout in seconds. Default is 30.
Methods
__init__(session, base_url[, timeout])Initialize the base API client.