Providers API (Python)
Methods, examples, and parameters for client.providers.
Module Overview
Inspect provider health, regions, and routing configuration for each backend.
Available Methods
client.providers.list()- List providers and their states.client.providers.retrieve()- Read one provider by ID.client.providers.health()- Check provider health probes.
Examples
Python
from therouter import TheRouter.ai
client = TheRouter.ai(
api_key=os.getenv("THEROUTER_API_KEY"),
base_url="https://api.therouter.ai/v1",
)
providers = client.providers.list()
health = client.providers.health()
print(len(providers.data), health.summary)providers-response.json
{
"id": "req_01HXYZ123",
"module": "providers",
"status": "ok"
}Parameter Types
| Name | Type | Required | Description |
|---|---|---|---|
provider_id | string | Provider identifier. | |
region | string | Region filter such as us-east-2. | |
status | string | health status filter. |
SDK parity
Method signatures are aligned across SDKs so migration between TypeScript and Python stays predictable.