{"_id":"@orth/sdk","_rev":"6-c14669b11bb12ada4378811fc1703dec","name":"@orth/sdk","dist-tags":{"latest":"0.5.1"},"versions":{"0.1.0":{"name":"@orth/sdk","version":"0.1.0","keywords":["orthogonal","api","sdk","x402","payments","ai-agents"],"author":{"url":"https://orthogonal.sh","name":"Orthogonal","email":"founders@orthogonal.sh"},"license":"MIT","_id":"@orth/sdk@0.1.0","maintainers":[{"name":"berasogut","email":"bera@orthogonal.sh"}],"homepage":"https://orthogonal.sh","bugs":{"url":"https://github.com/orthogonal-sh/orthogonal-typescript/issues"},"dist":{"shasum":"80e6a61140a7171880a85c037e7895cff4976c96","tarball":"https://registry.npmjs.org/@orth/sdk/-/sdk-0.1.0.tgz","fileCount":9,"integrity":"sha512-z39Dj48KLdnresTcMGB4lGWwMVxvayFwLeTheSm7H4Qe/G/65HnEAZjfzAcZEBxizvrC4UNMBlNys5yOEBlYPg==","signatures":[{"sig":"MEQCIAkbLfb6uV+Ztu8Iw1ap+Pu04G0/QDDvrjQP0SVV7ZBkAiBft2+xo5SFLDMA+OMK1pQm/jRlLOxjDytOv8ctJdEVYg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15462},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"364f7a86057864f7e7ef4a0cb59b12ef271397a8","scripts":{"test":"vitest","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"berasogut","email":"bera@orthogonal.sh"},"repository":{"url":"git+https://github.com/orthogonal-sh/orthogonal-typescript.git","type":"git"},"_npmVersion":"10.2.4","description":"TypeScript SDK to call any API on the Orthogonal platform","directories":{},"sideEffects":false,"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.0.0","vitest":"^1.0.0","typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1768875017330_0.296837389873561","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@orth/sdk","version":"0.3.1","keywords":["orthogonal","api","sdk","x402","payments","ai-agents"],"author":{"url":"https://orthogonal.sh","name":"Orthogonal","email":"founders@orthogonal.sh"},"license":"MIT","_id":"@orth/sdk@0.3.1","maintainers":[{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},{"name":"berasogut","email":"bera@orthogonal.sh"}],"homepage":"https://orthogonal.sh","bugs":{"url":"https://github.com/orthogonal-sh/orthogonal-typescript/issues"},"dist":{"shasum":"03d050462863dc5c463f3e3988b3585c90d6cece","tarball":"https://registry.npmjs.org/@orth/sdk/-/sdk-0.3.1.tgz","fileCount":9,"integrity":"sha512-6ceFkA0UV07M773PwpXInqaT2otDKyvNk69LEt4Wtp0xqQDEd6fZG2XguJhggGB+hOaDc2K1awZPKbrMi2UaJg==","signatures":[{"sig":"MEUCIQD2PfB0w6UKdtmOsTaD6OvOlucOw4Y8g7lW8b8c200UuwIgbUDw+v8g6rhtZ+UOeXgOxV2ikcIAo+45Djo2hlfV37I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@orth%2fsdk@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16418},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"944df66c0ddc3b288118b6c3bbc648e3d668c765","scripts":{"test":"vitest","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},"repository":{"url":"git+https://github.com/orthogonal-sh/orthogonal-typescript.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript SDK to call any API on the Orthogonal platform","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.0.0","vitest":"^1.0.0","typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.3.1_1770855957824_0.9351080003026553","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@orth/sdk","version":"0.3.2","keywords":["orthogonal","api","sdk","x402","payments","ai-agents"],"author":{"url":"https://orthogonal.sh","name":"Orthogonal","email":"founders@orthogonal.sh"},"license":"MIT","_id":"@orth/sdk@0.3.2","maintainers":[{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},{"name":"berasogut","email":"bera@orthogonal.sh"}],"homepage":"https://orthogonal.sh","bugs":{"url":"https://github.com/orthogonal-sh/orthogonal-typescript/issues"},"dist":{"shasum":"a5e7fc97487f3afa1d5072579f62b0ddcd4d8223","tarball":"https://registry.npmjs.org/@orth/sdk/-/sdk-0.3.2.tgz","fileCount":9,"integrity":"sha512-KBfSkmgXLsa3SVuQMN6D016soGgtpNV8luasnX51ALeOV0LwVnVACsMxt9oVcJJVgll6fyBDdBsn01AWSiOQJg==","signatures":[{"sig":"MEUCIQDH20ir+HyyE4jZgntNGhM4QfQ2u93mKIUmubS56KYfjgIgOUC6+QJwg3EeNL/4mDJnKwu56foFhG6CK4v/lCVCpmw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16418},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"e4c7f6f58ec0094f1997fd5214d81d28a5d59c29","scripts":{"test":"vitest","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},"repository":{"url":"git+https://github.com/orthogonal-sh/orthogonal-typescript.git","type":"git"},"_npmVersion":"11.11.1","description":"TypeScript SDK to call any API on the Orthogonal platform","directories":{},"sideEffects":false,"_nodeVersion":"25.8.2","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.0.0","vitest":"^1.0.0","typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.3.2_1776492511496_0.9929582027532051","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@orth/sdk","version":"0.5.0","keywords":["orthogonal","api","sdk","x402","payments","ai-agents"],"author":{"url":"https://orthogonal.sh","name":"Orthogonal","email":"founders@orthogonal.sh"},"license":"MIT","_id":"@orth/sdk@0.5.0","maintainers":[{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},{"name":"berasogut","email":"bera@orthogonal.sh"}],"homepage":"https://orthogonal.sh","bugs":{"url":"https://github.com/orthogonal-sh/orthogonal-typescript/issues"},"dist":{"shasum":"89e47a9b243de6815811ab35fd058baad3e1325b","tarball":"https://registry.npmjs.org/@orth/sdk/-/sdk-0.5.0.tgz","fileCount":9,"integrity":"sha512-dS0NP+QIaTmTZZVB++CugF9lhuNEUD3oscdBRBHQrc29NvsuTBx6Z+dt70rvgHKMEWC3g30sGM+bORvSv0QxLg==","signatures":[{"sig":"MEUCIQCIc1TOir08HKybibFScMPSJyAo1H7vq4Go5au2wg051QIgMX/59GX7sKnWpNN/hGKdusSsRDshHggzc+wlYMQK0dE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@orth%2fsdk@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31607},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"05a854bd660a62a1f7f955d104176b65e4f783a1","scripts":{"test":"vitest","build":"tsup","prepublishOnly":"npm run build"},"_npmUser":{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},"repository":{"url":"git+https://github.com/orthogonal-sh/orthogonal-typescript.git","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript SDK to call any API on the Orthogonal platform","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.0.0","vitest":"^1.0.0","typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.5.0_1783195665511_0.9136121904167407","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@orth/sdk","version":"0.5.1","description":"TypeScript SDK to call any API on the Orthogonal platform","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"sideEffects":false,"scripts":{"build":"tsup","test":"vitest","prepublishOnly":"npm run build"},"keywords":["orthogonal","api","sdk","x402","payments","ai-agents"],"author":{"name":"Orthogonal","email":"founders@orthogonal.sh","url":"https://orthogonal.sh"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/orthogonal-sh/orthogonal-typescript.git"},"homepage":"https://orthogonal.sh","bugs":{"url":"https://github.com/orthogonal-sh/orthogonal-typescript/issues"},"engines":{"node":">=18"},"devDependencies":{"tsup":"^8.0.0","tsx":"^4.21.0","typescript":"^5.0.0","vitest":"^1.0.0"},"_id":"@orth/sdk@0.5.1","gitHead":"6e439016de75b4cea6031640f48be8a610bad537","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-RGeaNAbp1qYJ7fE+46+ITHR0D8PcX0jCtnrt6LSLNK6N54m7bLNLzO2LAqswFKYh6zkJwLav+AcWnMBTdM+16w==","shasum":"c4d4d91327cc0c9d4a0c2f17029382c249b1b713","tarball":"https://registry.npmjs.org/@orth/sdk/-/sdk-0.5.1.tgz","fileCount":9,"unpackedSize":37022,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@orth%2fsdk@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDRuefjSu0TcKtQoZbFC5Nbv5bofwwqJ8qw9mInSUsj7QIgaMoq38hfozwdRGaPaUng359WkfBgfKwQb3uVH2P8oOk="}]},"_npmUser":{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},"directories":{},"maintainers":[{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},{"name":"berasogut","email":"bera@orthogonal.sh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.5.1_1783204376310_0.21232441740247143"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-20T02:10:17.211Z","modified":"2026-07-04T22:32:56.734Z","0.1.0":"2026-01-20T02:10:17.486Z","0.3.1":"2026-02-12T00:25:57.970Z","0.3.2":"2026-04-18T06:08:31.639Z","0.5.0":"2026-07-04T20:07:45.651Z","0.5.1":"2026-07-04T22:32:56.457Z"},"bugs":{"url":"https://github.com/orthogonal-sh/orthogonal-typescript/issues"},"author":{"name":"Orthogonal","email":"founders@orthogonal.sh","url":"https://orthogonal.sh"},"license":"MIT","homepage":"https://orthogonal.sh","keywords":["orthogonal","api","sdk","x402","payments","ai-agents"],"repository":{"type":"git","url":"git+https://github.com/orthogonal-sh/orthogonal-typescript.git"},"description":"TypeScript SDK to call any API on the Orthogonal platform","maintainers":[{"name":"christianpickettcode","email":"pickett.christian@outlook.com"},{"name":"berasogut","email":"bera@orthogonal.sh"}],"readme":"<div align=\"center\">\n\n# Orthogonal SDK\n\n**Call any API on the [Orthogonal](https://orthogonal.com) platform from TypeScript — one client, one balance.**\n\nReach 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.\n\n[![npm version](https://img.shields.io/npm/v/@orth/sdk.svg?logo=npm&color=cb3837)](https://www.npmjs.com/package/@orth/sdk)\n[![npm downloads](https://img.shields.io/npm/dm/@orth/sdk.svg?color=cb3837)](https://www.npmjs.com/package/@orth/sdk)\n[![types](https://img.shields.io/npm/types/@orth/sdk.svg?logo=typescript&color=3178c6)](https://www.npmjs.com/package/@orth/sdk)\n[![node](https://img.shields.io/node/v/@orth/sdk.svg?logo=node.js&color=339933)](https://nodejs.org)\n[![license](https://img.shields.io/npm/l/@orth/sdk.svg?color=blue)](./LICENSE)\n\n</div>\n\n## Table of Contents\n\n- [Why Orthogonal](#why-orthogonal)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Authentication](#authentication)\n- [Usage](#usage)\n- [Error Handling](#error-handling)\n- [API Reference](#api-reference)\n- [TypeScript](#typescript)\n- [Related](#related)\n- [License](#license)\n\n## Why Orthogonal\n\nOrthogonal is a marketplace of production APIs behind one account and one balance:\n\n- **One integration** — call any API on the platform through a single `run()` method.\n- **Pay per use** — a single credit balance instead of juggling dozens of provider subscriptions.\n- **Self-correcting errors** — failed calls carry a structured hint (expected schema, unexpected/missing fields, numeric bounds) so agents can fix and retry.\n- **Fully typed** — ships with TypeScript definitions and ESM + CJS builds.\n\n## Installation\n\nRequires **Node.js 18+**.\n\n```bash\nnpm install @orth/sdk\n# or: pnpm add @orth/sdk  /  yarn add @orth/sdk\n```\n\n## Quick Start\n\n```typescript\nimport Orthogonal from \"@orth/sdk\";\n\nconst orthogonal = new Orthogonal({\n  apiKey: process.env.ORTHOGONAL_API_KEY!,\n});\n\nconst res = await orthogonal.run({\n  api: \"tavily\",\n  path: \"/search\",\n  query: { query: \"latest AI news\" },\n});\n\nconsole.log(res.data);   // the upstream API's response\nconsole.log(res.price);  // amount charged, e.g. \"0.01\"\n```\n\nGet an API key from your [Orthogonal dashboard](https://orthogonal.com/dashboard).\n\n## Authentication\n\nPass your key to the constructor:\n\n```typescript\nconst orthogonal = new Orthogonal({ apiKey: \"orth_live_your_key\" });\n```\n\nPrefer reading it from the environment so keys never live in source:\n\n```typescript\nconst orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY! });\n```\n\n## Usage\n\n### GET request (query params)\n\n```typescript\nconst res = await orthogonal.run({\n  api: \"fantastic-jobs\",\n  path: \"/v1/active-ats\",\n  query: { time_frame: \"1h\", limit: 10 },\n});\n```\n\n### POST request (JSON body)\n\n```typescript\nconst res = await orthogonal.run({\n  api: \"some-api\",\n  path: \"/v1/generate\",\n  body: { prompt: \"a red bicycle\" },\n});\n```\n\n### Custom headers\n\nHeaders passed to the constructor are sent on every request:\n\n```typescript\nconst orthogonal = new Orthogonal({\n  apiKey: process.env.ORTHOGONAL_API_KEY!,\n  headers: { \"x-my-trace-id\": \"abc123\" },\n});\n```\n\n## Error Handling\n\n`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:\n\n```typescript\nimport Orthogonal, { OrthogonalRunError } from \"@orth/sdk\";\n\ntry {\n  const res = await orthogonal.run({\n    api: \"fantastic-jobs\",\n    path: \"/v1/active-ats\",\n    query: { time_frame: \"1h\", company: \"Google\" }, // wrong field name\n  });\n} catch (err) {\n  if (err instanceof OrthogonalRunError) {\n    console.error(err.message);          // human-readable summary\n    console.error(err.status);           // HTTP status, e.g. 400\n    console.error(err.orthogonal);       // self-correction hint (see below)\n    console.error(err.responseBody);     // full parsed error body\n  }\n}\n```\n\nOn 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.\n\n## API Reference\n\n### `new Orthogonal(config)`\n\n| Option | Type | Description |\n| --- | --- | --- |\n| `apiKey` | `string` | **Required.** Your Orthogonal API key (`orth_live_…` / `orth_test_…`). |\n| `headers` | `Record<string, string>` | Optional headers sent on every request. |\n\n### `orthogonal.run(options)` → `Promise<RunResponse>`\n\n| Option | Type | Description |\n| --- | --- | --- |\n| `api` | `string` | **Required.** The API slug (e.g. `\"tavily\"`). |\n| `path` | `string` | **Required.** The endpoint path (e.g. `\"/search\"`). |\n| `query` | `Record<string, unknown>` | Query parameters. |\n| `body` | `Record<string, unknown>` | Request body for POST/PUT/PATCH. |\n\n**`RunResponse`**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `success` | `boolean` | Whether the call succeeded. |\n| `price` | `string` | Amount charged in USD (e.g. `\"0.01\"`). |\n| `data` | `unknown` | The upstream API's response. |\n\n### `OrthogonalRunError`\n\nThrown by `run()` on a non-2xx response. Extends `Error`.\n\n| Property | Type | Description |\n| --- | --- | --- |\n| `status` | `number` | HTTP status of the failed response. |\n| `orthogonal` | `unknown` | Self-correction hint (expected schema, unexpected/missing fields), when present. |\n| `responseBody` | `unknown` | The full parsed response body. |\n\n## TypeScript\n\nThe package ships with type definitions and both ESM and CommonJS builds — no `@types` package needed. All options and responses (`OrthogonalConfig`, `RunOptions`, `RunResponse`) are exported.\n\n## Related\n\n- **[`@orth/cli`](https://www.npmjs.com/package/@orth/cli)** — the Orthogonal command-line tool for discovering and calling APIs from your terminal.\n\n## License\n\n[MIT](./LICENSE) © Orthogonal\n","readmeFilename":"README.md"}