portkey-typescript-sdk
11
总安装量
7
周安装量
#28712
全站排名
安装命令
npx skills add https://github.com/portkey-ai/skills --skill portkey-typescript-sdk
Agent 安装分布
opencode
6
amp
3
kimi-cli
3
codex
3
github-copilot
3
claude-code
3
Skill 文档
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);