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:
basePath
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);
Last updated 2 years ago