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

NameTypeRequiredDescription
provider_id
stringProvider identifier.
region
stringRegion filter such as us-east-2.
status
stringhealth status filter.
SDK parity
Method signatures are aligned across SDKs so migration between TypeScript and Python stays predictable.