V
V
Valyr
Search
K

How to integrate

Integrate Valyr today with one line of code
Curl
Python
Node.js
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);