Novita AI & Portkey Integration Guide
Streamline AI development by using Portkey AI Gateway with Novita AI for fast, secure, and reliable performance.
Portkey AI Gateway transforms how developers work with AI models like Novita AI, providing a unified interface for seamless access to multiple language models with fast, secure, and reliable routing. This integration simplifies AI development and improves application performance.
This guide will walk you through setting up Portkey AI Gateway and then integrating Novita AI API with Portkey.
How to Set Up Portkey AI Gateway
Setting up Portkey AI Gateway is simple and efficient, requiring just three key steps: configuring the gateway, sending your first request, and optimizing routing and guardrails for seamless performance.
Step 1: Setup your AI Gateway
To run the gateway locally, ensure Node.js and npm are installed on your system. Once ready, execute the following command:
After the gateway starts, two key URLs will be displayed:
-
The Gateway:
http://localhost:8787/v1
-
The Gateway Console:
http://localhost:8787/public/
Step 2: Make your first request
Begin by installing the Portkey AI Python library:
Next, execute the following Python code to send your first request:
Effortlessly monitor all your local logs in one centralized location using the Gateway Console at: http://localhost:8787/public/
.
Step 3: Routing & Guardrails
Portkey AI Gateway enables you to configure routing rules, add reliability features, and enforce guardrails. Below is an example configuration:
How to Integrate Novita AI API with Portkey
To access the Novita AI API via the Portkey AI Gateway, follow these steps:
Step 1: Install the Portkey SDK
Integrate the Portkey SDK into your application to seamlessly interact with Novita AI’s API through Portkey’s gateway.
Node.JS
Python
Step 2: Initialize Portkey with the Virtual Key
To integrate Novita AI with Portkey, retrieve your LLM API key from Novita AI and add it to Portkey to generate the virtual key.
Node.JS SDK
Python SDK
Step 3: Invoke Chat Completions with Novita AI
Utilize the Portkey instance to send requests to Novita AI. If necessary, you can override the virtual key directly within the API call.
Node.JS SDK
Python SDK
Was this page helpful?