Endpoints API (Python)

Methods, examples, and parameters for client.endpoints.

Module Overview

Manage custom provider endpoints and routing targets used by your organization.

Available Methods

  • client.endpoints.list() - List configured endpoints.
  • client.endpoints.create() - Create a private endpoint.
  • client.endpoints.delete() - Delete an endpoint by ID.

Examples

Python
from therouter import TheRouter.ai

client = TheRouter.ai(
    api_key=os.getenv("THEROUTER_API_KEY"),
    base_url="https://api.therouter.ai/v1",
)

endpoint = client.endpoints.create(
    name="private-openai",
    provider="openai",
    url="https://proxy.example.com/v1",
)

print(endpoint.id)
endpoints-response.json
{
  "id": "req_01HXYZ123",
  "module": "endpoints",
  "status": "ok"
}

Parameter Types

NameTypeRequiredDescription
name
stringRequiredDisplay name for the endpoint.
url
stringRequiredHTTPS URL for the endpoint.
provider
stringRequiredProvider type such as openai or anthropic.
SDK parity
Method signatures are aligned across SDKs so migration between TypeScript and Python stays predictable.