Integration
Route LangChain through RemKey
LangChain is the LLM application framework. Here's the one change that puts it behind a governed gateway.
LangChain's chat models take a base_url (and an api_key) straight through to the client. Point them at RemKey and every chain, tool, and agent step in your app inherits classifier routing, guardrails, and the audit chain, without a single custom callback handler.
Why route it through RemKey
- Governance at the framework boundary, not sprinkled through your code. Set the base URL on the model once and every downstream chain and agent inherits it.
- Classifier routing across a mixed workload, RAG lookups, extraction, summarization, hard reasoning, each request lands on the right tier instead of paying one flat premium.
- PII and injection screening on every LLM call, fail-closed, including the untrusted documents your retrievers pull into prompts.
- A signed audit trail of every model call your app made in production, the evidence a security review actually asks for.
Swap these lines
Python, set base_url on the chat model
# OpenAI-compatible path from langchain_openai import ChatOpenAI llm = ChatOpenAI( model="gpt-4o", base_url="https://remkey.ai/v1", api_key="rk_live_...your RemKey key...", ) # Or the Anthropic-compatible path from langchain_anthropic import ChatAnthropic llm = ChatAnthropic( model="claude-sonnet-4", base_url="https://remkey.ai", api_key="rk_live_...your RemKey key...", )
Same for JS/TS: pass configuration.baseURL (ChatOpenAI) or clientOptions.baseURL (ChatAnthropic). The framework never knows it's talking to a gateway.
Drop-in by design. RemKey accepts both Authorization: Bearer and x-api-key, and serves the native OpenAI and Anthropic wire formats. The base-URL swap is the only code change.