Skip to main content
POST
/
v1
/
messages
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
  }
}

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)

Request Headers

x-api-key
string
required
Your LemonData API key. Alternative to Bearer token.
anthropic-version
string
required
Anthropic API version. Use 2023-06-01.

Request Body

model
string
required
Claude model ID (e.g., claude-3-5-sonnet-20241022).
messages
array
required
Array of message objects with role and content.
max_tokens
integer
required
Maximum tokens to generate.
system
string
System prompt (separate from messages array).
temperature
number
default:"1"
Sampling temperature (0-1).
stream
boolean
default:"false"
Enable streaming responses.
thinking
object
Extended thinking configuration (Claude 3.7+).
  • type (string): "enabled" to enable
  • budget_tokens (integer): Token budget for thinking
tools
array
Available tools for the model.

Response

id
string
Unique message identifier.
type
string
Always message.
role
string
Always assistant.
content
array
Array of content blocks (text, thinking, tool_use).
model
string
Model used.
stop_reason
string
Why generation stopped (end_turn, max_tokens, tool_use).
usage
object
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}")