Integrations · OpenAI

One line around chat.completions.

Wrap your OpenAI client once. Messages, tool calls, token usage — every call captured through canonicalization and signing without application code modifications.

The wrapper keeps the same surface (chat.completions.create, responses.create, beta.assistants, embeddings.create), so nothing in your application code changes except the import line.

The wrap pattern

Construct the OpenAI client as you already do — environment API key, Azure AD token provider, or custom base_url — then hand it to veridra.wrap_openaiwith a system_id that maps to a registered Govern system. The wrapper is re-entrant, streaming-aware, respects OpenAI's retry/rate-limit semantics, and propagates context (trace IDs, user IDs, deadlines) down the call stack.

python
from openai import OpenAI
import veridra

client = OpenAI()  # or AzureOpenAI(...)
wrapped = veridra.wrap_openai(client, system_id="loan-underwriter-v3")

resp = wrapped.chat.completions.create(
    model="gpt-4o-2024-08-06",
    messages=[{"role": "user", "content": "..."}],
)

What Veridra captures

Request payload

Full canonicalized chat/responses payload — messages, tools, response_format, temperature, seed, user id. Captured pre-redaction to enable PII policy evaluation. Redacted copies follow Govern policy requirements.

Model and routing metadata

Model slug (gpt-4o-2024-08-06, o1-preview), deployment region for Azure OpenAI, system_fingerprint, and OpenAI request ID. Enough to trace an incident to a specific model build.

Response and tool calls

Completion content, tool-call arguments, finish_reason. Refusal content and structured-output JSON included. Streaming responses captured post-aggregation.

Usage and cost

prompt_tokens, completion_tokens, cached_tokens, and reasoning_tokens for o-series models. Supports cost allocation and rate-limit incident anchoring.

What you get

  • Zero changes to prompts, tool schemas, or response handling.
  • Works with OpenAI, Azure OpenAI, and OpenAI-compatible endpoints (vLLM, Together, Groq).
  • Policy failures raise typed exceptions before model output reaches your code.
  • Opt-in request/response redaction via Govern policies, evaluated per call.
  • Compatible with LangChain, LlamaIndex, and Vercel AI SDK.
Latency
Under 40ms p50 overhead
The wrapper adds minimal overhead — typically under 40ms p50 for the canonicalize-sign-log round trip. Signing is inline with the model response; nothing is batched asynchronously.
Platform integration
Wrapped calls inherit your governance posture
Wrapped calls become Attest records bound to registered Govern systems, enforced against active policy versions, and streamed into Watch for drift detection on prompt distributions and refusal rates. The integration doesn't just sign — it connects your OpenAI surface to the full evidence pipeline.