Skip to content
Docs

Integration Methods

AgentWatch supports native SDK endpoints for every major LLM provider. Customers only need to change the base URL and API key — no code changes, no format conversion, no wrapper SDKs.

Method 1: OpenAI SDK (Drop-in Replacement)

Section titled “Method 1: OpenAI SDK (Drop-in Replacement)”

Simply change the base URL. All existing OpenAI-compatible code works without modification.

Before:

client = OpenAI(api_key="sk-...")

After:

client = OpenAI(
base_url="https://agentwatch.yourcompany.com/v1",
api_key="ak_your_agentwatch_key"
)

Change azure_endpoint to your AgentWatch instance. The SDK sends requests to /openai/deployments/{model}/chat/completions with the api-key header — AgentWatch accepts both natively.

Before:

client = AzureOpenAI(
azure_endpoint="https://myresource.openai.azure.com",
api_key="azure-key-...",
api_version="2024-10-21"
)

After:

client = AzureOpenAI(
azure_endpoint="https://agentwatch.yourcompany.com",
api_key="ak_your_agentwatch_key",
api_version="2024-10-21"
)

Cross-provider routing: Azure SDK users can access Claude, Gemini, or any model assigned to their tenant. AgentWatch automatically converts image formats, tool calling schemas, and response structures between providers.

Change base_url to your AgentWatch instance root (no /v1 suffix). The SDK sends requests to /v1/messages with the x-api-key header.

Before:

client = Anthropic(api_key="sk-ant-...")

After:

client = Anthropic(
base_url="https://agentwatch.yourcompany.com",
api_key="ak_your_agentwatch_key"
)

Set the api_endpoint to your AgentWatch instance. The SDK sends requests to /v1beta/models/{model}:generateContent with the x-goog-api-key header or ?key= query parameter.

Before:

import google.generativeai as genai
genai.configure(api_key="AIza...")

After:

import google.generativeai as genai
genai.configure(
api_key="ak_your_agentwatch_key",
transport="rest",
client_options={"api_endpoint": "https://agentwatch.yourcompany.com"}
)

Change base_url to your AgentWatch instance. The SDK sends requests to /v2/chat.

Before:

client = cohere.ClientV2(api_key="cohere-key-...")

After:

client = cohere.ClientV2(
base_url="https://agentwatch.yourcompany.com",
api_key="ak_your_agentwatch_key"
)

Configure network proxy to route all LLM traffic through AgentWatch.

SDK Base URL to Set Auth Header Endpoints
OpenAI https://agentwatch.example.com/v1 Authorization: Bearer /v1/chat/completions, /v1/embeddings, /v1/models
Azure OpenAI https://agentwatch.example.com api-key /openai/deployments/{d}/chat/completions, /openai/deployments/{d}/embeddings, /openai/models
Anthropic https://agentwatch.example.com x-api-key /v1/messages
Google Gemini https://agentwatch.example.com x-goog-api-key or ?key= /v1beta/models/{m}:generateContent, /v1beta/models/{m}:streamGenerateContent
Cohere https://agentwatch.example.com Authorization: Bearer /v2/chat

Important: For OpenAI SDK, the base URL includes /v1. For all other SDKs, use the root domain only — each SDK appends its own path internally.

All enterprise controls are applied regardless of which SDK endpoint is used:

Feature /v1/chat/completions Azure SDK Anthropic SDK Gemini SDK Cohere SDK
Model ACL Yes Yes Yes Yes Yes
Max Tokens Enforcement Yes Yes Yes Yes Yes
DLP Scanning Yes Yes Passthrough Yes Yes
Budget Enforcement Yes Yes Yes Yes Yes
Usage Recording Yes Yes Yes Yes Yes
Enrichment Chain Yes Yes Yes Yes Yes
Multimodal (images) Yes Yes Native Yes Yes
Tool Calling Yes Yes Native Yes Yes
Streaming Yes Yes Yes Yes Yes