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
- 01Install the Portkey package
- 02Integrate Portkey in TypeScript or JavaScript
- 03Apply LLM observability and caching
- 04Route requests across LLM providers
- 05Use reliability features
Use cases
- 01Add Portkey to a Node.js application
- 02Route LLM requests across providers
- 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-sdkAfter installing, type/portkey-typescript-sdkin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
assets/.gitkeepreferences/.gitkeepscripts/.gitkeepDetails
From the project READMEPortkey 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