1.3.0 • Published 6 days ago

portkey-ai v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

Control Panel for AI Apps

npm install portkey-ai

Features

The Portkey SDK is built on top of the OpenAI SDK, allowing you to seamlessly integrate Portkey's advanced features while retaining full compatibility with OpenAI methods. With Portkey, you can enhance your interactions with OpenAI or any other OpenAI-like provider by leveraging robust monitoring, reliability, prompt management, and more features - without modifying much of your existing code.

AI Gateway

Observability

Usage

Prerequisites

  1. Sign up on Portkey and grab your Portkey API Key
  2. Add your OpenAI key to Portkey's Virtual Keys page and keep it handy
# Installing the SDK

$ npm install portkey-ai
$ export PORTKEY_API_KEY="PORTKEY_API_KEY"

Making a Request to OpenAI

  • Portkey fully adheres to the OpenAI SDK signature. You can instantly switch to Portkey and start using our production features right out of the box.
  • Just replace import OpenAI from 'openai' with import Portkey from 'portkey-ai':
import Portkey from 'portkey-ai';

const portkey = new Portkey({
    virtualKey: "VIRTUAL_KEY"
})

async function main() {
    const chatCompletion = await portkey.chat.completions.create({
        messages: [{ role: 'user', content: 'Say this is a test' }],
        model: 'gpt-4',
    });

    console.log(chatCompletion.choices);
};

main();

Check out Portkey docs for the full list of supported providers

Contributing

Get started by checking out Github issues. Email us at support@portkey.ai or just ping on Discord to chat.

1.3.0

6 days ago

1.2.1

2 months ago

1.2.0

2 months ago

1.1.5

3 months ago

1.1.4

3 months ago

1.1.3

4 months ago

1.1.2

4 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.0

5 months ago

0.1.12

7 months ago

0.1.13

7 months ago

0.1.14

6 months ago

0.1.15

6 months ago

0.1.16

6 months ago

0.1.11

7 months ago

0.1.10

7 months ago

0.1.9

7 months ago

0.1.8

7 months ago

0.1.7

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

8 months ago