Skip to main content
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

string
required
Claude model identifier, e.g., claude-opus-4-8
array
required
List of conversation messages, each containing role (user/assistant) and content
integer
required
Maximum tokens to generate, must be greater than 0
string | array
System prompt, supports string format or array format (for Prompt Caching)
boolean
Enable streaming output
number
Sampling temperature, range 0-1
number
Nucleus sampling parameter, range 0-1
integer
Top-k sampling parameter
array
Custom stop sequences
object
Extended thinking configuration, contains type and budget_tokens
array
List of tool definitions

Basic Examples

Advanced Features

System Prompt

Extended Thinking

Tools

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.

Response Format