@evalops/anthropic
v0.3.0
Published
Drop-in Anthropic SDK shim for EvalOps llm-gateway routing
Downloads
559
Readme
evalops-anthropic
Drop-in Anthropic SDK shim for stamping EvalOps organization scope, principal attribution, trace IDs, and provider references onto Anthropic-compatible requests.
This package wraps the official Anthropic SDKs so teams can route model calls through EvalOps with minimal code changes.
Python
pip install evalops-anthropicfrom evalops_anthropic import Anthropic
client = Anthropic(organization_id="org_123", principal="user:[email protected]")
message = client.messages.create(
**client.with_provider_ref(
{
"model": "claude-sonnet-4.6",
"max_tokens": 256,
"messages": [{"role": "user", "content": "hello"}],
}
)
)Node
npm install @evalops/anthropicimport { Anthropic } from "@evalops/anthropic";
const client = new Anthropic({
organizationId: "org_123",
principal: "user:[email protected]",
});
const message = await client.messages.create(
client.withProviderRef({
model: "claude-sonnet-4.6",
max_tokens: 256,
messages: [{ role: "user", content: "hello" }],
}),
);Environment
EVALOPS_API_KEYorANTHROPIC_API_KEY: Platform-issued bearer token.EVALOPS_ORGANIZATION_ID: organization scope stamped into requests.EVALOPS_PRINCIPAL: optional actor string for audit attribution.EVALOPS_TRACE_ID: optional trace correlation ID.EVALOPS_LLM_GATEWAY_ANTHROPIC_URL: Anthropic-compatible gateway base URL.EVALOPS_LLM_GATEWAY_URL: fallback gateway base URL.EVALOPS_PROVIDER_ENVIRONMENT: defaults toprod.EVALOPS_PROVIDER_CREDENTIAL_NAME: optional provider ref credential name.EVALOPS_PROVIDER_TEAM_ID: optional provider ref team ID.
Provider References
Use with_provider_ref or withProviderRef when a request should select a
specific provider credential. Organizations with default provider routing can
omit the helper and keep the vendor SDK call shape.
