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.
pip install evalops-anthropicfrom evalops_anthropic import Anthropic
client = Anthropic(organization_id="org_123", principal="user:ada@example.com")
message = client.messages.create(
**client.with_provider_ref(
{
"model": "claude-sonnet-4.6",
"max_tokens": 256,
"messages": [{"role": "user", "content": "hello"}],
}
)
)npm install @evalops/anthropicimport { Anthropic } from "@evalops/anthropic";
const client = new Anthropic({
organizationId: "org_123",
principal: "user:ada@example.com",
});
const message = await client.messages.create(
client.withProviderRef({
model: "claude-sonnet-4.6",
max_tokens: 256,
messages: [{ role: "user", content: "hello" }],
}),
);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.
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.