npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@orth/sdk

v0.5.1

Published

TypeScript SDK to call any API on the Orthogonal platform

Downloads

1,407

Readme

Orthogonal SDK

Call any API on the Orthogonal platform from TypeScript — one client, one balance.

Reach hundreds of production APIs through a single client and a single credit balance. No per-provider signups, keys, or contracts — authentication, routing, and billing are handled for you.

npm version npm downloads types node license

Table of Contents

Why Orthogonal

Orthogonal is a marketplace of production APIs behind one account and one balance:

  • One integration — call any API on the platform through a single run() method.
  • Pay per use — a single credit balance instead of juggling dozens of provider subscriptions.
  • Self-correcting errors — failed calls carry a structured hint (expected schema, unexpected/missing fields, numeric bounds) so agents can fix and retry.
  • Fully typed — ships with TypeScript definitions and ESM + CJS builds.

Installation

Requires Node.js 18+.

npm install @orth/sdk
# or: pnpm add @orth/sdk  /  yarn add @orth/sdk

Quick Start

import Orthogonal from "@orth/sdk";

const orthogonal = new Orthogonal({
  apiKey: process.env.ORTHOGONAL_API_KEY!,
});

const res = await orthogonal.run({
  api: "tavily",
  path: "/search",
  query: { query: "latest AI news" },
});

console.log(res.data);   // the upstream API's response
console.log(res.price);  // amount charged, e.g. "0.01"

Get an API key from your Orthogonal dashboard.

Authentication

Pass your key to the constructor:

const orthogonal = new Orthogonal({ apiKey: "orth_live_your_key" });

Prefer reading it from the environment so keys never live in source:

const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY! });

Usage

GET request (query params)

const res = await orthogonal.run({
  api: "fantastic-jobs",
  path: "/v1/active-ats",
  query: { time_frame: "1h", limit: 10 },
});

POST request (JSON body)

const res = await orthogonal.run({
  api: "some-api",
  path: "/v1/generate",
  body: { prompt: "a red bicycle" },
});

Custom headers

Headers passed to the constructor are sent on every request:

const orthogonal = new Orthogonal({
  apiKey: process.env.ORTHOGONAL_API_KEY!,
  headers: { "x-my-trace-id": "abc123" },
});

Error Handling

run() resolves with the response on success and throws an OrthogonalRunError on any non-2xx response. The error extends Error (so error.message and instanceof Error work) and carries structured details:

import Orthogonal, { OrthogonalRunError } from "@orth/sdk";

try {
  const res = await orthogonal.run({
    api: "fantastic-jobs",
    path: "/v1/active-ats",
    query: { time_frame: "1h", company: "Google" }, // wrong field name
  });
} catch (err) {
  if (err instanceof OrthogonalRunError) {
    console.error(err.message);          // human-readable summary
    console.error(err.status);           // HTTP status, e.g. 400
    console.error(err.orthogonal);       // self-correction hint (see below)
    console.error(err.responseBody);     // full parsed error body
  }
}

On a contract violation the orthogonal hint tells you exactly what to fix — for example, that company is an unexpected field and organization is the expected one, plus the endpoint's expected schema — so an agent can correct the request and retry instead of repeating a failing call.

API Reference

new Orthogonal(config)

| Option | Type | Description | | --- | --- | --- | | apiKey | string | Required. Your Orthogonal API key (orth_live_… / orth_test_…). | | headers | Record<string, string> | Optional headers sent on every request. |

orthogonal.run(options) → Promise<RunResponse>

| Option | Type | Description | | --- | --- | --- | | api | string | Required. The API slug (e.g. "tavily"). | | path | string | Required. The endpoint path (e.g. "/search"). | | query | Record<string, unknown> | Query parameters. | | body | Record<string, unknown> | Request body for POST/PUT/PATCH. |

RunResponse

| Field | Type | Description | | --- | --- | --- | | success | boolean | Whether the call succeeded. | | price | string | Amount charged in USD (e.g. "0.01"). | | data | unknown | The upstream API's response. |

OrthogonalRunError

Thrown by run() on a non-2xx response. Extends Error.

| Property | Type | Description | | --- | --- | --- | | status | number | HTTP status of the failed response. | | orthogonal | unknown | Self-correction hint (expected schema, unexpected/missing fields), when present. | | responseBody | unknown | The full parsed response body. |

TypeScript

The package ships with type definitions and both ESM and CommonJS builds — no @types package needed. All options and responses (OrthogonalConfig, RunOptions, RunResponse) are exported.

Related

  • @orth/cli — the Orthogonal command-line tool for discovering and calling APIs from your terminal.

License

MIT © Orthogonal