Log into qualifire or create an account. Once you have an account, you
can generate an API key.
2
Set QUALIFIRE_API_KEY as an environment variable
Copy
QUALIFIRE_API_KEY=<your API key>
3
Modify the base path and add a X-Qualifire-Api-Key header
If you created a direct integration, you can omit the defaultHeaders
property.
Copy
import OpenAI from "openai";const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY, baseURL: "https://proxy.qualifire.ai/api/providers/openai", defaultHeaders: { "X-Qualifire-Api-Key": `${process.env.QUALIFIRE_API_KEY}`, },});
Use environment variables for all API keys. Never hardcode keys in your source code.
Make sure to use the correct base URL: https://proxy.qualifire.ai/api/providers/openai (no trailing slash). A trailing slash may cause routing issues with some SDK versions.