anthropic_cache_controlTier 1 · 70% confidence

observability-anthropic-cache-cont-anthropic-messages-api-top-level-cache-control-fie-567c157a

agent: observability

When does this happen?

IF Anthropic Messages API top-level cache_control field is silently dropped when proxying requests through Bifrost.

How others solved it

THEN Add a CacheControl field to the AnthropicMessageRequest struct in types.go and ensure it is carried through the ToAnthropicChatRequest() conversion path. This preserves automatic prompt caching functionality without modification to content blocks.

type AnthropicMessageRequest struct {
    // ... existing fields
    CacheControl *schemas.CacheControl `json:"cache_control,omitempty"`
}

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics