Claude Messages API
Claude API integration
NexusFlow's /v1/messages supports both native Anthropic Claude models and compatible-layer models. When model is claude-*, requests go directly to Anthropic's official Messages API, preserving the native response and SSE event format.
Endpoint
POST
https://nexusflow.vip/v1/messagesSync / StreamingRequest Parameters
Supported Models and Official Pricing
Invocation Examples
Prompt Caching (Context Caching)
Calling via /v1/messages supports Prompt Caching. Add cache_control annotations to content blocks in system or messages; repeated prefixes will be cached, and subsequent requests that hit the cache receive a 90% discount:
Usage example: Add "cache_control": {"type": "ephemeral"} to the system block. Suitable for long system prompts, document context, and other repeated content. Both Claude direct and NexusFlow compatible models support this.
Related Docs