LiteLLM proxy API TypeScript client: litellm-api

v2.14.1

Unofficial, fully typed TypeScript client for the LiteLLM proxy API, generated from its OpenAPI spec and published to npm as litellm-api.

Not affiliated with or endorsed by LiteLLM.

Installation
npm install litellm-api
Authentication

LiteLLM is self-hosted, so pass the baseUrl of your proxy and its master key as the token option.

Examples
import { LiteLLMApi } from "litellm-api";

const client = new LiteLLMApi({
  baseUrl: "http://localhost:4000",
  token: process.env.LITELLM_MASTER_KEY ?? null,
});

const routes = await client.api.default.getRoutesRoutesGet();
const routes = await client.request("GET /routes");
const client = new LiteLLMApi({
  baseUrl: "http://localhost:4000",
  token: process.env.LITELLM_MASTER_KEY ?? null,
  fetch: myFetchImplementation,
});