Endpoints API (TypeScript)

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

TypeScript
import { TheRouter.ai } from "@therouter/sdk";

const client = new TheRouter.ai({ apiKey: process.env.THEROUTER_API_KEY! });

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

console.log(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.