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
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.
From install to production
Three steps to your first request.
- 1
Install
Add the SDK to your project with npm, pnpm, or yarn.
$ npm install @hpprouter/sdk
npmpnpmyarn - 2
Call a model
Use hpprouter/auto or pick a specific provider and model.
hpprouter/auto200 OK - 3
Ship & scale
The same client works from prototype to production traffic.
Dev→Staging→Prod
One client for every request
Chat, stream, or call tools — same client, same types, no separate SDKs to learn.
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.