mcpField
P
portkey-typescript-sdk

portkey-typescript-sdk

github.com/portkey-aiDevelopment268 installsUpdated 32w ago
Repository

About portkey-typescript-sdk

portkey-typescript-sdk is a skill for integrating Portkey into TypeScript and JavaScript applications. It covers LLM observability, caching, reliability, and routing requests across providers.

Key features

  1. 01Install the Portkey package
  2. 02Integrate Portkey in TypeScript or JavaScript
  3. 03Apply LLM observability and caching
  4. 04Route requests across LLM providers
  5. 05Use reliability features

Use cases

  1. 01Add Portkey to a Node.js application
  2. 02Route LLM requests across providers
  3. 03Introduce observability or caching for LLM calls

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/portkey-ai/skills --skill portkey-typescript-sdk

After installing, type/portkey-typescript-sdkin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
.gitkeep
references/
.gitkeep
scripts/
.gitkeep

Details

From the project README

Portkey TypeScript SDK

When to use this skill

Use this skill when:

  • The user wants to integrate Portkey into a TypeScript or JavaScript application
  • The user needs LLM observability, caching, or reliability features
  • The user wants to route requests across multiple LLM providers
  • The user mentions "Portkey", "AI gateway", or "LLM observability" in Node.js/TS context

Installation

npm install portkey-ai
# or
yarn add portkey-ai
# or
pnpm add portkey-ai

Quick Start

import Portkey from 'portkey-ai';

const client = new Portkey({
  apiKey: 'YOUR_PORTKEY_API_KEY',
  virtualKey: 'YOUR_VIRTUAL_KEY', // Optional: for provider routing
});

const response = await client.chat.completions.create({
  model: 'gpt-4',
  messages: [
    { role: 'user', content: 'Hello!' }
  ],
});

console.log(response.choices[0].message.content);

Comments

Markdown supported