1

Create an account + Generate an API Key

Log into qualifire or create an account. Once you have an account, you can generate an API key.

2

when setting the integration also set a base url

Azure OpenAI requires a base url to be set. This can be done by setting the base url in the integration settings.

3

Set QUALIFIRE_API_KEY as an environment variable

QUALIFIRE_API_KEY=<your API key>
4

Modify the base path and add a Qualifire-X-Api-Key header

If you created a direct integration, you can omit the defaultHeaders property.

import os
from openai import AzureOpenAI

deployment = os.getenv("DEPLOYMENT_NAME", "qualifire-gpt-4")
subscription_key = os.getenv("AZURE_OPENAI_API_KEY", "REPLACE_WITH_YOUR_KEY_VALUE_HERE")

# Initialize Azure OpenAI client with key-based authentication
client = AzureOpenAI(
    azure_endpoint = "https://proxy.qualifire.ai/api/providers/openai",
    deployment_id = deployment,
    api_key = subscription_key,
    api_version = "2024-05-01-preview",
)