Text Series
Create Messages (Claude)
Claude native message interface for Anthropic clients like Claude Code
POST
Introduction
The Messages API provides native Anthropic Claude interface compatibility through MixRoute , allowing direct use of Anthropic SDKs and tools like Claude Code. This interface follows Anthropic’s API specification and provides full Claude model functionality, including Extended Thinking, tool calling, and other advanced features. If you’re using OpenAI-compatible clients (like OpenAI SDK), we recommend using the/v1/chat/completions endpoint instead.
Authentication
Bearer Token, e.g.,Bearer sk-xxxxxxxxxx
Request Parameters
Claude model identifier, e.g.,
claude-sonnet-4-5-20250929, claude-opus-4-5-20251101List of conversation messages, each containing
role (user/assistant) and contentMaximum tokens to generate, must be greater than 0
System prompt, supports string format or array format (for Prompt Caching)
Enable streaming output
Sampling temperature, range 0-1
Nucleus sampling parameter, range 0-1
Top-k sampling parameter
Custom stop sequences
Extended thinking configuration, contains
type and budget_tokensList of tool definitions
Basic Examples
- Non-Streaming Request
- Streaming Request (SSE)
- Python Example
Advanced Features
System Prompt
- String Format
- Array Format
Extended Thinking
- Basic Usage
- Python Example
Tools
- Function Tools
- Claude Official Web Search Tool
Multimodal Input (Images)
Prompt Caching
By caching frequently used context content, you can significantly reduce costs and improve response speed. Cached content requires a minimum of 1024 tokens.- System Cache
- Messages Cache
- Python SDK Example
Response Format
- Non-Streaming Response
- Streaming Response