ANY /proxy/anthropic/*
Proxy requests to Anthropic API with automatic credential injection, policy enforcement, prompt drift detection, and cost tracking. All requests are logged in the audit trail.Authentication
Does not require session authentication. Uses Anthropic API key from the credential vault.Endpoint Format
/proxy/anthropic is forwarded to the Anthropic API (default: https://api.anthropic.com).
Request Flow
- Rate limiting (if configured): Check
llm.rate_limit_per_minute - LLM guards (if enabled):
- Model allowlist check (
llm.allowed_models) - Prompt drift detection (
llm.prompt_drift) - Prompt size limits (
llm.prompt_size_guard)
- Model allowlist check (
- Credential injection: Retrieve Anthropic API key from vault and add
x-api-keyheader - Upstream request: Forward to Anthropic API
- Cost tracking (if enabled): Parse usage and record cost based on
llm.model_pricing - Audit logging: Record decision, cost, and cryptographic proof in audit log
Policy Enforcement
Maximum requests per minute across all LLM providers. 0 = disabled.
List of allowed model names (case-insensitive). Empty = all models allowed.Example:
["claude-4.5-sonnet", "claude-3.5-haiku"]Enable prompt drift detection. Records baseline system prompt and alerts on changes.
Action when drift is detected:
alert (log warning) or deny (block request).Enable prompt size limiting.
Maximum total characters in prompt (approximate). 0 = no limit.
Cost Tracking
Fishnet tracks token usage and calculates costs based on model pricing:Anthropic’s Messages API includes usage in both streaming and non-streaming responses. Fishnet parses
usage.input_tokens and usage.output_tokens from the response.Headers Forwarding
All request headers are forwarded to Anthropic except:x-api-key(replaced with vault credential)authorization(stripped)host,connection,keep-alive,transfer-encoding,content-length(HTTP infrastructure)
anthropic-version are forwarded as-is.
Body Forwarding
Request bodies are forwarded as-is to Anthropic. For JSON requests, Fishnet parses the body to:- Extract the
modelfield for allowlist checking - Extract the
streamfield to detect streaming requests - Extract system prompts from messages for drift detection
- Count total characters for size limits
Examples
Streaming Example
Anthropic includes usage in streaming responses via
message_start and message_delta events. Fishnet accumulates these to track total cost.Error Responses
llm.allowed_models list.llm.prompt_drift.mode = deny.llm.prompt_size_guard.max_prompt_tokens when action is deny.llm.rate_limit_per_minute).Audit Log Entry
Each proxied request creates an audit log entry:GET /api/audit?service=anthropic.