Overview
This endpoint provides native Anthropic Messages API compatibility. Use this for Claude models with features like extended thinking.
Base URL for Anthropic SDK: https://api.lemondata.cc (no /v1 suffix)
Your LemonData API key. Alternative to Bearer token.
Anthropic API version. Use 2023-06-01.
Request Body
Claude model ID (e.g., claude-3-5-sonnet-20241022).
Array of message objects with role and content.
Maximum tokens to generate.
System prompt (separate from messages array).
Sampling temperature (0-1).
Enable streaming responses.
Extended thinking configuration (Claude 3.7+).
type (string): "enabled" to enable
budget_tokens (integer): Token budget for thinking
Available tools for the model.
Response
Unique message identifier.
Array of content blocks (text, thinking, tool_use).
Why generation stopped (end_turn, max_tokens, tool_use).
Token usage with input_tokens and output_tokens.
curl -X POST "https://api.lemondata.cc/v1/messages" \
-H "x-api-key: sk-your-api-key" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"system": "You are a helpful assistant.",
"messages": [
{"role": "user", "content": "Hello, Claude!"}
]
}'
{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"model": "claude-3-5-sonnet-20241022",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 15,
"output_tokens": 10
}
}
Extended Thinking Example
message = client.messages.create(
model="claude-3-7-sonnet-20250219-thinking",
max_tokens=16000,
thinking={
"type": "enabled",
"budget_tokens": 10000
},
messages=[{"role": "user", "content": "Solve this math problem..."}]
)
for block in message.content:
if block.type == "thinking":
print(f"Thinking: {block.thinking}")
elif block.type == "text":
print(f"Response: {block.text}")