Valyr
  • Valyr
  • Getting Started
    • How to integrate
    • How encryption works
  • Custom Parameters
    • Custom Parameters
      • User Tracking
      • Prompt Tracking
Powered by GitBook
On this page
  1. Getting Started

How to integrate

Integrate Valyr today with one line of code

Replace the OpenAI base url

POST https://api.openai.com/v1

with Valyr's

POST https://oai.valyrai.com/v1

Change the default base API url to Valyr's

import openai

openai.api_base = "https://oai.valyrai.com/v1"

Add a basePath to the Configuration:

Before:

import { Configuration, OpenAIApi } from "openai";

const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY
});

const openai = new OpenAIApi(configuration);

After:

import { Configuration, OpenAIApi } from "openai";

const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
  basePath: "https://oai.valyrai.com/v1",
});

const openai = new OpenAIApi(configuration);
PreviousValyrNextHow encryption works

Last updated 2 years ago