Anthropic
Requirements
Section titled “Requirements”- An Anthropic API key loaded into the TapPass vault (
ANTHROPIC_API_KEY). - Your
tp_key and the TapPass gateway URL.
Option A — SDK
Section titled “Option A — SDK”from tappass import Agent
agent = Agent("https://tappass.example.com", "tp_...")response = agent.chat("Hello", model="claude-3-5-sonnet-20241022")Option B — Anthropic SDK, zero-code
Section titled “Option B — Anthropic SDK, zero-code”export ANTHROPIC_BASE_URL=https://tappass.example.comexport ANTHROPIC_API_KEY=tp_...import anthropic
client = anthropic.Anthropic() # picks up env varsmessage = client.messages.create( model="claude-3-5-sonnet-20241022", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}],)What’s supported
Section titled “What’s supported”messages(streaming + non-streaming)- Tool use (
tool_use/tool_resultcontent blocks) - Vision (image content blocks)
- Extended thinking (
thinkingblocks on Claude 3.7+) - Prompt caching (
cache_controlfields)
What changes
Section titled “What changes”| Header | Purpose |
|---|---|
x-api-key: tp_... | Your TapPass key — replaces the Anthropic key |
anthropic-version: 2023-06-01 | Standard Anthropic version header, passed through |
X-Agent-Id: <your-agent> | Optional — attaches audit events |
X-Governance-Flags: ... | Optional — per-request flag override |