Claude native (Anthropic Messages)
POST https://gateway.mindproxy.ai/v1/messages
POST https://gateway.mindproxy.ai/anthropic/v1/messagesCompatible with the Anthropic Messages API; use the official Anthropic SDK with base_url pointed at the platform.
Authentication
Accepts x-api-key: sk-..., or Authorization: Bearer sk-.... Sending an anthropic-version header is recommended.
Request
bash
curl https://gateway.mindproxy.ai/v1/messages \
-H "x-api-key: $TT_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-5-sonnet",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Introduce Shanghai in one sentence."}
]
}'| Field | Description |
|---|---|
model | Public model ID (e.g. claude-3-5-sonnet) |
max_tokens | Required, max output tokens |
messages | Conversation messages |
system | System prompt (top-level field, not a message) |
stream | true enables streaming |
Response
json
{
"id": "msg_...",
"type": "message",
"role": "assistant",
"model": "claude-3-5-sonnet",
"content": [{"type": "text", "text": "Shanghai is China's economic and financial center."}],
"stop_reason": "end_turn",
"usage": {"input_tokens": 18, "output_tokens": 12}
}usage is the billing basis.
Token counting (free)
POST https://gateway.mindproxy.ai/v1/messages/count_tokensEstimates input token count; it is not billed.
SDK
See Python · Claude and Node.js · Claude. Set the Anthropic SDK base_url to https://gateway.mindproxy.ai; the SDK appends /v1/messages.