Skip to main content

Providers and integrations

Choose provider and integration type. Default selection is OpenAI with SDK. Every generated script calls observra.configure() before it creates provider client or sends HTTP request.

OBSERVRA_GATEWAY_KEY is Observra gateway API key. Keep provider API key separate.

Select a provider

OpenAISDK

import os
import observra

observra.configure(gateway_key=os.environ["OBSERVRA_GATEWAY_KEY"])

from openai import OpenAI

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
    {"role": "user", "content": "Hello"},
],
)
print(response.choices[0].message.content)

How routing works

For supported hosts, Observra adds x-gateway-key from OBSERVRA_GATEWAY_KEY. Provider bearer key is forwarded as x-provider-key; original Authorization header is removed. Provider API keys are never written into traces.

Next