Skip to content

evalops/evalops-anthropic

Repository files navigation

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-anthropic
from 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"}],
        }
    )
)

Node

npm install @evalops/anthropic
import { 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" }],
  }),
);

Environment

  • EVALOPS_API_KEY or ANTHROPIC_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 to prod.
  • 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.

About

Drop-in Anthropic SDK shim for EvalOps governance, audit, metering, and llm-gateway routing

Resources

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors