The TypeScript SDK for HPP Router

Type-safe chat, models, usage, and quota access with the official @hpprouter/sdk client — or call the OpenAI-compatible HTTP API directly.

Install

shellscript
npm install @hpprouter/sdk

OpenAI compatible

Point existing OpenAI SDKs at the gateway URL with your portal API key.

Streaming & tools

SSE chat completions with resolved model metadata and audit log headers.

Type-safe client

TypeScript types for requests, responses, and streaming events, generated from the OpenAPI spec.

Smart routing

hpprouter/auto picks a provider and model for each request automatically.

On-chain audit

Every billed request can be anchored to the HPP audit blockchain for verification.

Portal app

Keys, chat, billing, and activity in the authenticated app — no separate install.

Sign in

From install to production

Three steps to your first request.

  1. 1

    Install

    Add the SDK to your project with npm, pnpm, or yarn.

    $ npm install @hpprouter/sdk

    npmpnpmyarn
  2. 2

    Call a model

    Use hpprouter/auto or pick a specific provider and model.

    hpprouter/auto
    200 OK
  3. 3

    Ship & scale

    The same client works from prototype to production traffic.

    DevStagingProd

One client for every request

Chat, stream, or call tools — same client, same types, no separate SDKs to learn.

typescript
import { HppRouter } from '@hpprouter/sdk';

const client = new HppRouter({
  apiKey: process.env.HPPROUTER_API_KEY!,
  baseURL: 'https://router.hpp.io',
});

const completion = await client.chat.send({
  model: 'hpprouter/auto',
  messages: [{ role: 'user', content: 'Hello!' }],
});

console.log(completion.data.choices[0].message.content);
console.log(completion.meta.resolvedModel);

Ship your first request

Grab an API key and call any model in minutes.